コード例 #1
0
ファイル: Queue.php プロジェクト: thomasvargiu/amqpal
 /**
  * Get the Connection object in use
  *
  * @return Connection
  */
 public function getConnection()
 {
     return $this->channel->getConnection();
 }
コード例 #2
0
ファイル: ChannelTest.php プロジェクト: thomasvargiu/amqpal
 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);
 }