本文整理汇总了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;
}