* Fix common unit test bug.

This commit is contained in:
wangyuting
2023-12-29 14:25:51 +08:00
parent f89d01d311
commit 022582d90b
3 changed files with 17 additions and 9 deletions
+6 -4
View File
@@ -15,11 +15,13 @@ cid=1
*/
global $tester, $app;
global $tester, $app, $config;
su('user1');
$app->moduleName = 'user';
$app->methodName = 'create';
$app->moduleName = 'user';
$app->methodName = 'create';
$config->webRoot = '';
$config->requestType = 'PATH_INFO';
try
{
@@ -30,7 +32,7 @@ catch (Exception $e)
$result = '没有权限';
}
r($result) && p() && e('{"load":"-checkpriv.php?m=user&f=deny&module=user&method=create"}没有权限'); // 用户没有权限时,返回跳转的URL
r($result) && p() && e('{"load":"user-deny-user-create.html"}没有权限'); // 用户没有权限时,返回跳转的URL
$app->moduleName = 'user';
$app->methodName = 'login';
+6 -3
View File
@@ -13,7 +13,10 @@ cid=1
*/
global $tester;
global $tester, $config;
$config->webRoot = '';
$config->requestType = 'PATH_INFO';
$menuLink = new stdclass();
$menuLink->link['module'] = 'task';
@@ -28,5 +31,5 @@ $menuLink1->link['vars'] = 'id=1';
$link1 = $tester->loadModel('common')->createMenuLink($menuLink);
$link2 = $tester->loadModel('common')->createMenuLink($menuLink1);
r($link1) && p('') && e('-createmenulink.php?m=task&f=create&executionID=1'); // 查看拼接后的导航链接
r($link2) && p('') && e('-createmenulink.php?m=execution&f=browse&id=1'); // 查看拼接后的导航链接
r($link1) && p('') && e('task-create-1.html'); // 查看拼接后的导航链接
r($link2) && p('') && e('execution-browse-1.html'); // 查看拼接后的导航链接
+5 -2
View File
@@ -13,7 +13,10 @@ cid=1
*/
su('admin');
global $tester;
global $tester, $config;
$config->webRoot = '';
$config->requestType = 'PATH_INFO';
$tester->loadModel('common');
try{
@@ -30,4 +33,4 @@ try{
$result2 = $e->getMessage();
}
r($result2) && p() && e('{"load":"-deny.php?m=user&f=deny&module=execution&method=create"}0'); // deny中鉴权,无权限时返回跳转的URL
r($result2) && p() && e('{"load":"user-deny-execution-create.html"}0'); // deny中鉴权,无权限时返回跳转的URL