hasTests ()) { foreach ($this->getTests () as $test) { $test->setTestState (false); $test->test (); $result = $test->getResult (); if (! $result instanceof Tester_Test_Result) { throw new Exception ('Invalid result has been received from a test ' . get_class ($test)); } if ($result->hasFixingCommand ()) { $this->addFixingCommand ($result->getFixingCommand ()); } if ($this->hasPainter ()) { $this->getPainter ()->paint ($test); } $total = $total && $test->getTestState (); } } $this->setStringResult (ob_get_clean ()); return $total; } function addTest (Tester_Test $test) { $this->tests[] = $test; } function getTests () { return $this->tests; } function hasTests () { return count ($this->tests) > 0; } function setPainter (Tester_Painter $painter) { $this->painter = $painter; } function getPainter () { return $this->painter; } function hasPainter () { return isset ($this->painter); } function setStringResult ($string_result) { $this->string_result = $string_result; } function getStringResult () { return $this->string_result; } function hasStringResult () { return isset ($this->string_result); } function addFixingCommand ($fixing_command) { if (! is_array ($fixing_command)) { $fixing_command = array ($fixing_command); } foreach (new RecursiveIteratorIterator (new RecursiveArrayIterator ($fixing_command)) as $command) { $this->fixing_commands [] = $command; } } function getFixingCommands () { return $this->fixing_commands; } }