From d4b5b3c46bcf84956fe9b29f24dd0799e7cff427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E6=B7=91=E6=9D=B0?= Date: Mon, 9 Jan 2023 17:00:38 +0800 Subject: [PATCH] * Add case of execution model. --- test/class/execution.class.php | 9 +---- test/model/execution/getburndataflot.php | 43 ++++++++++++++++++++---- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/test/class/execution.class.php b/test/class/execution.class.php index 826ca804a0..5d0bf300b6 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -1651,15 +1651,8 @@ class executionTest */ public function getBurnDataFlotTest($executionID = 0) { - $date = date("Y-m-d"); $object = $this->objectModel->getBurnDataFlot($executionID, $burnBy = 'left'); - $todayData = array(); - if(isset($object[$date])) - { - foreach($object[$date] as $key => $value) $todayData[$key] = $value; - } - if(dao::isError()) { $error = dao::getError(); @@ -1667,7 +1660,7 @@ class executionTest } else { - return sizeof($todayData); + return $object; } } diff --git a/test/model/execution/getburndataflot.php b/test/model/execution/getburndataflot.php index efae0ee514..4775b9a37f 100755 --- a/test/model/execution/getburndataflot.php +++ b/test/model/execution/getburndataflot.php @@ -2,23 +2,54 @@ gen(5); su('admin'); +$execution = zdTable('project'); +$execution->id->range('1-5'); +$execution->name->range('项目集1,项目1,迭代1,阶段1,看板1'); +$execution->type->range('program,project,sprint,stage,kanban'); +$execution->code->range('1-5')->prefix('code'); +$execution->parent->range('0,1,2{3}'); +$execution->status->range('wait{3},suspended,closed,doing'); +$execution->openedBy->range('admin,user1'); +$execution->begin->range('20220110 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20220220 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +$burn = zdTable('burn'); +$burn->execution->range('3{5},4{5},5{5}'); +$burn->date->range('20220111 000000:1D')->type('timestamp')->format('YY/MM/DD'); +$burn->estimate->range('94.3,56.3,55.3,37.8,33.8'); +$burn->left->range('95.3,68.5,73.9,40.2,36,3'); +$burn->consumed->range('20.1,33.4,41,56.55,59.55'); +$burn->storyPoint->range('0,16.5,16,11.5,9'); +$burn->gen(15); + +$task = zdTable('task'); +$task->id->range('1-10'); +$task->execution->range('3'); +$task->status->range('wait,doing'); +$task->estimate->range('1-10'); +$task->left->range('1-10'); +$task->consumed->range('1-10'); +$task->gen(10); + /** title=测试executionModel->getBurnDataFlotTest(); cid=1 pid=1 -敏捷执行查询统计 >> 3 +敏捷执行查询统计 >> 95.3 瀑布执行查询统计 >> 3 -看板执行查询统计 >> 0 +看板执行查询统计 >> 36 */ -$executionIDList = array('101', '131', '161'); +$executionIDList = array(3, 4, 5); $execution = new executionTest(); -r($execution->getBurnDataFlotTest($executionIDList[0])) && p() && e('3'); // 敏捷执行查询统计 -r($execution->getBurnDataFlotTest($executionIDList[1])) && p() && e('3'); // 瀑布执行查询统计 -r($execution->getBurnDataFlotTest($executionIDList[2])) && p() && e('0'); // 看板执行查询统计 +r(current($execution->getBurnDataFlotTest($executionIDList[0]))) && p('value') && e('95.3'); // 敏捷执行查询统计 +r(current($execution->getBurnDataFlotTest($executionIDList[1]))) && p('value') && e('3'); // 瀑布执行查询统计 +r(current($execution->getBurnDataFlotTest($executionIDList[2]))) && p('value') && e('36'); // 看板执行查询统计