Skip to content

Commit 583d65a

Browse files
committed
Check resource type in assertStreamContents()
1 parent 98acd14 commit 583d65a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/GridFS/FunctionalTestCase.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@ public function setUp()
2727
}
2828

2929
/**
30-
* Rewinds a stream and asserts its contents.
30+
* Asserts that a variable is a stream containing the expected data.
31+
*
32+
* Note: this will seek to the beginning of the stream before reading.
3133
*
3234
* @param string $expectedContents
3335
* @param resource $stream
3436
*/
3537
protected function assertStreamContents($expectedContents, $stream)
3638
{
39+
$this->assertInternalType('resource', $stream);
40+
$this->assertSame('stream', get_resource_type($stream));
3741
$this->assertEquals($expectedContents, stream_get_contents($stream, -1,.0));
3842
}
3943

0 commit comments

Comments
 (0)