You are here

public function CachingStreamTest::testCanSeekToReadBytes in Zircon Profile 8.0

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

File

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

Class

CachingStreamTest
@covers GuzzleHttp\Psr7\CachingStream

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testCanSeekToReadBytes() {
  $this
    ->assertEquals('te', $this->body
    ->read(2));
  $this->body
    ->seek(0);
  $this
    ->assertEquals('test', $this->body
    ->read(4));
  $this
    ->assertEquals(4, $this->body
    ->tell());
  $this->body
    ->seek(2);
  $this
    ->assertEquals(2, $this->body
    ->tell());
  $this->body
    ->seek(2, SEEK_CUR);
  $this
    ->assertEquals(4, $this->body
    ->tell());
  $this
    ->assertEquals('ing', $this->body
    ->read(3));
}