Merge branch 'unittest_ly' into 'master'

* Fix unit test config.

See merge request easycorp/zentaopms!5328
This commit is contained in:
李玉春
2022-09-15 00:16:15 +00:00
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
<?php
$config->test = new stdclass;
$config->test->dbPrefix = "db_"; //复制数据库的数据库前缀,便于区分复制数据库
$config->test->rawDB = ''; //要复制的数据库,也就是ztest init初始化的数据库,例子:zentaounittest
$config->test->rawDB = 'zentaounittest'; //要复制的数据库,也就是ztest init初始化的数据库,例子:zentaounittest
$config->test->dbNum = 10; //复制数据库的数量,可以根据自己的需要自行调节
$config->test->base = ''; //api测试基准路径,例子:http://liyang.oop.cc:8072/max/api.php/v1
+2 -2
View File
@@ -62,10 +62,10 @@ include $testPath . 'config/config.php';
include $testPath. 'lib/db.class.php';
include $testPath. 'lib/rest.php';
$db = new db();
$rest = new rest($config->test->base);
if(isset($config->test->account, $config->test->password))
if(!empty($config->test->account) and !empty($config->test->password) and !empty($config->test->base))
{
$rest = new rest($config->test->base);
$token = $rest->post('/tokens', array('account' => $config->test->account, 'password' => $config->test->password));
$token = $token->body;
}