本文整理汇总了PHP中PHPUnit_TextUI_TestRunner::setPrinter方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_TextUI_TestRunner::setPrinter方法的具体用法?PHP PHPUnit_TextUI_TestRunner::setPrinter怎么用?PHP PHPUnit_TextUI_TestRunner::setPrinter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_TextUI_TestRunner
的用法示例。
在下文中一共展示了PHPUnit_TextUI_TestRunner::setPrinter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTestRunner
/**
* @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;
}
示例2: run
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;
}