File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,24 @@ public function testQueuePropagateRetryUntilAndMaxExceptions()
179179 });
180180 }
181181
182+ public function testQueuePropagateTries ()
183+ {
184+ $ d = new Dispatcher ;
185+
186+ $ fakeQueue = new QueueFake (new Container );
187+
188+ $ d ->setQueueResolver (function () use ($ fakeQueue ) {
189+ return $ fakeQueue ;
190+ });
191+
192+ $ d ->listen ('some.event ' , TestDispatcherOptions::class.'@handle ' );
193+ $ d ->dispatch ('some.event ' , ['foo ' , 'bar ' ]);
194+
195+ $ fakeQueue ->assertPushed (CallQueuedListener::class, function ($ job ) {
196+ return $ job ->tries === 5 ;
197+ });
198+ }
199+
182200 public function testQueuePropagateMiddleware ()
183201 {
184202 $ d = new Dispatcher ;
@@ -294,6 +312,11 @@ public function retryUntil()
294312 return now ()->addHour (1 );
295313 }
296314
315+ public function tries ()
316+ {
317+ return 5 ;
318+ }
319+
297320 public function handle ()
298321 {
299322 //
You can’t perform that action at this time.
0 commit comments