Skip to content

Commit

Permalink
Remove test because case is already covered
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonFrings committed Nov 24, 2020
1 parent 8986b4d commit 6a64829
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions tests/WritableResourceStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -461,33 +461,6 @@ public function testWritingToClosedWritableResourceStreamShouldNotWriteToStream(
$this->assertSame('', $filterBuffer);
}

/**
* @covers React\Stream\WritableResourceStream::handleWrite
*/
public function testErrorWhenStreamResourceIsInvalid()
{
$stream = fopen('php://temp', 'r+');
$loop = $this->createWriteableLoopMock();

$error = null;

$buffer = new WritableResourceStream($stream, $loop);
$buffer->on('error', function ($message) use (&$error) {
$error = $message;
});

// invalidate stream resource
fclose($stream);

$buffer->write('Attempting to write to bad stream');

$this->assertInstanceOf('Exception', $error);

// the error messages differ between PHP versions, let's just check substrings
$this->assertContainsString('Unable to write to stream: ', $error->getMessage());
$this->assertContainsStringIgnoringCase(' Not a valid stream resource', $error->getMessage());
}

public function testWritingToClosedStream()
{
if ('Darwin' === PHP_OS) {
Expand Down

0 comments on commit 6a64829

Please sign in to comment.