本文整理匯總了PHP中TestRunner::findTestFolders方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestRunner::findTestFolders方法的具體用法?PHP TestRunner::findTestFolders怎麽用?PHP TestRunner::findTestFolders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TestRunner
的用法示例。
在下文中一共展示了TestRunner::findTestFolders方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: implode
$output[] = "-------------------------------------------------";
$output[] = "INSTALLED CMFIVE";
$output[] = "-------------------------------------------------";
}
// DUMP OUTPUT
if (php_sapi_name() == 'cli') {
echo implode("\n", $output);
$output = array();
}
// clean combined output path
FileSystemTools::prune(TestConfig::getConfig('testOutputPath'));
// find all test folders
$output[] = "-------------------------------------------------";
$output[] = "FOUND TEST FOLDERS";
$output[] = "-------------------------------------------------";
$testFolders = TestRunner::findTestFolders(TestConfig::getConfig('testPath'));
// show all test folders
foreach ($testFolders as $k => $v) {
$output[] = $v;
}
$output[] = "-------------------------------------------------";
// DUMP OUTPUT
if (php_sapi_name() == 'cli') {
echo "\n" . implode("\n", $output) . "\n";
$output = array();
}
// run all test suites in each test folder
$passedAllTests = true;
foreach ($testFolders as $key => $folder) {
// take a snapshot of all log files
$snapshots = [];
示例2: findTestFolders
static function findTestFolders($paths)
{
$suites = array();
foreach (explode("::::", $paths) as $path) {
if (is_dir($path)) {
if (TestRunner::isTestSuiteFolder($path)) {
$stagingSuiteName = str_replace(':', '_', str_replace(DS, '_', $path));
$suites[$stagingSuiteName] = $path;
}
$objects = scandir($path);
if (sizeof($objects) > 0) {
foreach ($objects as $file) {
if ($file == "." || $file == "..") {
continue;
}
if (is_dir($path . DS . basename($file))) {
if (TestRunner::isTestSuiteFolder($path . DS . basename($file))) {
$stagingSuiteName = str_replace(':', '_', str_replace(DS, '_', $path . DS . basename($file)));
// ensure absolute file references
$suites[$stagingSuiteName] = $path . DS . basename($file);
}
// recurse into folder
$suites = array_merge($suites, TestRunner::findTestFolders($path . DS . basename($file)));
}
}
}
}
}
return $suites;
}