public function disconnectAll() { if (!$this->channel_manager) { return; } $this->channel_manager->disconnectAll(); }
/** * @covers ::__construct * @covers ::getChannel * @covers ::disconnectAll * @covers ::<private> */ public function testAllConnectionsAreClosedWhenDisconnectAllIsCalled() { $queues = $this->getTestQueues(); $config = $this->getTestConfig($queues); $channel_factory = new ChannelFactory($config); $fast_jobs = $channel_factory->getChannel('fast_jobs')->getAmqpChannel()->getConnection(); $slow_jobs = $channel_factory->getChannel('slow_jobs')->getAmqpChannel()->getConnection(); $this->assertTrue($fast_jobs->isConnected()); $this->assertTrue($slow_jobs->isConnected()); $channel_factory->disconnectAll(); $this->assertFalse($fast_jobs->isConnected()); $this->assertFalse($slow_jobs->isConnected()); }