本文整理汇总了PHP中TestFinder::run方法的典型用法代码示例。如果您正苦于以下问题:PHP TestFinder::run方法的具体用法?PHP TestFinder::run怎么用?PHP TestFinder::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestFinder
的用法示例。
在下文中一共展示了TestFinder::run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onCommand
public function onCommand(CommandEvent $event)
{
if ($event->cmd == "help") {
print " test [extension]\n";
print " run automated tests for the name extension\n\n";
}
if ($event->cmd == "test") {
$all = new TestFinder($event->args[0]);
$all->run(new SCoreCLIReporter());
}
}
示例2: onPageRequest
public function onPageRequest($event)
{
global $page;
if ($event->page_matches("test")) {
set_time_limit(0);
$page->set_title("Test Results");
$page->set_heading("Test Results");
$page->add_block(new NavBlock());
$all = new TestFinder($event->get_arg(0));
$all->run(new SCoreReporter($page));
}
}
示例3: Database
require_once $filename;
}
// We also need to pull in the SimpleTest extension.
require_once 'ext/simpletest/main.php';
// connect to the database
$database = new Database();
$config = new DatabaseConfig($database);
// load the theme parts
foreach (_get_themelet_files(get_theme()) as $themelet) {
require_once $themelet;
}
_load_extensions();
// Fire off the InitExtEvent()
$page = class_exists("CustomPage") ? new CustomPage() : new Page();
$user = _get_user();
send_event(new InitExtEvent());
// Put the database into autocommit mode for making the users.
$database->commit();
// Create the necessary users for the tests.
$userPage = new UserPage();
$userPage->onUserCreation(new UserCreationEvent("demo", "demo", ""));
$userPage->onUserCreation(new UserCreationEvent("test", "test", ""));
// Fire off the InitExtEvent() again after we have made the users.
$page = class_exists("CustomPage") ? new CustomPage() : new Page();
$user = _get_user();
send_event(new InitExtEvent());
// Now we can actually run all the tests.
$all = new TestFinder("");
$results = $all->run(new TextReporter());
// Travis-CI needs to know the results of the tests.
exit($results ? 0 : 1);