/** * Test controller for logged-in user * @TODO Possibly load the resulting markup as a DOM object and test various children in it; * this would enforce valid markup */ public function testIsLoggedIn() { $this->simulateLogin('*****@*****.**'); $config = Config::getInstance(); $config->setValue('site_root_path', '/my/path/to/thinkup/'); $controller = new TestAuthController(true); $results = $controller->go(); //test if view variables were set correctly $v_mgr = $controller->getViewManager(); $this->assertEqual($v_mgr->getTemplateDataItem('test'), 'Testing, testing, 123'); $this->assertEqual($v_mgr->getTemplateDataItem('app_title'), 'ThinkUp'); $this->assertEqual($results, '<a href="/my/path/to/thinkup/">ThinkUp</a>: Testing, testing, 123 | Logged in as me@example.com', "auth controller output when logged in"); }