diff --git a/pkg/fs/Client/FsDriver.php b/pkg/fs/Client/FsDriver.php index a8cd5d1dd..4704e6940 100644 --- a/pkg/fs/Client/FsDriver.php +++ b/pkg/fs/Client/FsDriver.php @@ -173,7 +173,7 @@ public function getConfig() private function createRouterTopic() { return $this->context->createTopic( - $this->config->createTransportRouterTopicName($this->config->getRouterTopicName()) + $this->config->createTransportQueueName($this->config->getRouterTopicName()) ); } } diff --git a/pkg/fs/Tests/Driver/FsDriverTest.php b/pkg/fs/Tests/Driver/FsDriverTest.php index 47d145302..fbe2100b6 100644 --- a/pkg/fs/Tests/Driver/FsDriverTest.php +++ b/pkg/fs/Tests/Driver/FsDriverTest.php @@ -145,6 +145,18 @@ public function testShouldSendMessageToRouter() { $topic = new FsDestination(TempFile::generate()); $transportMessage = new FsMessage(); + $config = $this->createConfigMock(); + + $config + ->expects($this->once()) + ->method('getRouterTopicName') + ->willReturn('topicName'); + + $config + ->expects($this->once()) + ->method('createTransportQueueName') + ->with('topicName') + ->willReturn('app.topicName'); $producer = $this->createPsrProducerMock(); $producer @@ -156,6 +168,7 @@ public function testShouldSendMessageToRouter() $context ->expects($this->once()) ->method('createTopic') + ->with('app.topicName') ->willReturn($topic) ; $context @@ -171,7 +184,7 @@ public function testShouldSendMessageToRouter() $driver = new FsDriver( $context, - new Config('', '', '', '', '', ''), + $config, $this->createQueueMetaRegistryMock() ); @@ -344,4 +357,12 @@ private function createQueueMetaRegistryMock() { return $this->createMock(QueueMetaRegistry::class); } + + /** + * @return \PHPUnit_Framework_MockObject_MockObject|Config + */ + private function createConfigMock() + { + return $this->createMock(Config::class); + } }