本文整理汇总了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();
}