/**
* @group disconnected
*/
public function testConnectionWrite()
{
$serialized = "*1\r\n\$4\r\nPING\r\n";
$command = $this->getMock('Predis\\Command\\CommandInterface');
$connection = $this->getMock('Predis\\Connection\\CompositeConnectionInterface');
$serializer = $this->getMock('Predis\\Protocol\\RequestSerializerInterface');
$protocol = new CompositeProtocolProcessor($serializer);
$connection->expects($this->once())->method('writeBuffer')->with($this->equalTo($serialized));
$serializer->expects($this->once())->method('serialize')->with($command)->will($this->returnValue($serialized));
$protocol->write($connection, $command);
}