public function testLoad() { //see http://www.phpunit.de/ticket/1046 for why we're mocking fgets() for no reason $file = $this->getMock('SplTempFileObject', array('fgets')); $this->obj = $this->getMock('Tmont\\Midi\\Parsing\\Parser', array('parse', 'createFileObject')); $this->obj->expects($this->once())->method('createFileObject')->with(__FILE__)->will($this->returnValue($file)); $this->obj->load(__FILE__); }