diff --git a/module/execution/model.php b/module/execution/model.php index 127f4e7ee5..e9662c5a02 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -5136,15 +5136,16 @@ class executionModel extends model } /** - * Update user view of execution and it's product. + * 更新用户可查看的执行和产品。 + * Update the execution and product that users can view. * - * @param int|array $executionID - * @param string $objectType - * @param array $users + * @param int $executionID + * @param string $objectType + * @param array $users * @access public * @return void */ - public function updateUserView($executionID, $objectType = 'sprint', $users = array()) + public function updateUserView(int $executionID, string $objectType = 'sprint', array $users = array()) { $this->loadModel('user')->updateUserView($executionID, $objectType, $users); diff --git a/module/execution/test/execution.class.php b/module/execution/test/execution.class.php index e4ee8b75f7..5ef99c2658 100644 --- a/module/execution/test/execution.class.php +++ b/module/execution/test/execution.class.php @@ -2622,15 +2622,16 @@ class executionTest } /** - * Test Update user view of execution and it's product. + * 更新用户可查看的执行和产品。 + * Update the execution and product that users can view. * - * @param int $executionID - * @param string $objectType - * @param array $users + * @param int $executionID + * @param string $objectType + * @param array $users * @access public - * @return void + * @return string|array */ - public function updateUserViewTest($executionID, $objectType = 'sprint', $users = array()) + public function updateUserViewTest(int $executionID, string $objectType = 'sprint', array $users = array()): string|array { $this->executionModel->updateUserView($executionID, $objectType, $users); diff --git a/module/execution/test/model/updateuserview.php b/module/execution/test/model/updateuserview.php index 9d074200b7..9d4c1696de 100755 --- a/module/execution/test/model/updateuserview.php +++ b/module/execution/test/model/updateuserview.php @@ -9,6 +9,7 @@ $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->project->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'); @@ -19,19 +20,15 @@ zdTable('user')->gen(5); zdTable('team')->gen(0); zdTable('product')->gen(0); zdTable('userview')->gen(0); - su('admin'); /** title=测试executionModel->updateUserView(); +timeout=0 cid=1 -pid=1 - -默认情况下的用户是否有执行的可视权限 >> 2 */ $execution = new executionTest(); - -r(strpos($execution->updateUserViewTest(5), ',5,')) && p() && e('2'); // 默认情况下的用户是否有执行的可视权限 +r($execution->updateUserViewTest(5), ',5,') && p() && e('`,5,4,`'); // 默认情况下的用户是否有执行的可视权限