public function testFgetsReadError() { $this->setExpectedException('RuntimeException', 'Error reading from file fail:'); $fileObject = new FileObject('fail://', 'r'); $fileObject->fgets(); }