示例#1
0
 public function testParseWhileInEofStateWhenFileIsNotAtEof()
 {
     $file = $this->getMock('SplTempFileObject', array('fgetc', 'eof'));
     $file->expects($this->once())->method('fgetc');
     $file->expects($this->once())->method('eof')->will($this->returnValue(false));
     $this->obj = $this->getMock('Tmont\\Midi\\Parsing\\FileParser', array('getState'), array(), '', false);
     $this->obj->expects($this->once())->method('getState')->will($this->returnValue(ParseState::EOF));
     $this->obj->setFile($file);
     $this->setExpectedException('Tmont\\Midi\\Parsing\\ParseException', 'Expected EOF');
     $this->obj->parse();
 }