本文整理匯總了PHP中SimpleTest::setCurrent方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleTest::setCurrent方法的具體用法?PHP SimpleTest::setCurrent怎麽用?PHP SimpleTest::setCurrent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SimpleTest
的用法示例。
在下文中一共展示了SimpleTest::setCurrent方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
function run(&$reporter)
{
SimpleTest::setCurrent($this);
$reporter->paintCaseStart($this->getLabel());
$this->_runner =& $this->_createRunner($reporter);
$this->_runner->run();
$this->_runner = false;
$reporter->paintCaseEnd($this->getLabel());
return $reporter->getStatus();
}
示例2: run
function run(&$reporter)
{
SimpleTest::setCurrent($this);
$this->_reporter =& $reporter;
$this->_reporter->paintCaseStart($this->getLabel());
if ($this->needPDO) {
$this->_reporter->makeDry(!$this->assertTrue(class_exists('PDO', false), 'PDO does not exists ! You should install PDO because tests need it.'));
}
foreach ($this->getTests() as $method) {
if ($this->_reporter->shouldInvoke($this->getLabel(), $method)) {
$invoker =& $this->_reporter->createInvoker($this->createInvoker());
$invoker->before($method);
$invoker->invoke($method);
$invoker->after($method);
}
}
$this->_reporter->paintCaseEnd($this->getLabel());
unset($this->_reporter);
return $reporter->getStatus();
}
示例3: run
/**
* Uses reflection to run every method within itself
* starting with the string "test" unless a method
* is specified.
* @param SimpleReporter $reporter Current test reporter.
* @access public
*/
function run(&$reporter)
{
SimpleTest::setCurrent($this);
$this->_reporter =& $reporter;
$this->_reporter->paintCaseStart($this->getLabel());
foreach ($this->getTests() as $method) {
if ($this->_reporter->shouldInvoke($this->getLabel(), $method)) {
$invoker =& $this->_reporter->createInvoker($this->createInvoker());
$invoker->before($method);
$invoker->invoke($method);
$invoker->after($method);
}
}
$this->_reporter->paintCaseEnd($this->getLabel());
unset($this->_reporter);
return $reporter->getStatus();
}