You are here

public function NoSeekStreamTest::testCannotSeek in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php \GuzzleHttp\Tests\Psr7\NoSeekStreamTest::testCannotSeek()

@expectedException \RuntimeException @expectedExceptionMessage Cannot seek a NoSeekStream

File

vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php, line 17

Class

NoSeekStreamTest
@covers GuzzleHttp\Psr7\NoSeekStream @covers GuzzleHttp\Psr7\StreamDecoratorTrait

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testCannotSeek() {
  $s = $this
    ->getMockBuilder('Psr\\Http\\Message\\StreamInterface')
    ->setMethods([
    'isSeekable',
    'seek',
  ])
    ->getMockForAbstractClass();
  $s
    ->expects($this
    ->never())
    ->method('seek');
  $s
    ->expects($this
    ->never())
    ->method('isSeekable');
  $wrapped = new NoSeekStream($s);
  $this
    ->assertFalse($wrapped
    ->isSeekable());
  $wrapped
    ->seek(2);
}