You are here

public function StreamTest::testEnsuresSizeIsConsistent in Zircon Profile 8

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

File

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

Class

StreamTest
@covers GuzzleHttp\Psr7\Stream

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testEnsuresSizeIsConsistent() {
  $h = fopen('php://temp', 'w+');
  $this
    ->assertEquals(3, fwrite($h, 'foo'));
  $stream = new Stream($h);
  $this
    ->assertEquals(3, $stream
    ->getSize());
  $this
    ->assertEquals(4, $stream
    ->write('test'));
  $this
    ->assertEquals(7, $stream
    ->getSize());
  $this
    ->assertEquals(7, $stream
    ->getSize());
  $stream
    ->close();
}