You are here

public function BufferStreamTest::testCanCastToStringOrGetContents in Zircon Profile 8

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

@expectedException \RuntimeException @expectedExceptionMessage Cannot determine the position of a BufferStream

File

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

Class

BufferStreamTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testCanCastToStringOrGetContents() {
  $b = new BufferStream();
  $b
    ->write('foo');
  $b
    ->write('baz');
  $this
    ->assertEquals('foo', $b
    ->read(3));
  $b
    ->write('bar');
  $this
    ->assertEquals('bazbar', (string) $b);
  $b
    ->tell();
}