public function testDoOutputException() { $inputFilename = "examples/input/arithmetic.html"; $outputFilename = "nodir/nosubdir/noexist-output.no"; try { $fr = new PHPFIT_FileRunner(); $fr->run($inputFilename, $outputFilename); } catch (PHPFIT_Exception_FileIO $e) { $this->assertEqual('Output file is not writable (probably a problem of file permissions)', $e->getMessage()); return; } $this->fail("exptected exception not thrown"); }
/** * @param string $inputFilename * @param string $outputFilename * @param string $fixturesDirectory */ public static function run($inputFilename, $outputFilename, $fixturesDirectory = null) { $fr = new PHPFIT_FileRunner(); try { return $fr->run($inputFilename, $outputFilename, $fixturesDirectory); } catch (PHPFIT_Exception_FileIO $e) { die($e->getMessage() . " : " . $e->getFilename()); } catch (PHPFIT_Exception_Parse $e) { die($e->getMessage() . " at offset " . $e->getOffset()); } catch (Exception $e) { die('Caught unknown exception: ' . $e->getMessage()); } }