/** * Get the Connection object in use * * @return Connection */ public function getConnection() { return $this->channel->getConnection(); }
public function testGetConnection() { $connection = $this->prophesize(Connection::class); $adapter = $this->prophesize(AMQP::class); $adapter->getConnection()->willReturn($connection->reveal()); $channel = new Channel(); $channel->setConnection($connection->reveal()); static::assertSame($connection->reveal(), $channel->getConnection()); }