You are here

public function AppendStreamTest::testSeeksToPositionByReading in Zircon Profile 8.0

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

File

vendor/guzzlehttp/psr7/tests/AppendStreamTest.php, line 58

Class

AppendStreamTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testSeeksToPositionByReading() {
  $a = new AppendStream([
    Psr7\stream_for('foo'),
    Psr7\stream_for('bar'),
    Psr7\stream_for('baz'),
  ]);
  $a
    ->seek(3);
  $this
    ->assertEquals(3, $a
    ->tell());
  $this
    ->assertEquals('bar', $a
    ->read(3));
  $a
    ->seek(6);
  $this
    ->assertEquals(6, $a
    ->tell());
  $this
    ->assertEquals('baz', $a
    ->read(3));
}