Skip to content

Commit 76c64ee

Browse files
Add StreamIntegrationTest::testGetContentsError()
1 parent 92ef823 commit 76c64ee

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/StreamIntegrationTest.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,4 +301,21 @@ public function testGetContents()
301301
$this->assertEquals('def', $stream->getContents());
302302
$this->assertSame('', $stream->getContents());
303303
}
304+
305+
public function testGetContentsError()
306+
{
307+
if (isset($this->skippedTests[__FUNCTION__])) {
308+
$this->markTestSkipped($this->skippedTests[__FUNCTION__]);
309+
}
310+
311+
$resource = fopen('php://memory', 'rw');
312+
fwrite($resource, 'abcdef');
313+
rewind($resource);
314+
$stream = $this->createStream($resource);
315+
316+
fclose($resource);
317+
318+
$this->expectException(\RuntimeException::class);
319+
$stream->getContents();
320+
}
304321
}

0 commit comments

Comments
 (0)