$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 = [];
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; }