示例#1
0
 public function testNotLoggedIn()
 {
     $controller = new GridController(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('errormsg'));
 }
示例#2
0
 *
 * ThinkUp/webapp/post/grid.php
 *
 * Copyright (c) 2009-2011 Mark Wilkie
 *
 * LICENSE:
 *
 * This file is part of ThinkUp (http://thinkupapp.com).
 *
 * 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
 * <http://www.gnu.org/licenses/>.
 *
 *
 * @author Mark Wilkie <mark[at]bitterpill[dot]org>
 * @license http://www.gnu.org/licenses/gpl.html
 * @copyright 2009-2010 Mark Wilkie
 */
chdir("..");
require_once 'init.php';

$controller = new GridController();
echo $controller->go();
示例#3
0
 public function testNoProfilerOutput()
 {
     // Enable profiler
     $config = Config::getInstance();
     $config->setValue('enable_profiler', true);
     $_SERVER['HTTP_HOST'] = 'something';
     $builders = $this->buildData();
     $this->simulateLogin('*****@*****.**');
     $_GET['u'] = 'someuser1';
     $_GET['n'] = 'twitter';
     $_GET['d'] = 'tweets-all';
     $controller = new GridController(true);
     $this->assertTrue(isset($controller));
     ob_start();
     $results = $controller->go();
     $results .= ob_get_contents();
     ob_end_clean();
     $json = substr($results, 29, strrpos($results, ';') - 30);
     $ob = json_decode($json);
     // If the profiler outputs HTML (it shouldn't), the following will fail
     $this->assertIsA($ob, 'stdClass');
     unset($_SERVER['HTTP_HOST']);
 }