本文整理汇总了PHP中GroupTest::addFile方法的典型用法代码示例。如果您正苦于以下问题:PHP GroupTest::addFile方法的具体用法?PHP GroupTest::addFile怎么用?PHP GroupTest::addFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GroupTest
的用法示例。
在下文中一共展示了GroupTest::addFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$test = new GroupTest("Piwik - running '{$this->testGroupType}' tests...");
$intro = '';
if (!$this->databaseRequired) {
$intro .= $this->getTestDatabaseInfoMessage();
}
$intro .= self::$testsHelpLinks . "<hr/>";
$intro .= $this->introAppend;
$toInclude = array();
foreach ($this->dirsToGlob as $dir) {
$toInclude = array_merge($toInclude, Piwik::globr(PIWIK_INCLUDE_PATH . $dir, '*.test.php'));
}
// if present, make sure Database.test.php is first
$idx = array_search(PIWIK_INCLUDE_PATH . '/tests/core/Database.test.php', $toInclude);
if ($idx !== FALSE) {
unset($toInclude[$idx]);
array_unshift($toInclude, PIWIK_INCLUDE_PATH . '/tests/core/Database.test.php');
}
foreach ($toInclude as $file) {
$test->addFile($file);
}
$result = $test->run(new HtmlTimerReporter($intro));
if (SimpleReporter::inCli()) {
exit($result ? 0 : 1);
}
}
示例2: GroupTest
function test_load_if_included()
{
$tests = new GroupTest();
$tests->addFile(dirname(__FILE__) . '/support/test1.php');
$this->assertEqual($tests->getSize(), 1);
}