Skip to content

Commit 5e6a299

Browse files
authored
Merge pull request #34 from bendavies/fix-router-topic-name
fix fsdriver router topic name
2 parents 57801ee + 93b18b2 commit 5e6a299

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Diff for: pkg/fs/Client/FsDriver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function getConfig()
173173
private function createRouterTopic()
174174
{
175175
return $this->context->createTopic(
176-
$this->config->createTransportRouterTopicName($this->config->getRouterTopicName())
176+
$this->config->createTransportQueueName($this->config->getRouterTopicName())
177177
);
178178
}
179179
}

Diff for: pkg/fs/Tests/Driver/FsDriverTest.php

+22-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,18 @@ public function testShouldSendMessageToRouter()
145145
{
146146
$topic = new FsDestination(TempFile::generate());
147147
$transportMessage = new FsMessage();
148+
$config = $this->createConfigMock();
149+
150+
$config
151+
->expects($this->once())
152+
->method('getRouterTopicName')
153+
->willReturn('topicName');
154+
155+
$config
156+
->expects($this->once())
157+
->method('createTransportQueueName')
158+
->with('topicName')
159+
->willReturn('app.topicName');
148160

149161
$producer = $this->createPsrProducerMock();
150162
$producer
@@ -156,6 +168,7 @@ public function testShouldSendMessageToRouter()
156168
$context
157169
->expects($this->once())
158170
->method('createTopic')
171+
->with('app.topicName')
159172
->willReturn($topic)
160173
;
161174
$context
@@ -171,7 +184,7 @@ public function testShouldSendMessageToRouter()
171184

172185
$driver = new FsDriver(
173186
$context,
174-
new Config('', '', '', '', '', ''),
187+
$config,
175188
$this->createQueueMetaRegistryMock()
176189
);
177190

@@ -344,4 +357,12 @@ private function createQueueMetaRegistryMock()
344357
{
345358
return $this->createMock(QueueMetaRegistry::class);
346359
}
360+
361+
/**
362+
* @return \PHPUnit_Framework_MockObject_MockObject|Config
363+
*/
364+
private function createConfigMock()
365+
{
366+
return $this->createMock(Config::class);
367+
}
347368
}

0 commit comments

Comments
 (0)