* Format case for the gettoimport file.

This commit is contained in:
tianshujie
2023-09-05 15:58:40 +08:00
parent 169d9467d6
commit f522c2f982
3 changed files with 21 additions and 27 deletions
+1 -1
View File
@@ -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
+8 -7
View File
@@ -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);
}
+12 -19
View File
@@ -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'); // 看板执行统计