You are here

public function CachingStreamTest::testCanUseSeekEndWithUnknownSize in Zircon Profile 8

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

File

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

Class

CachingStreamTest
@covers GuzzleHttp\Psr7\CachingStream

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testCanUseSeekEndWithUnknownSize() {
  $baseStream = Psr7\stream_for('testing');
  $decorated = Psr7\FnStream::decorate($baseStream, [
    'getSize' => function () {
      return null;
    },
  ]);
  $cached = new CachingStream($decorated);
  $cached
    ->seek(1, SEEK_END);
  $this
    ->assertEquals('ng', $cached
    ->read(2));
}