diff --git a/module/execution/test/execution.class.php b/module/execution/test/execution.class.php index 8e387dfa0b..5c5c93788c 100644 --- a/module/execution/test/execution.class.php +++ b/module/execution/test/execution.class.php @@ -3146,4 +3146,21 @@ class executionTest return $this->executionModel->processProductPlans($plans, $param); } + + /** + * 批量导入Bug后的其他数据处理。 + * other data process after import bugs. + * + * @param int $taskID + * @param int $bugID + * @access public + * @return bool + */ + public function afterImportBugTest(int $taskID, int $bugID): bool + { + $task = $this->executionModel->loadModel('task')->getByID($taskID); + $bug = $this->executionModel->loadModel('bug')->getByID($bugID); + + return $this->executionModel->afterImportBug($task, $bug); + } } diff --git a/module/execution/test/model/afterimportbug.php b/module/execution/test/model/afterimportbug.php new file mode 100644 index 0000000000..561049a7a6 --- /dev/null +++ b/module/execution/test/model/afterimportbug.php @@ -0,0 +1,41 @@ +#!/usr/bin/env php +id->range('1-10'); +$task->name->range('1-10')->prefix('任务'); +$task->execution->range('3,4,5'); +$task->status->range('wait,doing'); +$task->estimate->range('6'); +$task->left->range('3'); +$task->consumed->range('3'); +$task->gen(10); + +$bug = zdTable('bug'); +$bug->id->range('1-4'); +$bug->title->range('1-4')->prefix('Bug'); +$bug->project->range('1,2,1'); +$bug->execution->range('3,4,5'); +$bug->task->range('1-10'); +$bug->status->range('active'); +$bug->gen(4); + +su('admin'); + +/** + +title=测试executionModel->afterImportBug(); +timeout=0 +cid=1 + +*/ + +$taskIdList = array(1, 2, 3); +$bugIdList = array(1, 2, 3); + +$executionTester = new executionTest(); +r($executionTester->afterImportBugTest($taskIdList[0], $bugIdList[0])) && p() && e('1'); // 测试导入Bug1后的数据处理 +r($executionTester->afterImportBugTest($taskIdList[1], $bugIdList[1])) && p() && e('1'); // 测试导入Bug2后的数据处理 +r($executionTester->afterImportBugTest($taskIdList[2], $bugIdList[2])) && p() && e('1'); // 测试导入Bug3后的数据处理