Skip to content

Commit

Permalink
Merge branch '6.4' into 7.1
Browse files Browse the repository at this point in the history
* 6.4:
  Mitigate PHPUnit deprecations
  [TwigBundle] Add support for resetting globals between HTTP requests
  Mitigate PHPUnit deprecations
  [Cache] Fix compatibility with Redis 6.1.0 pre-releases
  [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 e1dc743 + 0503535 commit e1c0ced
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions Tests/Command/SetupTransportsCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ public function testThrowsExceptionOnTransportSetup()
$serviceLocator = $this->createMock(ServiceLocator::class);
$serviceLocator->expects($this->exactly(1))
->method('get')
->will($this->onConsecutiveCalls(
$amqpTransport
));
->willReturn($amqpTransport);
$serviceLocator
->method('has')
->willReturn(true);
Expand Down
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 e1c0ced

Please sign in to comment.