Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

51 lines (48 sloc) 1.897 kB
* ThinkUp/tests/TestOfLogoutController.php
* Copyright (c) 2009-2012 Gina Trapani
* This file is part of ThinkUp (
* ThinkUp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any
* later version.
* ThinkUp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
* You should have received a copy of the GNU General Public License along with ThinkUp. If not, see
* <>.
* Test of LoginController
* @license
* @copyright 2009-2012 Gina Trapani
* @author Gina Trapani <ginatrapani[at]gmail[dot]com>
require_once dirname(__FILE__).'/init.tests.php';
require_once THINKUP_WEBAPP_PATH.'_lib/extlib/simpletest/autorun.php';
require_once THINKUP_WEBAPP_PATH.'';
class TestOfLogoutController extends ThinkUpUnitTestCase {
public function testLogoutNotLoggedIn() {
$controller = new LogoutController(true);
$results = $controller->go();
$v_mgr = $controller->getViewManager();
$config = Config::getInstance();
$this->assertEqual('You must <a href="'.$config->getValue('site_root_path').
'session/login.php">log in</a> to do this.', $v_mgr->getTemplateDataItem('error_msg'));
public function testLogoutWhileLoggedIn() {
$controller = new LogoutController(true);
$results = $controller->go();
$this->assertPattern("/You have successfully logged out/", $results);
Jump to Line
Something went wrong with that request. Please try again.