本文整理汇总了PHP中TestRunner::setTestDirectories方法的典型用法代码示例。如果您正苦于以下问题:PHP TestRunner::setTestDirectories方法的具体用法?PHP TestRunner::setTestDirectories怎么用?PHP TestRunner::setTestDirectories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestRunner
的用法示例。
在下文中一共展示了TestRunner::setTestDirectories方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: TestRunner
<?php
require_once 'TestRunner.php';
$runner = new TestRunner('all');
$runner->init();
$runner->requireDatabase();
$testDirs = array('/tests/core', '/plugins');
if ($runner->isBrowserPresent()) {
$testDirs[] = '/tests/integration';
} else {
$runner->appendIntro("<p>" . $runner->getNoBrowserErrorMessage() . "<br/>Skipping integration tests...</p>");
}
$runner->setTestDirectories($testDirs);
$runner->run();
/*
assertTrue($x) Fail if $x is false
assertFalse($x) Fail if $x is true
assertNull($x) Fail if $x is set
assertNotNull($x) Fail if $x not set
assertIsA($x, $t) Fail if $x is not the class or type $t
assertNotA($x, $t) Fail if $x is of the class or type $t
assertEqual($x, $y) Fail if $x == $y is false
assertNotEqual($x, $y) Fail if $x == $y is true
assertWithinMargin($x, $y, $m) Fail if abs($x - $y) < $m is false
assertOutsideMargin($x, $y, $m) Fail if abs($x - $y) < $m is true
assertIdentical($x, $y) Fail if $x == $y is false or a type mismatch
assertNotIdentical($x, $y) Fail if $x == $y is true and types match
assertReference($x, $y) Fail unless $x and $y are the same variable
assertClone($x, $y) Fail unless $x and $y are identical copies
assertPattern($p, $x) Fail unless the regex $p matches $x
assertNoPattern($p, $x) Fail if the regex $p matches $x
示例2: TestRunner
<?php
require_once 'TestRunner.php';
$runner = new TestRunner('integration');
$runner->init();
$runner->requireBrowser();
$runner->requireDatabase();
$runner->setTestDirectories(array('/tests/integration'));
$runner->run();