Merge branch 'sgm_unittest' into 'master'

Sgm unittest

See merge request easycorp/zentaopms!3554
This commit is contained in:
李玉春
2022-05-24 06:47:28 +00:00
2 changed files with 15 additions and 19 deletions
Regular → Executable
-16
View File
@@ -291,22 +291,6 @@ class groupTest
return $objects;
}
/**
* Update view priv.
*
* @param int $groupID
* @access public
* @return bool
*/
public function updateViewTest($groupID)
{
$objects = $this->objectModel->updateView($groupID);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Update privilege by module.
*
Regular → Executable
+15 -3
View File
@@ -1,7 +1,6 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/group.class.php';
su('admin');
/**
@@ -12,6 +11,19 @@ pid=1
*/
$group = new groupTest();
global $tester;
$tester->loadModel('group');
r($group->updateViewTest()) && p() && e();
$_POST['allchecker'] = 1;
$tester->group->updateView(1);
$group1 = $tester->group->getByID(1);
$_POST['actions']['task']['create'] = 'create';
$tester->group->updateView(1);
$group2 = $tester->group->getByID(1);
r(count($group1->acl)) && p() && e('2'); // 针对ID为1的权限分组,设置全选权限,查看返回的数据元素数量
r(count($group2->acl)) && p() && e('3'); // 针对ID为1的权限分组,设置任务创建权限,查看返回的数据元素数量
r($group2->acl) && p('task:create') && e('create'); // 针对ID为1的权限分组,设置任务创建权限,查看是否有创建方法
system("./ztest init");