diff --git a/ext/simpletest/main.php b/ext/simpletest/main.php index 7f44c8e9..b6d41ea1 100644 --- a/ext/simpletest/main.php +++ b/ext/simpletest/main.php @@ -110,7 +110,13 @@ class SCoreWebTestCase extends WebTestCase { * the right thing; no need for http:// or any such */ protected function get_page($page) { - $raw = $this->get(make_http(make_link($page))); + if($_SERVER['HTTP_HOST'] == "") { + print "http://127.0.0.1/2.Xm/index.php?q=$page"; + $raw = $this->get("http://127.0.0.1/2.Xm/index.php?q=$page"); + } + else { + $raw = $this->get(make_http(make_link($page))); + } $this->assertNoText("Exception:"); $this->assertNoText("Error:"); $this->assertNoText("Warning:"); @@ -217,7 +223,18 @@ class SimpleSCoreTest extends Extension { $page->add_block(new NavBlock()); $all = new TestFinder($event->get_arg(0)); - $all->run(new SCoreReporter($page)); + $all->run(new SCoreWebReporter($page)); + } + } + + 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()); } } diff --git a/ext/simpletest/theme.php b/ext/simpletest/theme.php index 3db4f54f..8dda7a87 100644 --- a/ext/simpletest/theme.php +++ b/ext/simpletest/theme.php @@ -3,7 +3,7 @@ class SimpleSCoreTestTheme extends Themelet { } /** @private */ -class SCoreReporter extends HtmlReporter { +class SCoreWebReporter extends HtmlReporter { var $current_html = ""; var $clear_modules = array(); var $page; @@ -74,4 +74,8 @@ class SCoreReporter extends HtmlReporter { $this->current_html .= "

Exception: $message"; } } + +/** @private */ +class SCoreCLIReporter extends TextReporter { +} ?>