You are here

public function StreamTest::testProvidesStreamPosition in Zircon Profile 8

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

File

vendor/guzzlehttp/psr7/tests/StreamTest.php, line 98

Class

StreamTest
@covers GuzzleHttp\Psr7\Stream

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testProvidesStreamPosition() {
  $handle = fopen('php://temp', 'w+');
  $stream = new Stream($handle);
  $this
    ->assertEquals(0, $stream
    ->tell());
  $stream
    ->write('foo');
  $this
    ->assertEquals(3, $stream
    ->tell());
  $stream
    ->seek(1);
  $this
    ->assertEquals(1, $stream
    ->tell());
  $this
    ->assertSame(ftell($handle), $stream
    ->tell());
  $stream
    ->close();
}