/**
* @group disconnected
*/
public function testPubSubLoopWithArrayAndCallableExecutesPubSub()
{
// NOTE: we use a subscribe count of 0 in the fake message to trick
// the context and to make it think that it can be closed
// since there are no more subscriptions active.
$message = array('subscribe', 'channel', 0);
$options = array('subscribe' => 'channel');
$connection = $this->getMock('Predis\\Connection\\SingleConnectionInterface');
$connection->expects($this->once())->method('read')->will($this->returnValue($message));
$callable = $this->getMock('stdClass', array('__invoke'));
$callable->expects($this->once())->method('__invoke');
$client = new Client($connection);
$client->pubSubLoop($options, $callable);
}