File tree Expand file tree Collapse file tree 2 files changed +28
-17
lines changed Expand file tree Collapse file tree 2 files changed +28
-17
lines changed Original file line number Diff line number Diff line change @@ -271,23 +271,34 @@ public function testShouldAllowContinueConsumptionAfterIdleTimeout()
271271 ->disableOriginalConstructor ()
272272 ->getMock ();
273273
274- $ eventDispatcher ->expects ($ this ->at ( 1 ))
274+ $ eventDispatcher ->expects ($ this ->exactly ( 4 ))
275275 ->method ('dispatch ' )
276- ->with ($ this ->isInstanceOf (OnIdleEvent::class), OnIdleEvent::NAME )
277- ->willReturnCallback (function (OnIdleEvent $ event , $ eventName ) {
278- $ event ->setForceStop (false );
279-
280- return $ event ;
281- });
282-
283- $ eventDispatcher ->expects ($ this ->at (3 ))
284- ->method ('dispatch ' )
285- ->with ($ this ->isInstanceOf (OnIdleEvent::class), OnIdleEvent::NAME )
286- ->willReturnCallback (function (OnIdleEvent $ event , $ eventName ) {
287- $ event ->setForceStop (true );
288-
289- return $ event ;
290- });
276+ ->withConsecutive (
277+ [
278+ $ this ->isInstanceOf (OnConsumeEvent::class),
279+ OnConsumeEvent::NAME ,
280+ ],
281+ [
282+ $ this ->callback (function (OnIdleEvent $ event ) {
283+ $ event ->setForceStop (false );
284+
285+ return true ;
286+ }),
287+ OnIdleEvent::NAME ,
288+ ],
289+ [
290+ $ this ->isInstanceOf (OnConsumeEvent::class),
291+ OnConsumeEvent::NAME ,
292+ ],
293+ [
294+ $ this ->callback (function (OnIdleEvent $ event ) {
295+ $ event ->setForceStop (true );
296+
297+ return true ;
298+ }),
299+ OnIdleEvent::NAME ,
300+ ]
301+ );
291302
292303 $ consumer ->setEventDispatcher ($ eventDispatcher );
293304
Original file line number Diff line number Diff line change 2222 },
2323 "require-dev" : {
2424 "symfony/serializer" : " ^4.4|^5.3|^6.0" ,
25- "phpunit/phpunit" : " ^7.5|^8 .5" ,
25+ "phpunit/phpunit" : " ^9 .5" ,
2626 "phpstan/phpstan" : " ^0.12.11" ,
2727 "phpstan/phpstan-phpunit" : " ^0.12.6"
2828 },
You can’t perform that action at this time.
0 commit comments