From af563da4de14f0cb14bd8c8caf87de1d1682d004 Mon Sep 17 00:00:00 2001 From: Serhii Donii Date: Mon, 21 Oct 2024 00:20:41 +0300 Subject: [PATCH] Add reset message queues before scenario with zentruck/messenger-test --- tests/TransportRetrieverTest.php | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tests/TransportRetrieverTest.php diff --git a/tests/TransportRetrieverTest.php b/tests/TransportRetrieverTest.php new file mode 100644 index 0000000..886c579 --- /dev/null +++ b/tests/TransportRetrieverTest.php @@ -0,0 +1,36 @@ +createMock(InMemoryTransport::class); + $serviceProvider = $this->createMock(ServiceProviderInterface::class); + $serviceProvider + ->expects($this->once()) + ->method('getProvidedServices') + ->willReturn(['messenger.transport.test']); + + $serviceProvider + ->expects(self::once()) + ->method('get') + ->with('messenger.transport.test') + ->willReturn($inMemoryTransport); + + $transportRetriever = new TransportRetriever($serviceProvider); + + self::assertEquals( + ['messenger.transport.test' => $inMemoryTransport], + $transportRetriever->getAllTransports(), + ); + } +}