public function testChannel() { $c = new AMQPPecl(AMQPCredentials::create()->setHost('localhost')->setPort(5672)->setLogin('guest')->setPassword('guest')->setVirtualHost('/')); $c->createChannel(1); $c->createChannel(2); $c->createChannel(3); $this->assertSame(3, count($c->getChannelList())); $this->assertInstanceOf('AMQPPeclChannel', $c->getChannel(1)); try { $c->dropChannel(1); $this->assertSame(2, count($c->getChannelList())); $c->getChannel(1); $this->fail("Channel was't dropped"); } catch (MissingElementException $e) { //ok } }