public function testRepairProcess()
 {
     self::time(__METHOD__);
     $config = Config::getInstance();
     //repair process gets kicked off when at least 1 whole TU table is missing from the DB
     // drop one table
     $dao = new InstallerMySQLDAO();
     $q = "DROP TABLE " . $config->getValue('table_prefix') . "encoded_locations";
     PDODAO::$PDO->exec($q);
     $controller = new InstallerController(true);
     $result = $controller->go();
     $this->assertPattern("/Looks like at least some of ThinkUp\\'s database tables already exist./", $result);
     $_GET["step"] = "repair";
     $_GET["m"] = "db";
     $_SERVER['REQUEST_URI'] = '/';
     $config->setValue('repair', true);
     $controller = new InstallerController(true);
     $result = $controller->go();
     $this->assertPattern("/Check your existing ThinkUp tables. If some tables are missing or need repair, " . "ThinkUp will attempt to create or repair them./", $result);
     $_POST["repair"] = "yespls";
     $controller = new InstallerController(true);
     $result = $controller->go();
     $this->assertPattern("/Created table " . $config->getValue('table_prefix') . "encoded_locations/", $result);
 }
示例#2
0
文件: index.php 项目: JWFoxJr/ThinkUp
/**
 *
 * ThinkUp/webapp/install/index.php
 *
 * Copyright (c) 2009-2012 Gina Trapani
 *
 * 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 Gina Trapani <ginatrapani[at]gmail[dot]com>
 * @license http://www.gnu.org/licenses/gpl.html
 * @copyright 2009-2012 Gina Trapani, Dwi Widiastuti
 */
chdir("..");
require_once 'init.php';
$controller = new InstallerController();
echo $controller->go();