/**
  * @param string $fixturesDirectory
  * @return string results
  */
 public function process($fixturesDirectory)
 {
     $this->fixture = new PHPFIT_Fixture($fixturesDirectory);
     $this->tables = PHPFIT_Parse::create($this->input);
     $this->fixture->doTables($this->tables);
     return $this->fixture->counts->toString();
 }
 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");
 }
Example #3
0
 /**
  * @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());
     }
 }