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(), + ); + } +}