本文整理汇总了PHP中TestCase::getClassName方法的典型用法代码示例。如果您正苦于以下问题:PHP TestCase::getClassName方法的具体用法?PHP TestCase::getClassName怎么用?PHP TestCase::getClassName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestCase
的用法示例。
在下文中一共展示了TestCase::getClassName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addTest
/**
* Add a test
*
* @param unittest.TestCase test
* @return unittest.TestCase
* @throws lang.IllegalArgumentException in case given argument is not a testcase
* @throws lang.MethodNotImplementedException in case given argument is not a valid testcase
*/
public function addTest(TestCase $test)
{
if (!$test->getClass()->hasMethod($test->name)) {
throw new MethodNotImplementedException('Test method does not exist', $test->name);
}
$className = $test->getClassName();
// Verify no special method, e.g. setUp() or tearDown() is overwritten.
$base = XPClass::forName('unittest.TestCase');
if ($base->hasMethod($test->name)) {
throw new IllegalStateException(sprintf('Cannot override %s::%s with test method in %s', $base->getName(), $test->name, $test->getClass()->getMethod($test->name)->getDeclaringClass()->getName()));
}
if (!isset($this->order[$className])) {
$this->order[$className] = array();
}
$this->order[$className][] = sizeof($this->tests);
$this->tests[] = $test;
return $test;
}
示例2: writeStatus
/**
* Write status of currently executing test case
*
* @param unittest.TestCase case
*/
private function writeStatus(TestCase $case)
{
$this->cur++;
$perc = floor($this->cur / $this->sum * self::PROGRESS_WIDTH);
$this->out->writef("]2;Running: [%s%s] %s::%s()", str_repeat('*', $perc), str_repeat('-', self::PROGRESS_WIDTH - $perc), $case->getClassName(), $case->getName());
}