setPrinter() public method

public setPrinter ( PHPUnit_TextUI_ResultPrinter $resultPrinter )
$resultPrinter PHPUnit_TextUI_ResultPrinter
Exemplo n.º 1
0
 /**
  * @return \PHPUnit_TextUI_TestRunner
  */
 public function getTestRunner()
 {
     if ($this->testRunner === null) {
         $this->testRunner = new \PHPUnit_TextUI_TestRunner();
         $this->testRunner->setPrinter($this->getPrinter());
     }
     return $this->testRunner;
 }
Exemplo n.º 2
0
 public function run(rex_test_locator $locator, $colors = false)
 {
     $suite = new PHPUnit_Framework_TestSuite();
     // disable backup of globals, since we have some rex_sql objectes referenced from variables in global space.
     // PDOStatements are not allowed to be serialized
     $suite->setBackupGlobals(false);
     $suite->addTestFiles($locator->getIterator());
     rex_error_handler::unregister();
     $runner = new PHPUnit_TextUI_TestRunner();
     $backtrace = debug_backtrace(false);
     array_unshift($backtrace, ['file' => __FILE__, 'line' => __LINE__ + 3]);
     $runner->setPrinter(new rex_tests_result_printer($backtrace, $colors));
     $result = $runner->doRun($suite);
     rex_error_handler::register();
     return $result;
 }