public function restoreDBforThisTest()
 {
     $dbRestorer = new TikiAcceptanceTestDBRestorerSQLDumps();
     $error_msg = $dbRestorer->restoreDB($this->current_test_db);
     if ($error_msg != null) {
         $this->markTestSkipped($error_msg);
     }
 }
<?php

/*
 * Created on Jun 24, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
set_include_path(get_include_path() . PATH_SEPARATOR . "../..");
set_include_path(get_include_path() . PATH_SEPARATOR . "../../..");
set_include_path(get_include_path() . PATH_SEPARATOR . "../../../..");
require_once 'TikiAcceptanceTestDBRestorer.php';
//die ("WARNING: This script will destroy the current Tiki db. Comment out this line in the script to proceed.");
if ($argc != 2) {
    die("Missing argument. USAGE: {$argv['0']} <dump_filename>");
}
$test_TikiAcceptanceTestDBRestorer = new TikiAcceptanceTestDBRestorerSQLDumps();
$test_TikiAcceptanceTestDBRestorer->restoreDB($argv[1]);
$local_php = 'db/local.php';
require_once 'installer/installlib.php';
require_once 'lib/core/TikiDb.php';
include_once 'lib/adodb/adodb.inc.php';
include $local_php;
$dbTiki = ADONewConnection($db_tiki);
$dbTiki->Connect($host_tiki, $user_tiki, $pass_tiki, $dbs_tiki);
$installer = new Installer();
$installer->update();
$test_TikiAcceptanceTestDBRestorer->create_dump_file($argv[1]);
Beispiel #3
0
<?php

/*
 * Created on Jun 22, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
set_include_path(get_include_path() . PATH_SEPARATOR . "../..");
set_include_path(get_include_path() . PATH_SEPARATOR . "../../..");
set_include_path(get_include_path() . PATH_SEPARATOR . "../../../..");
require_once 'tiki-setup.php';
require_once 'lib/test/TikiAcceptanceTestDBRestorer.php';
if ($argc != 2) {
    die("Missing argument. USAGE: {$argv['0']} <dump_filename>");
}
$test_TikiAcceptanceTestDBRestorer = new TikiAcceptanceTestDBRestorerSQLDumps();
$test_TikiAcceptanceTestDBRestorer->restoreDB($argv[1]);
echo "File DB was restored based on dump {$argv['1']}";