/**
  * @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());
 }
 /**
  * @inheritdoc
  */
 public function createExchange(ChannelInterface $channel, $name, $type = ExchangeInterface::TYPE_DIRECT, $flags = null, array $args = [])
 {
     $exchg = $this->delegate->createExchange($channel, $name, $type, $flags, $args);
     $this->exchanges[] = $exchg;
     return $exchg;
 }