@@ -41,8 +41,8 @@ public function test_job_can_be_fired()
41
41
$ worker = $ this ->getWorker ('default ' , ['queue ' => [$ job = new WorkerFakeJob ]]);
42
42
$ worker ->runNextJob ('default ' , 'queue ' , new WorkerOptions );
43
43
$ this ->assertTrue ($ job ->fired );
44
- $ this ->events ->shouldHaveReceived ('fire ' )->with (Mockery::type (JobProcessing::class))->once ();
45
- $ this ->events ->shouldHaveReceived ('fire ' )->with (Mockery::type (JobProcessed::class))->once ();
44
+ $ this ->events ->shouldHaveReceived ('dispatch ' )->with (Mockery::type (JobProcessing::class))->once ();
45
+ $ this ->events ->shouldHaveReceived ('dispatch ' )->with (Mockery::type (JobProcessed::class))->once ();
46
46
}
47
47
48
48
public function test_job_can_be_fired_based_on_priority ()
@@ -98,8 +98,8 @@ public function test_job_is_released_on_exception()
98
98
$ this ->assertEquals (10 , $ job ->releaseAfter );
99
99
$ this ->assertFalse ($ job ->deleted );
100
100
$ this ->exceptionHandler ->shouldHaveReceived ('report ' )->with ($ e );
101
- $ this ->events ->shouldHaveReceived ('fire ' )->with (Mockery::type (JobExceptionOccurred::class))->once ();
102
- $ this ->events ->shouldNotHaveReceived ('fire ' , [Mockery::type (JobProcessed::class)]);
101
+ $ this ->events ->shouldHaveReceived ('dispatch ' )->with (Mockery::type (JobExceptionOccurred::class))->once ();
102
+ $ this ->events ->shouldNotHaveReceived ('dispatch ' , [Mockery::type (JobProcessed::class)]);
103
103
}
104
104
105
105
public function test_job_is_not_released_if_it_has_exceeded_max_attempts ()
@@ -121,9 +121,9 @@ public function test_job_is_not_released_if_it_has_exceeded_max_attempts()
121
121
$ this ->assertTrue ($ job ->deleted );
122
122
$ this ->assertEquals ($ e , $ job ->failedWith );
123
123
$ this ->exceptionHandler ->shouldHaveReceived ('report ' )->with ($ e );
124
- $ this ->events ->shouldHaveReceived ('fire ' )->with (Mockery::type (JobExceptionOccurred::class))->once ();
125
- $ this ->events ->shouldHaveReceived ('fire ' )->with (Mockery::type (JobFailed::class))->once ();
126
- $ this ->events ->shouldNotHaveReceived ('fire ' , [Mockery::type (JobProcessed::class)]);
124
+ $ this ->events ->shouldHaveReceived ('dispatch ' )->with (Mockery::type (JobExceptionOccurred::class))->once ();
125
+ $ this ->events ->shouldHaveReceived ('dispatch ' )->with (Mockery::type (JobFailed::class))->once ();
126
+ $ this ->events ->shouldNotHaveReceived ('dispatch ' , [Mockery::type (JobProcessed::class)]);
127
127
}
128
128
129
129
public function test_job_is_failed_if_it_has_already_exceeded_max_attempts ()
@@ -141,9 +141,9 @@ public function test_job_is_failed_if_it_has_already_exceeded_max_attempts()
141
141
$ this ->assertTrue ($ job ->deleted );
142
142
$ this ->assertInstanceOf (MaxAttemptsExceededException::class, $ job ->failedWith );
143
143
$ this ->exceptionHandler ->shouldHaveReceived ('report ' )->with (Mockery::type (MaxAttemptsExceededException::class));
144
- $ this ->events ->shouldHaveReceived ('fire ' )->with (Mockery::type (JobExceptionOccurred::class))->once ();
145
- $ this ->events ->shouldHaveReceived ('fire ' )->with (Mockery::type (JobFailed::class))->once ();
146
- $ this ->events ->shouldNotHaveReceived ('fire ' , [Mockery::type (JobProcessed::class)]);
144
+ $ this ->events ->shouldHaveReceived ('dispatch ' )->with (Mockery::type (JobExceptionOccurred::class))->once ();
145
+ $ this ->events ->shouldHaveReceived ('dispatch ' )->with (Mockery::type (JobFailed::class))->once ();
146
+ $ this ->events ->shouldNotHaveReceived ('dispatch ' , [Mockery::type (JobProcessed::class)]);
147
147
}
148
148
149
149
public function test_job_based_max_retries ()
0 commit comments