diff --git a/module/execution/model.php b/module/execution/model.php index 3c01da5869..89ceb02b02 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2700,7 +2700,7 @@ class executionModel extends model /** * 获取要导入的执行列表。 - * Get executions to import + * Get executions to import. * * @param array $executionIds * @param string $type sprint|stage|kanban diff --git a/module/execution/test/execution.class.php b/module/execution/test/execution.class.php index 3ec8b5df29..72a67affed 100644 --- a/module/execution/test/execution.class.php +++ b/module/execution/test/execution.class.php @@ -1113,24 +1113,25 @@ class executionTest } /** - * function getToImport test execution + * 获取要导入的执行列表。 + * Get executions to import. * - * @param string $executionIds + * @param array $executionIdList * @param string $type - * @param string $count + * @param int $count * @access public - * @return array + * @return array|int */ - public function getToImportTest($executionIds, $type, $count) + public function getToImportTest(array $executionIdList, string $type, int $count): array|int { - $object = $this->executionModel->getToImport($executionIds, $type); + $object = $this->executionModel->getToImport($executionIdList, $type); if(dao::isError()) { $error = dao::getError(); return $error; } - elseif($count == "1") + elseif($count == 1) { return count($object); } diff --git a/module/execution/test/model/gettoimport.php b/module/execution/test/model/gettoimport.php index ef79dd2665..3172845ec7 100755 --- a/module/execution/test/model/gettoimport.php +++ b/module/execution/test/model/gettoimport.php @@ -16,28 +16,21 @@ su('admin'); /** title=测试executionModel->getToImportTest(); +timeout=0 cid=1 -pid=1 - -敏捷执行查询 >> 迭代1 -瀑布执行查询 >> 阶段3 -看板执行查询 >> 看板5 -敏捷执行统计 >> 2 -瀑布执行统计 >> 2 -看板执行统计 >> 2 */ -$sprintExecutions = array('2', '3'); -$stageExecutions = array('4', '5'); -$kanbanExecutions = array('6', '7'); -$type = array('sprint', 'stage', 'kanban'); -$count = array('0', '1'); +$sprintExecutions = array(2, 3); +$stageExecutions = array(4, 5); +$kanbanExecutions = array(6, 7); +$type = array('sprint', 'stage', 'kanban'); +$count = array(0, 1); $execution = new executionTest(); -r($execution->getToImportTest($sprintExecutions,$type[0],$count[0])) && p('2') && e('迭代1'); // 敏捷执行查询 -r($execution->getToImportTest($stageExecutions,$type[1],$count[0])) && p('4') && e('阶段3'); // 瀑布执行查询 -r($execution->getToImportTest($kanbanExecutions,$type[2],$count[0])) && p('6') && e('看板5'); // 看板执行查询 -r($execution->getToImportTest($sprintExecutions,$type[0],$count[1])) && p('') && e('2'); // 敏捷执行统计 -r($execution->getToImportTest($stageExecutions,$type[1],$count[1])) && p('') && e('2'); // 瀑布执行统计 -r($execution->getToImportTest($kanbanExecutions,$type[2],$count[1])) && p('') && e('2'); // 看板执行统计 +r($execution->getToImportTest($sprintExecutions, $type[0], $count[0])) && p('2') && e('迭代1'); // 敏捷执行查询 +r($execution->getToImportTest($stageExecutions, $type[1], $count[0])) && p('4') && e('阶段3'); // 瀑布执行查询 +r($execution->getToImportTest($kanbanExecutions, $type[2], $count[0])) && p('6') && e('看板5'); // 看板执行查询 +r($execution->getToImportTest($sprintExecutions, $type[0], $count[1])) && p('') && e('2'); // 敏捷执行统计 +r($execution->getToImportTest($stageExecutions, $type[1], $count[1])) && p('') && e('2'); // 瀑布执行统计 +r($execution->getToImportTest($kanbanExecutions, $type[2], $count[1])) && p('') && e('2'); // 看板执行统计