From 134fd01f7b0510d8ca12afe2258610f8b35150b3 Mon Sep 17 00:00:00 2001 From: wangyuting Date: Fri, 30 May 2025 02:43:35 +0000 Subject: [PATCH] * Add unit test script comment. --- module/task/model.php | 4 +-- module/task/test/model/create.php | 43 +++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/module/task/model.php b/module/task/model.php index 22c22929d9..ac62732b71 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -981,7 +981,7 @@ class taskModel extends model if($execution && $this->isNoStoryExecution($execution)) $requiredFields = str_replace(',story,', ',', $requiredFields); /* Insert task data. */ - $task->isTpl = $execution->isTpl; + if(!empty($execution->isTpl)) $task->isTpl = $execution->isTpl; if(empty($task->assignedTo)) unset($task->assignedDate); $this->dao->insert(TABLE_TASK)->data($task, 'docVersions') ->checkIF($task->estimate != '', 'estimate', 'float') @@ -995,7 +995,7 @@ class taskModel extends model /* Get task id. */ $taskID = $this->dao->lastInsertID(); - if($task->parent) + if(!empty($task->parent)) { $task->id = $taskID; $this->updateParent($task, false); diff --git a/module/task/test/model/create.php b/module/task/test/model/create.php index 003e0468bb..437f15d739 100755 --- a/module/task/test/model/create.php +++ b/module/task/test/model/create.php @@ -14,6 +14,49 @@ title=taskModel->create(); timeout=0 cid=2 +- 测试正常的创建开发任务 + - 属性name @开发任务一 + - 属性execution @2 + - 属性type @devel + - 属性estimate @1 + - 属性version @1 + - 属性estStarted @`^$` + - 属性deadline @`^$` +- 测试正常的创建设计任务 + - 属性name @设计任务一 + - 属性execution @2 + - 属性type @design + - 属性estimate @1 + - 属性version @1 + - 属性estStarted @2023-04-01 + - 属性deadline @`^$` +- 测试正常的创建需求任务 + - 属性name @需求任务一 + - 属性execution @2 + - 属性type @request + - 属性estimate @1 + - 属性version @1 + - 属性estStarted @`^$` + - 属性deadline @2024-01-01 +- 测试正常的创建测试任务 + - 属性name @测试任务一 + - 属性execution @2 + - 属性type @test + - 属性estimate @1 + - 属性version @1 + - 属性estStarted @`^$` + - 属性deadline @`^$` +- 测试正常的创建研究任务 + - 属性name @研究任务一 + - 属性execution @2 + - 属性type @study + - 属性estimate @1 + - 属性version @1 + - 属性estStarted @2023-04-01 + - 属性deadline @2024-01-01 +- 测试正常的创建讨论任务 + + */ $devel = array('execution' => 2, 'name' => '开发任务一', 'type' => 'devel', 'estimate' => 1, 'version' => 1, 'estStarted' => null, 'deadline' => null, 'left' => 1); $design = array('execution' => 2, 'name' => '设计任务一', 'type' => 'design', 'estimate' => 1, 'version' => 1, 'estStarted' => '2023-04-01', 'deadline' => null);