public function testInvalidPageError() { $fpdi = $this->getMock('\\FPDI', array('importPage', 'setSourceFile')); $fpdi->expects($this->once())->method('importPage')->will($this->throwException(new \Exception())); $m = new Merger($fpdi); $m->addRaw('', new Pages('2')); $m->merge(); }