本文整理汇总了PHP中TestSuite::getBaseTestCase方法的典型用法代码示例。如果您正苦于以下问题:PHP TestSuite::getBaseTestCase方法的具体用法?PHP TestSuite::getBaseTestCase怎么用?PHP TestSuite::getBaseTestCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestSuite
的用法示例。
在下文中一共展示了TestSuite::getBaseTestCase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
/**
* Adds a test into the suite by instance or class. The class will
* be instantiated if it's a test suite.
* @param SimpleTestCase $test_case Suite or individual test
* case implementing the
* runnable test interface.
*/
public function add($test_case)
{
if (!is_string($test_case)) {
$this->test_cases[] = $test_case;
} elseif (TestSuite::getBaseTestCase($test_case) == 'testsuite') {
$this->test_cases[] = new $test_case();
} else {
$this->test_cases[] = $test_case;
}
}
示例2: add
/**
* Adds a test into the suite by instance or class. The class will
* be instantiated if it's a test suite.
* @param SimpleTestCase $test_case Suite or individual test
* case implementing the
* runnable test interface.
* @access public
*/
function add(&$test_case) {
if (! is_string($test_case)) {
$this->_test_cases[] = &$test_case;
} elseif (TestSuite::getBaseTestCase($class) == 'testsuite') {
$this->_test_cases[] = new $class();
} else {
$this->_test_cases[] = $class;
}
}
示例3: selectRunnableTests
/**
* Calculates the incoming test cases. Skips abstract
* and ignored classes.
*
* @param array $candidates Candidate classes.
*
* @return array New classes which are test
* cases that shouldn't be ignored.
*/
public function selectRunnableTests($candidates)
{
$classes = array();
foreach ($candidates as $class) {
if (TestSuite::getBaseTestCase($class)) {
$reflection = new SimpleReflection($class);
if ($reflection->isAbstract()) {
SimpleTest::ignore($class);
} else {
$classes[] = $class;
}
}
}
return $classes;
}