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()
271
271
->disableOriginalConstructor ()
272
272
->getMock ();
273
273
274
- $ eventDispatcher ->expects ($ this ->at ( 1 ))
274
+ $ eventDispatcher ->expects ($ this ->exactly ( 4 ))
275
275
->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
+ );
291
302
292
303
$ consumer ->setEventDispatcher ($ eventDispatcher );
293
304
Original file line number Diff line number Diff line change 22
22
},
23
23
"require-dev" : {
24
24
"symfony/serializer" : " ^4.4|^5.3|^6.0" ,
25
- "phpunit/phpunit" : " ^7.5|^8 .5" ,
25
+ "phpunit/phpunit" : " ^9 .5" ,
26
26
"phpstan/phpstan" : " ^0.12.11" ,
27
27
"phpstan/phpstan-phpunit" : " ^0.12.6"
28
28
},
You can’t perform that action at this time.
0 commit comments