本文整理匯總了PHP中AutoLoader::include_dir方法的典型用法代碼示例。如果您正苦於以下問題:PHP AutoLoader::include_dir方法的具體用法?PHP AutoLoader::include_dir怎麽用?PHP AutoLoader::include_dir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AutoLoader
的用法示例。
在下文中一共展示了AutoLoader::include_dir方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run_tests
public function run_tests($argv)
{
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
define("ENV", "test");
$this->app_setup();
define("CLI_ENV", true);
if (!(include 'simpletest/unit_tester.php') || !(include 'simpletest/mock_objects.php')) {
throw new WXDependencyException("Simpletest library required. Install it somewhere in the include path", "Simpletest Dependency Failure");
}
if ($argv[1] == "wax") {
$testdir = FRAMEWORK_DIR . "/tests";
} elseif ($argv[1] && is_dir(PLUGIN_DIR . $argv[1] . "/tests")) {
$testdir = PLUGIN_DIR . $argv[1] . "/tests";
} else {
$testdir = APP_DIR . "tests";
}
AutoLoader::include_dir($testdir);
$test = new GroupTest('All tests');
foreach (scandir($testdir) as $file) {
if (substr($file, -3) == "php" && substr($file, 0, 1) != ".") {
$class = substr($file, 0, -4);
$test->addTestClass($class);
}
}
if (TextReporter::inCli()) {
exit($test->run(new TextReporter()) ? 0 : 1);
}
$test->run(new HtmlReporter());
}