diff --git a/test/class/execution.class.php b/test/class/execution.class.php index f9fb64e5a2..7e57f44f59 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -1600,19 +1600,18 @@ class executionTest } /** - * function fixFirst test by execution + * Function fixFirst test by execution. * * @param string $executionID * @param array $param + * @param string $date * @access public * @return array */ - public function fixFirstTest($executionID, $param = array()) + public function fixFirstTest($executionID, $param = array(), $date) { global $tester; - $date = date('Y-m-d'); - $createFields = array('estimate' => ''); foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; diff --git a/test/model/execution/computeburn.php b/test/model/execution/computeburn.php index 7c51f3e080..bd397542cd 100755 --- a/test/model/execution/computeburn.php +++ b/test/model/execution/computeburn.php @@ -26,7 +26,6 @@ $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'); @@ -35,6 +34,7 @@ $task->estimate->range('1-10'); $task->left->range('1-10'); $task->consumed->range('1-10'); $task->gen(10); + /** title=测试executionModel->computeBurnTest(); diff --git a/test/model/execution/createdefaultsprint.php b/test/model/execution/createdefaultsprint.php index fb06e589d9..433197fabc 100644 --- a/test/model/execution/createdefaultsprint.php +++ b/test/model/execution/createdefaultsprint.php @@ -26,8 +26,8 @@ pid=1 */ -$test = new executionTest(); +$executionTester = new executionTest(); -$result = $test->createDefaultSprintTest(2); +$result = $executionTester->createDefaultSprintTest(2); r($result) && p('') && e('1'); // 创建默认迭代 diff --git a/test/model/execution/fixfirst.php b/test/model/execution/fixfirst.php index 6cdb009d44..4d6cc9c0fe 100755 --- a/test/model/execution/fixfirst.php +++ b/test/model/execution/fixfirst.php @@ -2,27 +2,59 @@ 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('20220112 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20220212 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->fixFirstTest(); cid=1 pid=1 -不传入withLeft >> 26 -敏捷执行更新首日剩余工时 >> 26 +不传入withLeft >> 25 +敏捷执行更新首日剩余工时 >> 5 瀑布执行更新首日剩余工时 >> 17 */ -$executionIDList = array('101', '131'); +$executionIDList = array(3, 4); $scrumEstimate = array('estimate' => '25'); -$withLeft = array('estimate' => '21', 'withLeft' => '1'); +$withLeft = array('estimate' => '5', 'withLeft' => '5'); $waterfallEstimate = array('estimate' => '17', 'withLeft' => '1'); +$date = '2022-01-12'; -$execution = new executionTest(); -r($execution->fixFirstTest($executionIDList[0], $scrumEstimate)) && p('0:estimate') && e('26'); // 不传入withLeft -r($execution->fixFirstTest($executionIDList[0], $withLeft)) && p('0:estimate') && e('26'); // 敏捷执行更新首日剩余工时 -r($execution->fixFirstTest($executionIDList[1], $waterfallEstimate)) && p('0:left') && e('17'); // 瀑布执行更新首日剩余工时 \ No newline at end of file +$executionTester = new executionTest(); +r($executionTester->fixFirstTest($executionIDList[0], $scrumEstimate, $date)) && p('0:estimate') && e('25'); // 不传入withLeft +r($executionTester->fixFirstTest($executionIDList[0], $withLeft, $date)) && p('0:left') && e('5'); // 敏捷执行更新首日剩余工时 +r($executionTester->fixFirstTest($executionIDList[1], $waterfallEstimate, $date)) && p('0:estimate') && e('17'); // 瀑布执行更新首日剩余工时