You are here

public function CachingStreamTest::testCanSeekNearEndWithSeekEnd in Zircon Profile 8

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

File

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

Class

CachingStreamTest
@covers GuzzleHttp\Psr7\CachingStream

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testCanSeekNearEndWithSeekEnd() {
  $baseStream = Psr7\stream_for(implode('', range('a', 'z')));
  $cached = new CachingStream($baseStream);
  $cached
    ->seek(1, SEEK_END);
  $this
    ->assertEquals(24, $baseStream
    ->tell());
  $this
    ->assertEquals('y', $cached
    ->read(1));
  $this
    ->assertEquals(26, $cached
    ->getSize());
}