From 1616e01773c2e302941c5a9166edbb3aeff5f353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 24 May 2022 10:34:52 +0800 Subject: [PATCH 1/2] * Add group-updateview test. --- test/model/group/updateview.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) mode change 100644 => 100755 test/model/group/updateview.php diff --git a/test/model/group/updateview.php b/test/model/group/updateview.php old mode 100644 new mode 100755 index 667b57cfa8..7e53c6d698 --- a/test/model/group/updateview.php +++ b/test/model/group/updateview.php @@ -1,7 +1,6 @@ #!/usr/bin/env php loadModel('group'); -r($group->updateViewTest()) && p() && e(); \ No newline at end of file +$_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"); From 62cff2234db8ac56b4d9250e426e23db3653c689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=B9=BF=E6=98=8E?= Date: Tue, 24 May 2022 10:36:50 +0800 Subject: [PATCH 2/2] * Remove unused code. --- test/class/group.class.php | 16 ---------------- 1 file changed, 16 deletions(-) mode change 100644 => 100755 test/class/group.class.php diff --git a/test/class/group.class.php b/test/class/group.class.php old mode 100644 new mode 100755 index 70af3f4cc7..95b8d5abcf --- a/test/class/group.class.php +++ b/test/class/group.class.php @@ -286,22 +286,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. *