Skip to content

Commit 142a69c

Browse files
committed
fix tests
1 parent ec620dd commit 142a69c

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎pkg/amqp-lib/Tests/Spec/AmqpSendToTopicAndReceiveFromQueueWithBasicConsumeMethodTest.php‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,19 @@ protected function createContext()
3030
public function test()
3131
{
3232
$context = $this->createContext();
33-
$topic = $this->createTopic($context, 'send_to_topic_and_receive_from_queue_spec');
34-
$queue = $this->createQueue($context, 'send_to_topic_and_receive_from_queue_spec');
3533

36-
$consumer = $context->createConsumer($queue);
34+
$topic = $context->createTopic('send_to_topic_and_receive_from_queue_spec_basic_consume2');
35+
$topic->setType(AmqpTopic::TYPE_DIRECT);
36+
$topic->addFlag(AmqpTopic::FLAG_DURABLE);
37+
$context->declareTopic($topic);
3738

38-
// guard
39-
$this->assertNull($consumer->receiveNoWait());
39+
$queue = $context->createQueue('send_to_topic_and_receive_from_queue_spec_basic_consume2');
40+
$context->declareQueue($queue);
41+
$context->purgeQueue($queue);
42+
43+
$context->bind(new AmqpBind($topic, $queue));
44+
45+
$consumer = $context->createConsumer($queue);
4046

4147
$expectedBody = __CLASS__.time();
4248

0 commit comments

Comments
 (0)