You are here

public function StreamWrapperTest::testValidatesStream in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php \GuzzleHttp\Tests\Psr7\StreamWrapperTest::testValidatesStream()

@expectedException \InvalidArgumentException

File

vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php, line 63

Class

StreamWrapperTest
@covers GuzzleHttp\Psr7\StreamWrapper

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testValidatesStream() {
  $stream = $this
    ->getMockBuilder('Psr\\Http\\Message\\StreamInterface')
    ->setMethods([
    'isReadable',
    'isWritable',
  ])
    ->getMockForAbstractClass();
  $stream
    ->expects($this
    ->once())
    ->method('isReadable')
    ->will($this
    ->returnValue(false));
  $stream
    ->expects($this
    ->once())
    ->method('isWritable')
    ->will($this
    ->returnValue(false));
  StreamWrapper::getResource($stream);
}