Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4:
  Mitigate PHPUnit deprecations
  [TwigBundle] Add support for resetting globals between HTTP requests
  [Validator] Add Catalan and Spanish translation for `Week` constraint
  Don't use is_resource() on non-streams
  [Ldap] Fix extension deprecation
  • Loading branch information
derrabus committed Sep 8, 2024
2 parents 7985801 + e37c51b commit fcc415b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tests/Middleware/DispatchAfterCurrentBusMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testEventsInNewTransactionAreHandledAfterMainMessage()
->with($this->callback(function (Envelope $envelope) use (&$series) {
return $envelope->getMessage() === array_shift($series);
}))
->will($this->willHandleMessage());
->willReturnCallback($this->handleMessageCallback());

$messageBus->dispatch($message);
}
Expand Down Expand Up @@ -278,7 +278,7 @@ public function testDispatchOutOfAnotherHandlerDispatchesAndRemoveStamp()
$handlingMiddleware
->method('handle')
->with($this->expectHandledMessage($event))
->will($this->willHandleMessage());
->willReturnCallback($this->handleMessageCallback());

$eventBus = new MessageBus([
$middleware,
Expand All @@ -295,9 +295,9 @@ private function expectHandledMessage($message): Callback
return $this->callback(fn (Envelope $envelope) => $envelope->getMessage() === $message);
}

private function willHandleMessage(): ReturnCallback
private function handleMessageCallback(): \Closure
{
return $this->returnCallback(fn ($envelope, StackInterface $stack) => $stack->next()->handle($envelope, $stack));
return fn ($envelope, StackInterface $stack) => $stack->next()->handle($envelope, $stack);
}
}

Expand Down

0 comments on commit fcc415b

Please sign in to comment.