You are here

public function PumpStreamTest::testDescribesCapabilities in Zircon Profile 8

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

File

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

Class

PumpStreamTest

Namespace

GuzzleHttp\Tests\Psr7

Code

public function testDescribesCapabilities() {
  $p = Psr7\stream_for(function () {
  });
  $this
    ->assertTrue($p
    ->isReadable());
  $this
    ->assertFalse($p
    ->isSeekable());
  $this
    ->assertFalse($p
    ->isWritable());
  $this
    ->assertNull($p
    ->getSize());
  $this
    ->assertEquals('', $p
    ->getContents());
  $this
    ->assertEquals('', (string) $p);
  $p
    ->close();
  $this
    ->assertEquals('', $p
    ->read(10));
  $this
    ->assertTrue($p
    ->eof());
  try {
    $this
      ->assertFalse($p
      ->write('aa'));
    $this
      ->fail();
  } catch (\RuntimeException $e) {
  }
}