本文整理汇总了PHP中TestManager::_getGroupTestClassNames方法的典型用法代码示例。如果您正苦于以下问题:PHP TestManager::_getGroupTestClassNames方法的具体用法?PHP TestManager::_getGroupTestClassNames怎么用?PHP TestManager::_getGroupTestClassNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestManager
的用法示例。
在下文中一共展示了TestManager::_getGroupTestClassNames方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runGroupTest
/**
* Runs a specific group test file
*
* @param string $groupTestName
* @param string $reporter
* @return void
* @access public
*/
function runGroupTest($groupTestName, &$reporter)
{
$manager = new TestManager();
$filePath = $manager->_getTestsPath('groups') . DS . strtolower($groupTestName) . $manager->_groupExtension;
if (!file_exists($filePath)) {
trigger_error("Group test {$groupTestName} cannot be found at {$filePath}", E_USER_ERROR);
}
require_once $filePath;
$test = new TestSuite($groupTestName . ' group test');
foreach ($manager->_getGroupTestClassNames($filePath) as $groupTest) {
$testCase = new $groupTest();
$test->addTestCase($testCase);
if (isset($testCase->label)) {
$test->_label = $testCase->label;
}
}
return $test->run($reporter);
}
示例2: runGroupTest
function runGroupTest($group_test_name, $group_test_directory, &$reporter)
{
$manager = new TestManager();
$group_test_name = preg_replace('/[^a-zA-Z0-9_:]/', '', $group_test_name);
$group_test_name = str_replace(':', DIRECTORY_SEPARATOR, $group_test_name);
$file_path = $group_test_directory . DIRECTORY_SEPARATOR . strtolower($group_test_name) . $manager->_grouptest_extension;
if (!file_exists($file_path)) {
trigger_error("Group test {$group_test_name} cannot be found at {$file_path}", E_USER_ERROR);
}
require_once $file_path;
$test = new GroupTest($group_test_name . ' group test');
foreach ($manager->_getGroupTestClassNames($file_path) as $group_test) {
$test->addTestCase(new $group_test());
}
$test->run($reporter);
}