Ejemplo n.º 1
0
 /**
  * @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());
 }
Ejemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function createConnection($host, $port = 5672, $user = '******', $pass = '******', $vhost = '/', array $connectionParams = [])
 {
     $conn = $this->delegate->createConnection($host, $port, $user, $pass, $vhost, $connectionParams);
     $this->connections[] = $conn;
     return $conn;
 }