Skip to content

Commit 36a1636

Browse files
[Messenger] Remove ContainerInterface mock
1 parent 9c9d571 commit 36a1636

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/Symfony/Component/Messenger/Tests/FailureIntegrationTest.php

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -433,22 +433,13 @@ public function testStampsAddedByMiddlewaresDontDisappearWhenValidationFails()
433433
'transport1' => $transport1,
434434
];
435435

436-
$locator = $this->createMock(ContainerInterface::class);
437-
$locator->expects($this->any())
438-
->method('has')
439-
->willReturn(true);
440-
$locator->expects($this->any())
441-
->method('get')
442-
->willReturnCallback(fn ($transportName) => $transports[$transportName]);
436+
$locator = new Container();
437+
$locator->set('transport1', $transport1);
438+
443439
$senderLocator = new SendersLocator([], $locator);
444440

445-
$retryStrategyLocator = $this->createMock(ContainerInterface::class);
446-
$retryStrategyLocator->expects($this->any())
447-
->method('has')
448-
->willReturn(true);
449-
$retryStrategyLocator->expects($this->any())
450-
->method('get')
451-
->willReturn(new MultiplierRetryStrategy(1));
441+
$retryStrategyLocator = new Container();
442+
$retryStrategyLocator->set('transport1', new MultiplierRetryStrategy(1));
452443

453444
$violationList = new ConstraintViolationList([new ConstraintViolation('validation failed', null, [], null, null, null)]);
454445
$validator = $this->createMock(ValidatorInterface::class);

0 commit comments

Comments
 (0)