fromStream() public static method

Parse a response from a stream.
public static fromStream ( Psr\Http\Message\StreamInterface $stream ) : Psr\Http\Message\ResponseInterface
$stream Psr\Http\Message\StreamInterface
return Psr\Http\Message\ResponseInterface
Example #1
0
 public function testFromStreamThrowsExceptionWhenStreamIsNotSeekable()
 {
     $this->setExpectedException('InvalidArgumentException');
     $stream = $this->getMockBuilder('Psr\\Http\\Message\\StreamInterface')->getMock();
     $stream->expects($this->once())->method('isReadable')->will($this->returnValue(true));
     $stream->expects($this->once())->method('isSeekable')->will($this->returnValue(false));
     Serializer::fromStream($stream);
 }