You are here

public function LazyOpenStreamTest::testDetachesUnderlyingStream in Zircon Profile 8.0

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

File

vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php, line 54

Class

LazyOpenStreamTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testDetachesUnderlyingStream() {
  file_put_contents($this->fname, 'foo');
  $l = new LazyOpenStream($this->fname, 'r');
  $r = $l
    ->detach();
  $this
    ->assertInternalType('resource', $r);
  fseek($r, 0);
  $this
    ->assertEquals('foo', stream_get_contents($r));
  fclose($r);
}