You are here

public function LazyOpenStreamTest::testOpensLazily in Zircon Profile 8

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

File

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

Class

LazyOpenStreamTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testOpensLazily() {
  $l = new LazyOpenStream($this->fname, 'w+');
  $l
    ->write('foo');
  $this
    ->assertInternalType('array', $l
    ->getMetadata());
  $this
    ->assertFileExists($this->fname);
  $this
    ->assertEquals('foo', file_get_contents($this->fname));
  $this
    ->assertEquals('foo', (string) $l);
}