Predis\Protocol\Text\CompositeProtocolProcessor::read PHP Method

read() public method

public read ( Predis\Connection\CompositeConnectionInterface $connection )
$connection Predis\Connection\CompositeConnectionInterface
    public function read(CompositeConnectionInterface $connection)
    {
        return $this->reader->read($connection);
    }

Usage Example

 /**
  * @group disconnected
  */
 public function testConnectionRead()
 {
     $connection = $this->getMock('Predis\\Connection\\CompositeConnectionInterface');
     $reader = $this->getMock('Predis\\Protocol\\ResponseReaderInterface');
     $protocol = new CompositeProtocolProcessor(null, $reader);
     $reader->expects($this->once())->method('read')->with($connection)->will($this->returnValue('bulk'));
     $this->assertSame('bulk', $protocol->read($connection));
 }