Skip to content

Commit b10c626

Browse files
committed
Fix the rdkafka should setupd driver test
1 parent 9a3cb2a commit b10c626

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

pkg/rdkafka/Tests/Client/RdKafkaDriverTest.php

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,12 +290,37 @@ public function testShouldThrowExceptionIfProcessorQueueNameParameterIsNotSet()
290290

291291
public function testShouldSetupBroker()
292292
{
293+
$routerTopic = new RdKafkaTopic('');
294+
$routerQueue = new RdKafkaTopic('');
295+
296+
$processorTopic = new RdKafkaTopic('');
297+
293298
$context = $this->createPsrContextMock();
294299

300+
$context
301+
->expects($this->at(0))
302+
->method('createQueue')
303+
->willReturn($routerTopic)
304+
;
305+
$context
306+
->expects($this->at(1))
307+
->method('createQueue')
308+
->willReturn($routerQueue)
309+
;
310+
$context
311+
->expects($this->at(2))
312+
->method('createQueue')
313+
->willReturn($processorTopic)
314+
;
315+
316+
$meta = new QueueMetaRegistry($this->createDummyConfig(), [
317+
'default' => [],
318+
]);
319+
295320
$driver = new RdKafkaDriver(
296321
$context,
297322
$this->createDummyConfig(),
298-
$this->createDummyQueueMetaRegistry()
323+
$meta
299324
);
300325

301326
$driver->setupBroker();

0 commit comments

Comments
 (0)