本文整理匯總了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);
}