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