fromStream() public static method

Deserialize a request stream to a request instance.
public static fromStream ( Psr\Http\Message\StreamInterface $stream ) : Request
$stream Psr\Http\Message\StreamInterface
return Phly\Http\Request
Beispiel #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);
 }