Skip to content

Commit

Permalink
Add tests for read and write only streams
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed Feb 20, 2019
1 parent f9423ab commit f3a3c20
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/StreamTest.php
Expand Up @@ -300,6 +300,16 @@ public function readableModeProvider()
];
}

public function testStreamIsNotReadable()
{
$r = fopen('php://output', 'w');
$stream = new Stream($r);

$this->assertFalse($stream->isReadable());

$stream->close();
}

/**
* @dataProvider writableModeProvider
*
Expand Down Expand Up @@ -338,6 +348,16 @@ public function writableModeProvider()
['a+'],
];
}

public function testStreamIsNotWritable()
{
$r = fopen('php://input', 'r');
$stream = new Stream($r);

$this->assertFalse($stream->isWritable());

$stream->close();
}
}

namespace GuzzleHttp\Psr7;
Expand Down

0 comments on commit f3a3c20

Please sign in to comment.