public function testGetContentsReturnsEmptyStringIfStreamIsNotReadable() { $this->tmpnam = tempnam(sys_get_temp_dir(), 'phly'); file_put_contents($this->tmpnam, 'FOO BAR'); $resource = fopen($this->tmpnam, 'w'); $stream = new Stream($resource); $this->assertEquals('', $stream->getContents()); }