public function testPrintEofWhileParsingTrack() { $formatter = $this->getMock('Tmont\\Midi\\Reporting\\Formatter', array('beforeChunk', 'afterChunk', 'afterTrack', 'afterFile')); $formatter->expects($this->never())->method('beforeChunk'); $formatter->expects($this->never())->method('afterChunk'); $formatter->expects($this->once())->method('afterTrack'); $formatter->expects($this->once())->method('afterFile'); $parser = $this->getMock('Tmont\\Midi\\Parsing\\Parser', array('parse')); $parser->expects($this->once())->method('parse')->will($this->returnValue(null)); $this->obj = $this->getMock('Tmont\\Midi\\Reporting\\Printer', array('isParsingTrack'), array($formatter, $parser)); $this->obj->expects($this->once())->method('isParsingTrack')->will($this->returnValue(true)); $this->obj->printNext(); }
/** * @since 1.0 * * @param Formatter $formatter * @param Parser $parser * @param string $file */ public function __construct(Formatter $formatter, Parser $parser, $file = null) { parent::__construct($formatter, $parser); $this->file = $file !== null ? $this->createFileObject($file, true) : null; $this->bytesWritten = 0; }