public write ( Predis\Connection\CompositeConnectionInterface $connection, Predis\Command\CommandInterface $command ) | ||
$connection | Predis\Connection\CompositeConnectionInterface | |
$command | Predis\Command\CommandInterface |
/** * @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); }