You are here

public function LimitStreamTest::testReturnsSubset in Zircon Profile 8

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

File

vendor/guzzlehttp/psr7/tests/LimitStreamTest.php, line 27

Class

LimitStreamTest
@covers GuzzleHttp\Psr7\LimitStream

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testReturnsSubset() {
  $body = new LimitStream(Psr7\stream_for('foo'), -1, 1);
  $this
    ->assertEquals('oo', (string) $body);
  $this
    ->assertTrue($body
    ->eof());
  $body
    ->seek(0);
  $this
    ->assertFalse($body
    ->eof());
  $this
    ->assertEquals('oo', $body
    ->read(100));
  $this
    ->assertSame('', $body
    ->read(1));
  $this
    ->assertTrue($body
    ->eof());
}