You are here

public function LazyOpenStreamTest::testProxiesToFile in Zircon Profile 8.0

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

File

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

Class

LazyOpenStreamTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testProxiesToFile() {
  file_put_contents($this->fname, 'foo');
  $l = new LazyOpenStream($this->fname, 'r');
  $this
    ->assertEquals('foo', $l
    ->read(4));
  $this
    ->assertTrue($l
    ->eof());
  $this
    ->assertEquals(3, $l
    ->tell());
  $this
    ->assertTrue($l
    ->isReadable());
  $this
    ->assertTrue($l
    ->isSeekable());
  $this
    ->assertFalse($l
    ->isWritable());
  $l
    ->seek(1);
  $this
    ->assertEquals('oo', $l
    ->getContents());
  $this
    ->assertEquals('foo', (string) $l);
  $this
    ->assertEquals(3, $l
    ->getSize());
  $this
    ->assertInternalType('array', $l
    ->getMetadata());
  $l
    ->close();
}