本文整理匯總了PHP中TestRunner::isTestSuiteFolder方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestRunner::isTestSuiteFolder方法的具體用法?PHP TestRunner::isTestSuiteFolder怎麽用?PHP TestRunner::isTestSuiteFolder使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TestRunner
的用法示例。
在下文中一共展示了TestRunner::isTestSuiteFolder方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testIsTestSuiteFolder
public function testIsTestSuiteFolder()
{
$this->guy->createTestFolderTree($this->tmpPath1);
$this->assertTrue($this->guy->isTestFolderTree($this->tmpPath1));
$this->assertFalse(TestRunner::isTestSuiteFolder($this->tmpPath1 . DS . 'testFolder'));
$this->assertTrue(TestRunner::isTestSuiteFolder($this->tmpPath1 . DS . 'testFolder' . DS . 'subFolder1'));
$this->assertTrue(TestRunner::isTestSuiteFolder($this->tmpPath1 . DS . 'testFolder' . DS . 'subFolder2'));
$this->assertFalse(TestRunner::isTestSuiteFolder($this->tmpPath1));
$this->assertFalse(TestRunner::isTestSuiteFolder($this->tmpPath1 . DS . 'nonExistentFolder'));
}
示例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;
}