Пример #1
0
 /**
  * @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();
 }
Пример #2
0
 public function doRun($file, $right, $wrong, $ignores, $exceptions)
 {
     $input = 'examples/input/' . $file . '.html';
     $tables = PHPFIT_Parse::create(file_get_contents($input, true));
     $fixture = new PHPFIT_Fixture();
     $fixture->doTables($tables);
     $this->assertEqual($right, $fixture->counts->right);
     $this->assertEqual($wrong, $fixture->counts->wrong);
     $this->assertEqual($ignores, $fixture->counts->ignores);
     $this->assertEqual($exceptions, $fixture->counts->exceptions);
 }
Пример #3
0
 /**
  * @param string $input
  * @return string
  */
 private function processDocument($fixturePath, $input)
 {
     PHPFIT_Fixture::setHtmlRenderer(new PHPFIT_HtmlRenderer_Fitnesse());
     $fixture = new PHPFIT_Fixture($fixturePath);
     try {
         $tables = PHPFIT_Parse::create($input);
         $fixture->doTables($tables);
     } catch (PHPFIT_Exception_Parse $e) {
         $tables = $this->exception($e, $fixture);
     }
     $this->counts = $fixture->counts;
     $this->totalCounts->tally($fixture->counts);
     return $tables->toString();
 }
Пример #4
0
 public function testNestedTables2()
 {
     $nestedTable = "<table><tr><td>embedded</td></tr></table>";
     $nestedTable2 = "<table><tr><td>" . $nestedTable . "</td></tr><tr><td>two</td></tr></table>";
     $p = PHPFIT_Parse::create("<table><tr><td>one</td></tr><tr><td>" . $nestedTable2 . "</td></tr>" . "<tr><td>three</td></tr></table>trailer");
     $this->assertEqual(1, $p->size());
     $this->assertEqual(3, $p->parts->size());
     $this->assertEqual("one", $p->at(0, 0, 0)->body);
     $this->assertEqual("three", $p->at(0, 2, 0)->body);
     $this->assertEqual(1, $p->at(0, 0, 0)->size());
     $this->assertEqual(1, $p->at(0, 2, 0)->size());
     $sub = $p->at(0, 1, 0)->parts;
     $this->assertEqual(2, $sub->parts->size());
     $this->assertEqual(1, $sub->at(0, 0, 0)->size());
     $subSub = $sub->at(0, 0, 0)->parts;
     $this->assertEqual("embedded", $subSub->at(0, 0, 0)->body);
     $this->assertEqual(1, $subSub->at(0, 0, 0)->size());
     $this->assertEqual("two", $sub->at(0, 1, 0)->body);
     $this->assertEqual(1, $sub->at(0, 1, 0)->size());
 }