requestcontext stuff is messy, go back to globals :(

This commit is contained in:
Shish
2009-05-11 07:04:33 -07:00
parent e592ee4c59
commit bb84a735a2
57 changed files with 407 additions and 477 deletions

View File

@@ -25,19 +25,20 @@ class SimpleSCoreTest implements Extension {
var $theme;
public function receive_event(Event $event) {
global $config, $database, $page, $user;
if(is_null($this->theme)) $this->theme = get_theme_object($this);
if(($event instanceof PageRequestEvent) && $event->page_matches("test")) {
$event->page->set_title("Test Results");
$event->page->set_heading("Test Results");
$event->page->add_block(new NavBlock());
$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($event->page));
$all->run(new SCoreReporter($page));
}
if($event instanceof UserBlockBuildingEvent) {
if($event->user->is_admin()) {
if($user->is_admin()) {
$event->add_link("Run Tests", make_link("test/all"));
}
}

View File

@@ -1,8 +1,10 @@
<?php
#require_once('lib/simpletest/autorun.php');
require_once('simpletest/web_tester.php');
#require_once('simpletest/unit_tester.php'); # unit tests require shimmie to be running
require_once('simpletest/reporter.php');
chdir("../../");
require_once('config.php');
class SectionReporter extends TextReporter {
@@ -11,7 +13,6 @@ class SectionReporter extends TextReporter {
print "\n** $name\n";
}
}
// }}} */
class AllTests extends TestSuite {
function AllTests() {