You are here

public function BufferStreamTest::testDetachClearsBuffer in Zircon Profile 8

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

File

vendor/guzzlehttp/psr7/tests/BufferStreamTest.php, line 45

Class

BufferStreamTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testDetachClearsBuffer() {
  $b = new BufferStream();
  $b
    ->write('foo');
  $b
    ->detach();
  $this
    ->assertTrue($b
    ->eof());
  $this
    ->assertEquals(3, $b
    ->write('abc'));
  $this
    ->assertEquals('abc', $b
    ->read(10));
}