diff --git a/module/execution/test/execution.class.php b/module/execution/test/execution.class.php index a4dd06707b..e046f311cd 100644 --- a/module/execution/test/execution.class.php +++ b/module/execution/test/execution.class.php @@ -3018,4 +3018,19 @@ class executionTest $this->executionModel->setKanbanMenu(); return $this->executionModel->lang->execution->menu; } + + /** + * 根据条件设置执行二级导航。 + * Set secondary navigation based on the conditions. + * + * @param int $executionID + * @access public + * @return object + */ + public function removeMenuTest(int $executionID): object + { + $execution = $this->executionModel->fetchByID($executionID); + $this->executionModel->removeMenu($execution); + return $this->executionModel->lang->execution->menu; + } } diff --git a/module/execution/test/model/removemenu.php b/module/execution/test/model/removemenu.php new file mode 100644 index 0000000000..7b50f0afe0 --- /dev/null +++ b/module/execution/test/model/removemenu.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +gen(5); +su('admin'); + +zdTable('project')->config('execution')->gen(10); + +/** + +title=测试executionModel->removeMenu(); +timeout=0 +cid=1 + +*/ + +$executionIdList = array(11, 60, 100); + +$executionTester = new executionTest(); +r($executionTester->removeMenuTest($executionIdList[0])) && p('more:link') && e('更多|execution|more|%s'); // 测试移除迭代的导航 +r($executionTester->removeMenuTest($executionIdList[1])) && p('task:link') && e('任务|execution|task|executionID=%s'); // 测试移除阶段的导航 +r($executionTester->removeMenuTest($executionIdList[2])) && p('kanban:link') && e('看板|execution|taskkanban|executionID=%s'); // 测试移除看板的导航