/**
* @group disconnected
*/
public function testFlushHandlesPartialBuffers()
{
$connection = $this->getMock('Predis\\Connection\\NodeConnectionInterface');
$connection->expects($this->exactly(4))->method('writeRequest');
$connection->expects($this->exactly(4))->method('readResponse')->will($this->returnCallback($this->getReadCallback()));
$pipeline = new Pipeline(new Client($connection));
$pipeline->echo('one');
$pipeline->echo('two');
$pipeline->flushPipeline();
$pipeline->echo('three');
$pipeline->echo('four');
$this->assertSame(array('one', 'two', 'three', 'four'), $pipeline->execute());
}