Skip to content

Commit 1161d15

Browse files
committed
Bump PHPUnit to 9.5
1 parent eb671a3 commit 1161d15

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

Tests/RabbitMq/ConsumerTest.php

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff 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

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
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
},

0 commit comments

Comments
 (0)