Пример #1
0
 /**
  * Get the Connection object in use
  *
  * @return Connection
  */
 public function getConnection()
 {
     return $this->channel->getConnection();
 }
Пример #2
0
 public function testCreateQueueWithResource()
 {
     $queueOptions = $this->prophesize(QueueOptions::class);
     $queuePrototype = $this->prophesize(Queue::class);
     $resource = $this->prophesize(\AMQPQueue::class);
     $queuePrototype->setResource($resource->reveal())->shouldBeCalled();
     $queuePrototype->setChannel(Argument::type(Channel::class))->shouldBeCalled();
     $queuePrototype->setOptions($queueOptions->reveal())->shouldBeCalled();
     $channel = new Channel(null, $queuePrototype->reveal());
     $exchange = $channel->createQueue($queueOptions->reveal(), $resource->reveal());
     static::assertInstanceOf(Queue::class, $exchange);
 }