/**
  * @test
  */
 public function it_can_create_an_exchange()
 {
     $connection = $this->factory->createConnection('localhost');
     $channel = $this->factory->createChannel($connection);
     $exchange = $this->factory->createExchange($channel, 'xchg1');
     $this->assertInstanceOf(ExchangeInterface::class, $exchange);
     $this->assertEquals('xchg1', $exchange->getName());
     $this->assertEquals(ExchangeInterface::TYPE_DIRECT, $exchange->getType());
     // create exchange with different type
     $exchange = $this->factory->createExchange($channel, 'xchg2', ExchangeInterface::TYPE_FANOUT);
     $this->assertEquals(ExchangeInterface::TYPE_FANOUT, $exchange->getType());
 }
示例#2
0
 /**
  * @inheritdoc
  */
 public function createQueue(ChannelInterface $channel, $name = null, $flags = null, array $args = [])
 {
     $queue = $this->delegate->createQueue($channel, $name, $flags, $args);
     $this->queues[] = $queue;
     return $queue;
 }