* Modify test case.
This commit is contained in:
@@ -2,8 +2,22 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
$db->switchDB();
|
||||
su('admin');
|
||||
|
||||
$execution = zdTable('project');
|
||||
$execution->id->range('1-5');
|
||||
$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3');
|
||||
$execution->type->range('project{2},sprint{3}');
|
||||
$execution->status->range('doing{3},closed,doing');
|
||||
$execution->parent->range('0,0,1,1,2');
|
||||
$execution->grade->range('2{2},1{3}');
|
||||
$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(',');
|
||||
$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD');
|
||||
$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD');
|
||||
$execution->gen(5);
|
||||
|
||||
zdTable('user')->gen(5);
|
||||
|
||||
su('user1');
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,15 +25,15 @@ title=测试executionModel->updateUserView();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
默认情况下的用户是否有201权限 >> 400
|
||||
删除执行201后dev1用户是否有201权限 >> 0
|
||||
默认情况下的用户是否有执行的可视权限 >> 2
|
||||
删除执行执行后用户是否有执行的可视权限 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$executionID = 201;
|
||||
$executionID = 3;
|
||||
|
||||
$execution = new executionTest();
|
||||
r(strpos($execution->updateUserViewTest($executionID), '201,')) && p() && e('400'); // 默认情况下的用户是否有201权限
|
||||
r(strpos($execution->updateUserViewTest($executionID), '4,')) && p() && e('2'); // 默认情况下的用户是否有执行的可视权限
|
||||
|
||||
$tester->dao->update(TABLE_EXECUTION)->set('deleted')->eq(1)->where('id')->eq($executionID)->exec();
|
||||
r(strpos($execution->updateUserViewTest($executionID, 'sprint', array('dev1')), '201,')) && p() && e('0'); // 删除执行201后dev1用户是否有201权限
|
||||
$db->restoreDB();
|
||||
r(strpos($execution->updateUserViewTest($executionID, 'sprint'), '3,')) && p() && e('0'); // 删除执行执行后用户是否有执行的可视权限
|
||||
|
||||
Reference in New Issue
Block a user