* Fix format.

This commit is contained in:
liyang
2022-06-27 10:40:57 +08:00
parent 02589ba46c
commit 804fe254d0
2 changed files with 13 additions and 8 deletions
+2 -2
View File
@@ -12,10 +12,10 @@
* @version $Id: $
* @link http://www.zentao.net
*/
$testPath = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR;
/* Set the error reporting. */
error_reporting(E_ALL & E_STRICT);
$testPath = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'test' . DIRECTORY_SEPARATOR;
$frameworkRoot = dirname(dirname(dirname(__FILE__))) . DIRECTORY_SEPARATOR . 'framework' . DIRECTORY_SEPARATOR;
/**
@@ -44,7 +44,6 @@ include $frameworkRoot . 'control.class.php';
include $frameworkRoot . 'model.class.php';
include $frameworkRoot . 'helper.class.php';
$app = router::createApp('pms', dirname(dirname(__FILE__)), 'router');
$tester = $app->loadCommon();
@@ -57,6 +56,7 @@ $config->zdPath = dirname(dirname(__FILE__)) . '/tools/zd';
include $testPath . 'config/config.php';
include $testPath. 'lib/db.class.php';
$db = new db();
/**
* Save variable to $_result.
*
+11 -6
View File
@@ -208,22 +208,27 @@ function zdRun($model = '')
}
}
/**
* copy init DB.
*
* @access public
* @return void
*/
function copyDB()
{
global $config;
global $dao;
global $config, $dao;
$dumpCommand = "mysqldump -u%s -p%s %s > %s";
$sqlFile = TEST_BASEHPATH . DS . 'tmp/raw.sql';
$dumpCommand = "mysqldump -u%s -p%s %s > %s";
$sqlFile = TEST_BASEHPATH . DS . 'tmp/raw.sql';
$currentDBNum = $dao->query("select count(*) from information_schema.SCHEMATA where SCHEMA_NAME like '" . $config->test->dbPrefix . "%'");
$dumpCommand = sprintf($dumpCommand, $config->db->user, $config->db->password, $config->test->rawDB, $sqlFile);
$dumpCommand = sprintf($dumpCommand, $config->db->user, $config->db->password, $config->test->rawDB, $sqlFile);
shell_exec($dumpCommand);
$dbNum = $config->test->dbNum;
$dbUsed = array();
for ($i = 1; $i <= $dbNum; $i++)
for($i = 1; $i <= $dbNum; $i++)
{
$dbUsed[] = $config->test->dbPrefix . $i;
}