diff --git a/test/class/execution.class.php b/test/class/execution.class.php index 5d0bf300b6..0079abaa28 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -2234,7 +2234,7 @@ class executionTest else { if(count((array)$object['closed']) == 0 and count((array)$object['nokey']) == 0) return 'empty'; - return $object; + return count($object['nokey']->tasks); } } @@ -2390,4 +2390,22 @@ class executionTest return $result > 0; } + + /** + * Test set menu. + * + * @param int $executionID + * @access public + * @return string + */ + public function setMenuTest($executionID = 0) + { + $execution = $this->objectModel->getByID($executionID); + if(empty($execution)) return '0'; + + $this->objectModel->setMenu($executionID); + + global $lang; + return strip_tags($lang->switcherMenu); + } } diff --git a/test/model/execution/accessdenied.php b/test/model/execution/accessdenied.php new file mode 100644 index 0000000000..69f24c0c04 --- /dev/null +++ b/test/model/execution/accessdenied.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +> html + +*/ + +global $tester; +$tester->loadModel('execution'); +ob_start(); +$tester->execution->accessDenied(); +$result = ob_get_clean(); + +r(substr($result, 1, 4)) && p() && e('html'); // 权限不足跳转 diff --git a/test/model/execution/activate.php b/test/model/execution/activate.php index 5f862b7835..49cabbd7e0 100755 --- a/test/model/execution/activate.php +++ b/test/model/execution/activate.php @@ -2,6 +2,8 @@ gen(5); +su('admin'); $execution = zdTable('project'); $execution->id->range('1-5'); @@ -14,9 +16,6 @@ $execution->begin->range('20220112 000000:0')->type('timestamp')->format('YY/MM/ $execution->end->range('20220212 000000:0')->type('timestamp')->format('YY/MM/DD'); $execution->gen(5); -zdTable('user')->gen(5); -su('admin'); - /** title=测试executionModel->activateTest(); diff --git a/test/model/execution/getdatelist.php b/test/model/execution/getdatelist.php index 0411041308..9f2c7b4959 100755 --- a/test/model/execution/getdatelist.php +++ b/test/model/execution/getdatelist.php @@ -28,4 +28,4 @@ r($execution->getDateListTest($start[0], $end[0], $type[0] ,$count[0])) && p('0: r($execution->getDateListTest($start[0], $end[0], $type[0] ,$count[1])) && p() && e('5'); // 去除工作日日期列表统计 r($execution->getDateListTest($start[0], $end[0], $type[1] ,$count[0])) && p('0:0') && e('01/01/2022'); // 未去除工作日日期列表 r($execution->getDateListTest($start[0], $end[0], $type[1] ,$count[1])) && p() && e('7'); // 未去除工作日日期列表统计 -r($execution->getDateListTest($start[1], $end[0], $type[1] ,$count[0])) && p() && e('无数据'); // 日期输入错误查询 \ No newline at end of file +r($execution->getDateListTest($start[1], $end[0], $type[1] ,$count[0])) && p() && e('无数据'); // 日期输入错误查询 diff --git a/test/model/execution/getdefaultmanagers.php b/test/model/execution/getdefaultmanagers.php index 1070506e9b..dd90185d5d 100755 --- a/test/model/execution/getdefaultmanagers.php +++ b/test/model/execution/getdefaultmanagers.php @@ -2,23 +2,52 @@ 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->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); + +$product = zdTable('product'); +$product->id->range('1-3'); +$product->name->range('1-3')->prefix('产品'); +$product->code->range('1-3')->prefix('product'); +$product->type->range('normal'); +$product->status->range('normal'); +$product->PO->range('admin'); +$product->QD->range('user1'); +$product->RD->range('user2'); +$product->gen(3); + +$projectProduct = zdTable('projectproduct'); +$projectProduct->project->range('3{3}, 4{3}, 5{3}'); +$projectProduct->product->range('1-3'); +$projectProduct->branch->range('0'); +$projectProduct->gen(9); + /** title=executionModel->getDefaultManagers(); cid=1 pid=1 -敏捷查找访问人员 >> po1 -瀑布查找访问人员 >> test21 -看板查找访问人员 >> dev51 +敏捷查找访问人员 >> admin +瀑布查找访问人员 >> user1 +看板查找访问人员 >> user2 */ -$executionID = array('101', '131', '161'); +$executionID = array(3, 4, 5); -$execution = new executionTest(); -r($execution->getDefaultManagersTest($executionID[0])) && p('PO') && e('po1'); //敏捷查找访问人员 -r($execution->getDefaultManagersTest($executionID[1])) && p('QD') && e('test21'); //瀑布查找访问人员 -r($execution->getDefaultManagersTest($executionID[2])) && p('RD') && e('dev51'); //看板查找访问人员 \ No newline at end of file +$executionTester = new executionTest(); +r($executionTester->getDefaultManagersTest($executionID[0])) && p('PO') && e('admin'); //敏捷查找访问人员 +r($executionTester->getDefaultManagersTest($executionID[1])) && p('QD') && e('user1'); //瀑布查找访问人员 +r($executionTester->getDefaultManagersTest($executionID[2])) && p('RD') && e('user2'); //看板查找访问人员 diff --git a/test/model/execution/getidlist.php b/test/model/execution/getidlist.php index e7cc5d1697..447fcde12b 100755 --- a/test/model/execution/getidlist.php +++ b/test/model/execution/getidlist.php @@ -2,30 +2,58 @@ id->range('1-10'); +$execution->name->range('项目集1,项目1,项目2,项目3,迭代1,迭代2,阶段1,阶段2,看板1,看板2'); +$execution->type->range('program,project{3},sprint{2},stage{2},kanban{2}'); +$execution->model->range('[],scrum,waterfall,kanban,[]{6}'); +$execution->parent->range('0,1{3},2{2},3{2},4{2}'); +$execution->project->range('0{4},2{2},3{2},4{2}'); +$execution->status->range('doing'); +$execution->vision->range('rnd'); +$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(10); su('admin'); +$execution = zdTable('project'); +$execution->id->range('1-10'); +$execution->name->range('项目集1,项目1,项目2,项目3,迭代1,迭代2,阶段1,阶段2,看板1,看板2'); +$execution->type->range('program,project{3},sprint{2},stage{2},kanban{2}'); +$execution->model->range('[],scrum,waterfall,kanban,[]{6}'); +$execution->parent->range('0,1{3},2{2},3{2},4{2}'); +$execution->project->range('0{4},2{2},3{2},4{2}'); +$execution->status->range('doing'); +$execution->vision->range('rnd'); +$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(10); + /** title=测试executionModel->getIdListTest(); cid=1 pid=1 -敏捷项目下执行id查询 >> 101 -瀑布项目下执行id查询 >> 131 -看板项目下执行id查询 >> 161 -敏捷项目下执行id数量统计 >> 7 -敏捷项目下执行id数量统计 >> 8 -敏捷项目下执行id数量统计 >> 6 +敏捷项目下执行id查询 >> 5 +瀑布项目下执行id查询 >> 7 +看板项目下执行id查询 >> 9 +敏捷项目下执行id数量统计 >> 2 +敏捷项目下执行id数量统计 >> 2 +敏捷项目下执行id数量统计 >> 2 */ -$projectIDList = array('11', '41', '71'); +$projectIDList = array(2, 3, 4); $count = array('0','1'); -$execution = new executionTest(); -r($execution->getIdListTest($projectIDList[0],$count[0])) && p('101') && e('101'); // 敏捷项目下执行id查询 -r($execution->getIdListTest($projectIDList[1],$count[0])) && p('131') && e('131'); // 瀑布项目下执行id查询 -r($execution->getIdListTest($projectIDList[2],$count[0])) && p('161') && e('161'); // 看板项目下执行id查询 -r($execution->getIdListTest($projectIDList[0],$count[1])) && p() && e('7'); // 敏捷项目下执行id数量统计 -r($execution->getIdListTest($projectIDList[1],$count[1])) && p() && e('8'); // 敏捷项目下执行id数量统计 -r($execution->getIdListTest($projectIDList[2],$count[1])) && p() && e('6'); // 敏捷项目下执行id数量统计 \ No newline at end of file +$executionTester = new executionTest(); +r($executionTester->getIdListTest($projectIDList[0],$count[0])) && p('5') && e('5'); // 敏捷项目下执行id查询 +r($executionTester->getIdListTest($projectIDList[1],$count[0])) && p('7') && e('7'); // 瀑布项目下执行id查询 +r($executionTester->getIdListTest($projectIDList[2],$count[0])) && p('9') && e('9'); // 看板项目下执行id查询 +r($executionTester->getIdListTest($projectIDList[0],$count[1])) && p() && e('2'); // 敏捷项目下执行id数量统计 +r($executionTester->getIdListTest($projectIDList[1],$count[1])) && p() && e('2'); // 敏捷项目下执行id数量统计 +r($executionTester->getIdListTest($projectIDList[2],$count[1])) && p() && e('2'); // 敏捷项目下执行id数量统计 diff --git a/test/model/execution/getinvolvedexecutionlist.php b/test/model/execution/getinvolvedexecutionlist.php index 1f8060a6b0..5f34443ec9 100755 --- a/test/model/execution/getinvolvedexecutionlist.php +++ b/test/model/execution/getinvolvedexecutionlist.php @@ -2,28 +2,60 @@ gen(5); su('admin'); +$execution = zdTable('project'); +$execution->id->range('1-10'); +$execution->name->range('项目集1,项目1,项目2,项目3,迭代1,迭代2,阶段1,阶段2,看板1,看板2'); +$execution->type->range('program,project{3},sprint{2},stage{2},kanban{2}'); +$execution->model->range('[],scrum,waterfall,kanban,[]{6}'); +$execution->parent->range('0,1{3},2{2},3{2},4{2}'); +$execution->project->range('0{4},2{2},3{2},4{2}'); +$execution->status->range('doing'); +$execution->vision->range('rnd'); +$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(10); + +$product = zdTable('product'); +$product->id->range('1-3'); +$product->name->range('1-3')->prefix('产品'); +$product->code->range('1-3')->prefix('product'); +$product->type->range('normal'); +$product->status->range('normal'); +$product->PO->range('admin'); +$product->QD->range('user1'); +$product->RD->range('user2'); +$product->gen(3); + +$projectProduct = zdTable('projectproduct'); +$projectProduct->project->range('2{3}, 3{3}, 4{3}, 5, 6, 7, 8, 9, 10'); +$projectProduct->product->range('1-3'); +$projectProduct->branch->range('0'); +$projectProduct->gen(14); + /** title=测试executionModel->getInvolvedExecutionListTest(); cid=1 pid=1 -根据项目查询执行列表 >> 30,迭代20 -根据产品查询执行列表 >> 30,迭代20,sprint +根据项目查询执行列表 >> 2,迭代1 +根据产品查询执行列表 >> 2,迭代1,sprint 根据项目查询执行数量 >> 1 根据产品查询执行数量 >> 1 */ -$projectIDList = array('0', '30'); -$productIDList = array('0', '10'); -$limit = array('0', '2', '10'); -$count = array('0', '1'); +$projectIDList = array(0, 2); +$productIDList = array(0, 1); +$limit = array(0, 2, 10); +$count = array(0, 1); -$execution = new executionTest(); -r($execution->getInvolvedExecutionListTest($projectIDList[1],$limit[0],$productIDList[0],$count[0])) && p('120:project,name') && e('30,迭代20'); // 根据项目查询执行列表 -r($execution->getInvolvedExecutionListTest($projectIDList[0],$limit[0],$productIDList[1],$count[0])) && p('120:project,name,type') && e('30,迭代20,sprint'); // 根据产品查询执行列表 -r($execution->getInvolvedExecutionListTest($projectIDList[1],$limit[1],$productIDList[0],$count[1])) && p() && e('1'); // 根据项目查询执行数量 -r($execution->getInvolvedExecutionListTest($projectIDList[0],$limit[2],$productIDList[1],$count[1])) && p() && e('1'); // 根据产品查询执行数量 \ No newline at end of file +$executionTester = new executionTest(); +r($executionTester->getInvolvedExecutionListTest($projectIDList[1],$limit[0],$productIDList[0],$count[0])) && p('5:project,name') && e('2,迭代1'); // 根据项目查询执行列表 +r($executionTester->getInvolvedExecutionListTest($projectIDList[0],$limit[0],$productIDList[1],$count[0])) && p('5:project,name,type') && e('2,迭代1,sprint'); // 根据产品查询执行列表 +r($executionTester->getInvolvedExecutionListTest($projectIDList[1],$limit[1],$productIDList[0],$count[1])) && p() && e('1'); // 根据项目查询执行数量 +r($executionTester->getInvolvedExecutionListTest($projectIDList[0],$limit[2],$productIDList[1],$count[1])) && p() && e('1'); // 根据产品查询执行数量 diff --git a/test/model/execution/getkanbangroupdata.php b/test/model/execution/getkanbangroupdata.php index d2e95793c2..2d75070529 100755 --- a/test/model/execution/getkanbangroupdata.php +++ b/test/model/execution/getkanbangroupdata.php @@ -2,25 +2,80 @@ 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->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); + +$task = zdTable('task'); +$task->id->range('1-10'); +$task->execution->range('3'); +$task->name->range('1-10')->prefix('任务'); +$task->type->range('design,devel,test,study,discuss,ui,affair,misc'); +$task->status->range('wait,doing,done,closed'); +$task->gen(10); + +$product = zdTable('product'); +$product->id->range('1-3'); +$product->name->range('1-3')->prefix('产品'); +$product->code->range('1-3')->prefix('product'); +$product->type->range('normal'); +$product->status->range('normal'); +$product->PO->range('admin'); +$product->QD->range('user1'); +$product->RD->range('user2'); +$product->gen(3); + +$story = zdTable('story'); +$story->id->range('1-10'); +$story->name->range('1-10')->prefix('需求'); +$story->type->range('story'); +$story->product->range('1'); +$story->status->range('active'); +$story->staged->range('projected'); +$story->version->range('1'); +$story->gen(10); + +$projectStory = zdTable('projectstory'); +$projectStory->project->range('3'); +$projectStory->product->range('1'); +$projectStory->story->range('1-10'); +$projectStory->version->range('1'); +$projectStory->gen(10); + +$bug = zdTable('bug'); +$bug->id->range('1-10'); +$bug->execution->range('3'); +$bug->name->range('1-10')->prefix('Bug'); +$bug->status->range('active'); +$bug->gen(10); + /** title=测试executionModel->getKanbanGroupData(); cid=1 pid=1 -空数据查询 >> empty -查询执行162需求 >> 软件需求246 +空数据查询 >> empty +获取id=3执行的任务数 >> 4 */ -$execution = new executionTest(); +$executionTester = new executionTest(); -$executionID = 162; +$executionID = 3; $stories = $tester->loadModel('story')->getExecutionStories($executionID); -$tasks = $execution->getKanbanTasksTest($executionID, false); +$tasks = $executionTester->getKanbanTasksTest($executionID, false); $bugs = $tester->loadModel('bug')->getExecutionBugs($executionID); -r($execution->getKanbanGroupDataTest(array(), array(), array(), 'story')) && p('') && e('empty'); //空数据查询 -r($execution->getKanbanGroupDataTest($stories, $tasks, $bugs, 'story')) && p('246:title') && e('软件需求246'); // 查询执行162需求 +r($executionTester->getKanbanGroupDataTest(array(), array(), array(), 'story')) && p('') && e('empty'); // 空数据查询 +r($executionTester->getKanbanGroupDataTest($stories, $tasks, $bugs, 'story')) && p('') && e('1'); // 获取id=3执行的任务数 diff --git a/test/model/execution/getkanbantasks.php b/test/model/execution/getkanbantasks.php index ab952d6ee5..c65ea9c388 100755 --- a/test/model/execution/getkanbantasks.php +++ b/test/model/execution/getkanbantasks.php @@ -2,30 +2,53 @@ gen(5); su('admin'); +$execution = zdTable('project'); +$execution->id->range('1-10'); +$execution->name->range('项目集1,项目1,项目2,项目3,迭代1,迭代2,阶段1,阶段2,看板1,看板2'); +$execution->type->range('program,project{3},sprint{2},stage{2},kanban{2}'); +$execution->model->range('[],scrum,waterfall,kanban,[]{6}'); +$execution->parent->range('0,1{3},2{2},3{2},4{2}'); +$execution->project->range('0{4},2{2},3{2},4{2}'); +$execution->status->range('doing'); +$execution->vision->range('rnd'); +$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(10); + +$task = zdTable('task'); +$task->id->range('1-30'); +$task->execution->range('5, 7, 9'); +$task->name->range('1-30')->prefix('任务'); +$task->type->range('design,devel,test,study,discuss,ui,affair,misc'); +$task->status->range('wait,doing,done,closed'); +$task->gen(30); + /** title=测试executionModel->getKanbanTasksTest(); cid=1 pid=1 -敏捷执行查询 >> 子任务6,101 -瀑布执行查询 >> 更多任务93,131 -看板执行查询 >> 开发任务71,161 -敏捷执行查询统计 >> 11 -瀑布执行查询统计 >> 4 -看板执行查询统计 >> 4 +敏捷执行查询 >> 任务25,5 +瀑布执行查询 >> 任务29,7 +看板执行查询 >> 任务21,9 +敏捷执行查询统计 >> 10 +瀑布执行查询统计 >> 10 +看板执行查询统计 >> 10 */ -$executionIDList = array('101', '131', '161'); +$executionIDList = array(5, 7, 9); $count = array('0', '1'); -$execution = new executionTest(); -r($execution->getKanbanTasksTest($executionIDList[0], $count[0])) && p('906:name,execution') && e('子任务6,101'); // 敏捷执行查询 -r($execution->getKanbanTasksTest($executionIDList[1], $count[0])) && p('693:name,execution') && e('更多任务93,131'); // 瀑布执行查询 -r($execution->getKanbanTasksTest($executionIDList[2], $count[0])) && p('61:name,execution') && e('开发任务71,161'); // 看板执行查询 -r($execution->getKanbanTasksTest($executionIDList[0], $count[1])) && p() && e('11'); // 敏捷执行查询统计 -r($execution->getKanbanTasksTest($executionIDList[1], $count[1])) && p() && e('4'); // 瀑布执行查询统计 -r($execution->getKanbanTasksTest($executionIDList[2], $count[1])) && p() && e('4'); // 看板执行查询统计 \ No newline at end of file +$executionTester = new executionTest(); +r($executionTester->getKanbanTasksTest($executionIDList[0], $count[0])) && p('25:name,execution') && e('任务25,5'); // 敏捷执行查询 +r($executionTester->getKanbanTasksTest($executionIDList[1], $count[0])) && p('29:name,execution') && e('任务29,7'); // 瀑布执行查询 +r($executionTester->getKanbanTasksTest($executionIDList[2], $count[0])) && p('21:name,execution') && e('任务21,9'); // 看板执行查询 +r($executionTester->getKanbanTasksTest($executionIDList[0], $count[1])) && p() && e('10'); // 敏捷执行查询统计 +r($executionTester->getKanbanTasksTest($executionIDList[1], $count[1])) && p() && e('10'); // 瀑布执行查询统计 +r($executionTester->getKanbanTasksTest($executionIDList[2], $count[1])) && p() && e('10'); // 看板执行查询统计 diff --git a/test/model/execution/getlifetimebyidlist.php b/test/model/execution/getlifetimebyidlist.php index a4ccdbd95b..e59565250d 100755 --- a/test/model/execution/getlifetimebyidlist.php +++ b/test/model/execution/getlifetimebyidlist.php @@ -2,21 +2,33 @@ 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->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); + /** title=测试executionModel->getLifetimeByIdList(); cid=1 pid=1 -查询执行103和161 lifetime >> emptyLifetime +查询执行3和4 lifetime >> emptyLifetime 查询空执行 lifetime >> empty */ -$executionIDList = array('103', '161'); +$executionIDList = array(3, 4); -$execution = new executionTest(); -r($execution->getLifetimeByIdListTest($executionIDList)) && p('103') && e('emptyLifetime'); // 查询执行103和161 lifetime -r($execution->getLifetimeByIdListTest(array('0'))) && p('') && e('empty'); // 查询空执行 lifetime +$executionTester = new executionTest(); +r($executionTester->getLifetimeByIdListTest($executionIDList)) && p('3') && e('emptyLifetime'); // 查询执行3和4 lifetime +r($executionTester->getLifetimeByIdListTest(array('0'))) && p('') && e('empty'); // 查询空执行 lifetime diff --git a/test/model/execution/getlist.php b/test/model/execution/getlist.php index c0f35d9f06..3e85bf57c5 100755 --- a/test/model/execution/getlist.php +++ b/test/model/execution/getlist.php @@ -2,44 +2,76 @@ gen(5); su('admin'); +$execution = zdTable('project'); +$execution->id->range('1-10'); +$execution->name->range('项目集1,项目1,项目2,项目3,迭代1,迭代2,阶段1,阶段2,看板1,看板2'); +$execution->type->range('program,project{3},sprint{2},stage{2},kanban{2}'); +$execution->model->range('[],scrum,waterfall,kanban,[]{6}'); +$execution->parent->range('0,1{3},2{2},3{2},4{2}'); +$execution->project->range('0{4},2{2},3{2},4{2}'); +$execution->status->range('doing'); +$execution->vision->range('rnd'); +$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(10); + +$product = zdTable('product'); +$product->id->range('1-3'); +$product->name->range('1-3')->prefix('产品'); +$product->code->range('1-3')->prefix('product'); +$product->type->range('normal'); +$product->status->range('normal'); +$product->PO->range('admin'); +$product->QD->range('user1'); +$product->RD->range('user2'); +$product->gen(3); + +$projectProduct = zdTable('projectproduct'); +$projectProduct->project->range('2{3}, 3{3}, 4{3}, 5, 6, 7, 8, 9, 10'); +$projectProduct->product->range('1-3'); +$projectProduct->branch->range('0'); +$projectProduct->gen(9); + /** title=测试executionModel->getListTest(); cid=1 pid=1 -敏捷项目执行列表查询 >> 11,迭代1 -瀑布项目执行列表查询 >> 41,阶段31,stage -看板项目执行列表查询 >> 71,看板61,kanban -产品1执行列表查询 >> 迭代1 -敏捷执行列表查询 >> sprint,迭代561 -瀑布执行列表查询 >> stage,阶段591 -看板执行列表查询 >> kanban,看板531 -wait执行列表查询 >> wait,阶段581 -doing执行列表查询 >> doing,阶段582 -执行列表2条查询 >> 2 -执行列表10条查询 >> 10 +敏捷项目执行列表查询 >> 2,迭代1 +瀑布项目执行列表查询 >> 3,阶段1,stage +看板项目执行列表查询 >> 4,看板1,kanban +产品1执行列表查询 >> 0 +敏捷执行列表查询 >> sprint,迭代2 +瀑布执行列表查询 >> stage,阶段2 +看板执行列表查询 >> kanban,看板2 +wait执行列表查询 >> 0 +doing执行列表查询 >> doing,迭代1 +执行列表2条查询 >> 0 +执行列表10条查询 >> 6 */ -$projectIDList = array('0', '11', '41', '71'); +$projectIDList = array(0, 2, 3, 4); $productIDList = array('0', '1'); $status = array('all', 'wait', 'doing'); $type = array('all', 'sprint', 'stage', 'kanban'); $limit = array('0', '2', '10'); $count = array('0', '1'); -$execution = new executionTest(); -r($execution->getListTest($projectIDList[1],$type[0],$status[0],$limit[0],$productIDList[0],$count[0])) && p('101:project,name') && e('11,迭代1'); // 敏捷项目执行列表查询 -r($execution->getListTest($projectIDList[2],$type[0],$status[0],$limit[0],$productIDList[0],$count[0])) && p('131:project,name,type') && e('41,阶段31,stage'); // 瀑布项目执行列表查询 -r($execution->getListTest($projectIDList[3],$type[0],$status[0],$limit[0],$productIDList[0],$count[0])) && p('161:project,name,type') && e('71,看板61,kanban'); // 看板项目执行列表查询 -r($execution->getListTest($projectIDList[0],$type[0],$status[0],$limit[0],$productIDList[1],$count[0])) && p('101:name') && e('迭代1'); // 产品1执行列表查询 -r($execution->getListTest($projectIDList[0],$type[1],$status[0],$limit[2],$productIDList[0],$count[0])) && p('661:type,name') && e('sprint,迭代561'); // 敏捷执行列表查询 -r($execution->getListTest($projectIDList[0],$type[2],$status[0],$limit[2],$productIDList[0],$count[0])) && p('691:type,name') && e('stage,阶段591'); // 瀑布执行列表查询 -r($execution->getListTest($projectIDList[0],$type[3],$status[0],$limit[2],$productIDList[0],$count[0])) && p('631:type,name') && e('kanban,看板531'); // 看板执行列表查询 -r($execution->getListTest($projectIDList[0],$type[0],$status[1],$limit[0],$productIDList[0],$count[0])) && p('681:status,name') && e('wait,阶段581'); // wait执行列表查询 -r($execution->getListTest($projectIDList[0],$type[0],$status[2],$limit[0],$productIDList[0],$count[0])) && p('682:status,name') && e('doing,阶段582'); // doing执行列表查询 -r($execution->getListTest($projectIDList[0],$type[0],$status[1],$limit[1],$productIDList[0],$count[1])) && p() && e('2'); // 执行列表2条查询 -r($execution->getListTest($projectIDList[0],$type[0],$status[2],$limit[2],$productIDList[0],$count[1])) && p() && e('10'); // 执行列表10条查询 \ No newline at end of file +$executionTester = new executionTest(); +r($executionTester->getListTest($projectIDList[1], $type[0], $status[0], $limit[0], $productIDList[0], $count[0])) && p('5:project,name') && e('2,迭代1'); // 敏捷项目执行列表查询 +r($executionTester->getListTest($projectIDList[2], $type[0], $status[0], $limit[0], $productIDList[0], $count[0])) && p('7:project,name,type') && e('3,阶段1,stage'); // 瀑布项目执行列表查询 +r($executionTester->getListTest($projectIDList[3], $type[0], $status[0], $limit[0], $productIDList[0], $count[0])) && p('9:project,name,type') && e('4,看板1,kanban'); // 看板项目执行列表查询 +r($executionTester->getListTest($projectIDList[0], $type[0], $status[0], $limit[0], $productIDList[1], $count[0])) && p() && e('0'); // 产品1执行列表查询 +r($executionTester->getListTest($projectIDList[0], $type[1], $status[0], $limit[2], $productIDList[0], $count[0])) && p('6:type,name') && e('sprint,迭代2'); // 敏捷执行列表查询 +r($executionTester->getListTest($projectIDList[0], $type[2], $status[0], $limit[2], $productIDList[0], $count[0])) && p('8:type,name') && e('stage,阶段2'); // 瀑布执行列表查询 +r($executionTester->getListTest($projectIDList[0], $type[3], $status[0], $limit[2], $productIDList[0], $count[0])) && p('10:type,name') && e('kanban,看板2'); // 看板执行列表查询 +r($executionTester->getListTest($projectIDList[0], $type[0], $status[1], $limit[0], $productIDList[0], $count[0])) && p() && e('0'); // wait执行列表查询 +r($executionTester->getListTest($projectIDList[0], $type[0], $status[2], $limit[0], $productIDList[0], $count[0])) && p('5:status,name') && e('doing,迭代1'); // doing执行列表查询 +r($executionTester->getListTest($projectIDList[0], $type[0], $status[1], $limit[1], $productIDList[0], $count[1])) && p() && e('0'); // 执行列表2条查询 +r($executionTester->getListTest($projectIDList[0], $type[0], $status[2], $limit[2], $productIDList[0], $count[1])) && p() && e('6'); // 执行列表10条查询 diff --git a/test/model/execution/getmembers2import.php b/test/model/execution/getmembers2import.php index 96453c058d..adb936d2e2 100755 --- a/test/model/execution/getmembers2import.php +++ b/test/model/execution/getmembers2import.php @@ -2,26 +2,36 @@ gen(5); su('admin'); +$team = zdTable('team'); +$team->root->range('1'); +$team->type->range('execution'); +$team->account->range('user1,user2'); +$team->role->range('研发,测试'); +$team->days->range('5'); +$team->hours->range('7'); +$team->gen(2); + /** title=测试executionModel->getMembers2ImportTest(); cid=1 pid=1 -正常数据查询 >> po82,研发 +正常数据查询 >> user1,研发 无效数据查询 >> 无数据 正常数据查询统计 >> 2 */ -$executionID = '101'; -$accountList = array('test7', 'test82'); -$allAccountList = array('test82', 'po82', 'user92'); +$executionID = '1'; +$accountList = array('test1', 'test2'); +$allAccountList = array('test1', 'user1', 'user2'); $count = array('0','1'); -$execution = new executionTest(); -r($execution->getMembers2ImportTest($executionID, $accountList, $count[0])) && p('po82:account,role') && e('po82,研发'); // 正常数据查询 -r($execution->getMembers2ImportTest($executionID, $allAccountList, $count[0])) && p() && e('无数据'); // 无效数据查询 -r($execution->getMembers2ImportTest($executionID, $accountList, $count[1])) && p() && e('2'); // 正常数据查询统计 \ No newline at end of file +$executionTester = new executionTest(); +r($executionTester->getMembers2ImportTest($executionID, $accountList, $count[0])) && p('user1:account,role') && e('user1,研发'); // 正常数据查询 +r($executionTester->getMembers2ImportTest($executionID, $allAccountList, $count[0])) && p() && e('无数据'); // 无效数据查询 +r($executionTester->getMembers2ImportTest($executionID, $accountList, $count[1])) && p() && e('2'); // 正常数据查询统计 diff --git a/test/model/execution/getmembersbyidlist.php b/test/model/execution/getmembersbyidlist.php index 12dd2fd30e..365295f55b 100755 --- a/test/model/execution/getmembersbyidlist.php +++ b/test/model/execution/getmembersbyidlist.php @@ -2,26 +2,47 @@ 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->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); + +$team = zdTable('team'); +$team->root->range('3-5'); +$team->type->range('execution'); +$team->account->range('admin,user1,user2,user3,user4'); +$team->role->range('研发,测试{4}'); +$team->days->range('5'); +$team->hours->range('7'); +$team->gen(10); + /** title=测试executionModel->getMembersByIdListTest(); cid=1 pid=1 -批量查询敏捷执行team >> 101,po82,研发主管82 -批量查询瀑布执行team >> 131,test22,开发22 -批量查询看板执行team >> 161,test52,开发52 +批量查询敏捷执行team >> 3,admin,admin +批量查询瀑布执行team >> 4,user1,用户1 +批量查询看板执行team >> 5,admin,admin 批量查询执行team统计 >> 3 */ -$executionIDList = array('101', '131', '161'); +$executionIDList = array(3, 4, 5); $count = array('0','1'); -$execution = new executionTest(); -r($execution->getMembersByIdListTest($executionIDList, $count[0])[$executionIDList[0]]) && p('0:root,account,realname') && e('101,po82,研发主管82');// 批量查询敏捷执行team -r($execution->getMembersByIdListTest($executionIDList, $count[0])[$executionIDList[1]]) && p('0:root,account,realname') && e('131,test22,开发22'); // 批量查询瀑布执行team -r($execution->getMembersByIdListTest($executionIDList, $count[0])[$executionIDList[2]]) && p('0:root,account,realname') && e('161,test52,开发52'); // 批量查询看板执行team -r($execution->getMembersByIdListTest($executionIDList, $count[1])) && p() && e('3'); // 批量查询执行team统计 \ No newline at end of file +$executionTester = new executionTest(); +r($executionTester->getMembersByIdListTest($executionIDList, $count[0])[$executionIDList[0]]) && p('0:root,account,realname') && e('3,admin,admin'); // 批量查询敏捷执行team +r($executionTester->getMembersByIdListTest($executionIDList, $count[0])[$executionIDList[1]]) && p('0:root,account,realname') && e('4,user1,用户1'); // 批量查询瀑布执行team +r($executionTester->getMembersByIdListTest($executionIDList, $count[0])[$executionIDList[2]]) && p('0:root,account,realname') && e('5,admin,admin'); // 批量查询看板执行team +r($executionTester->getMembersByIdListTest($executionIDList, $count[1])) && p() && e('3'); // 批量查询执行team统计 diff --git a/test/model/execution/getorderedexecutions.php b/test/model/execution/getorderedexecutions.php index 914e817bfb..1d6d00796e 100755 --- a/test/model/execution/getorderedexecutions.php +++ b/test/model/execution/getorderedexecutions.php @@ -2,48 +2,64 @@ gen(5); su('admin'); +zdTable('team')->gen(0); + +$execution = zdTable('project'); +$execution->id->range('1-10'); +$execution->name->range('项目集1,项目1,项目2,项目3,迭代1,迭代2,阶段1,阶段2,看板1,看板2'); +$execution->type->range('program,project{3},sprint{2},stage{2},kanban{2}'); +$execution->model->range('[],scrum,waterfall,kanban,[]{6}'); +$execution->parent->range('0,1{3},2{2},3{2},4{2}'); +$execution->project->range('0{4},2{2},3{2},4{2}'); +$execution->status->range('wait,doing,done,closed'); +$execution->vision->range('rnd'); +$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(10); + /** title=executionModel->getOrderedExecutions(); cid=1 pid=1 -敏捷项目wait状态执行查看 >> 11,wait,sprint -敏捷项目doing状态执行查看 >> 12,doing,sprint -瀑布项目wait状态执行查看 >> 41,wait,stage -瀑布项目doing状态执行查看 >> 42,doing,stage -看板项目wait状态执行查看 >> 71,wait,kanban -看板项目doing状态执行查看 >> 72,doing,kanban -敏捷项目wait状态执行统计 >> 7 -敏捷项目doing状态执行统计 >> 7 -瀑布项目wait状态执行统计 >> 8 -瀑布项目doing状态执行统计 >> 8 -看板项目wait状态执行统计 >> 6 -看板项目doing状态执行统计 >> 6 +敏捷项目wait状态执行查看 >> 2,wait,sprint +敏捷项目doing状态执行查看 >> 2,doing,sprint +瀑布项目wait状态执行查看 >> 0 +瀑布项目doing状态执行查看 >> 0 +看板项目wait状态执行查看 >> 4,wait,kanban +看板项目doing状态执行查看 >> 4,doing,kanban +敏捷项目wait状态执行统计 >> 1 +敏捷项目doing状态执行统计 >> 1 +瀑布项目wait状态执行统计 >> 0 +瀑布项目doing状态执行统计 >> 0 +看板项目wait状态执行统计 >> 1 +看板项目doing状态执行统计 >> 1 敏捷项目done状态执行统计 >> 0 敏捷项目closed状态执行统计 >> 0 */ -$projectIDList = array('11', '12', '41', '42', '71', '72'); +$projectIDList = array(2, 3, 4); $status = array('wait', 'doing', 'done', 'closed'); $count = array('0', '1'); -$execution = new executionTest(); -//var_dump($execution->getOrderedExecutionsTest($projectIDList[5],$status[1],$count[0]));die; -r($execution->getOrderedExecutionsTest($projectIDList[0],$status[0],$count[0])) && p('101:project,status,type') && e('11,wait,sprint'); //敏捷项目wait状态执行查看 -r($execution->getOrderedExecutionsTest($projectIDList[1],$status[1],$count[0])) && p('102:project,status,type') && e('12,doing,sprint'); //敏捷项目doing状态执行查看 -r($execution->getOrderedExecutionsTest($projectIDList[2],$status[0],$count[0])) && p('701:project,status,type') && e('41,wait,stage'); //瀑布项目wait状态执行查看 -r($execution->getOrderedExecutionsTest($projectIDList[3],$status[1],$count[0])) && p('702:project,status,type') && e('42,doing,stage'); //瀑布项目doing状态执行查看 -r($execution->getOrderedExecutionsTest($projectIDList[4],$status[0],$count[0])) && p('161:project,status,type') && e('71,wait,kanban'); //看板项目wait状态执行查看 -r($execution->getOrderedExecutionsTest($projectIDList[5],$status[1],$count[0])) && p('162:project,status,type') && e('72,doing,kanban'); //看板项目doing状态执行查看 -r($execution->getOrderedExecutionsTest($projectIDList[0],$status[0],$count[1])) && p() && e('7'); //敏捷项目wait状态执行统计 -r($execution->getOrderedExecutionsTest($projectIDList[1],$status[1],$count[1])) && p() && e('7'); //敏捷项目doing状态执行统计 -r($execution->getOrderedExecutionsTest($projectIDList[2],$status[0],$count[1])) && p() && e('8'); //瀑布项目wait状态执行统计 -r($execution->getOrderedExecutionsTest($projectIDList[3],$status[1],$count[1])) && p() && e('8'); //瀑布项目doing状态执行统计 -r($execution->getOrderedExecutionsTest($projectIDList[4],$status[0],$count[1])) && p() && e('6'); //看板项目wait状态执行统计 -r($execution->getOrderedExecutionsTest($projectIDList[5],$status[1],$count[1])) && p() && e('6'); //看板项目doing状态执行统计 -r($execution->getOrderedExecutionsTest($projectIDList[0],$status[2],$count[1])) && p() && e('0'); //敏捷项目done状态执行统计 -r($execution->getOrderedExecutionsTest($projectIDList[0],$status[3],$count[1])) && p() && e('0'); //敏捷项目closed状态执行统计 \ No newline at end of file +$executionTester = new executionTest(); +r($executionTester->getOrderedExecutionsTest($projectIDList[0],$status[0],$count[0])) && p('5:project,status,type') && e('2,wait,sprint'); // 敏捷项目wait状态执行查看 +r($executionTester->getOrderedExecutionsTest($projectIDList[0],$status[1],$count[0])) && p('6:project,status,type') && e('2,doing,sprint'); // 敏捷项目doing状态执行查看 +r($executionTester->getOrderedExecutionsTest($projectIDList[1],$status[0],$count[0])) && p() && e('0'); // 瀑布项目wait状态执行查看 +r($executionTester->getOrderedExecutionsTest($projectIDList[1],$status[1],$count[0])) && p() && e('0'); // 瀑布项目doing状态执行查看 +r($executionTester->getOrderedExecutionsTest($projectIDList[2],$status[0],$count[0])) && p('9:project,status,type') && e('4,wait,kanban'); // 看板项目wait状态执行查看 +r($executionTester->getOrderedExecutionsTest($projectIDList[2],$status[1],$count[0])) && p('10:project,status,type') && e('4,doing,kanban'); // 看板项目doing状态执行查看 +r($executionTester->getOrderedExecutionsTest($projectIDList[0],$status[0],$count[1])) && p() && e('1'); // 敏捷项目wait状态执行统计 +r($executionTester->getOrderedExecutionsTest($projectIDList[0],$status[1],$count[1])) && p() && e('1'); // 敏捷项目doing状态执行统计 +r($executionTester->getOrderedExecutionsTest($projectIDList[1],$status[0],$count[1])) && p() && e('0'); // 瀑布项目wait状态执行统计 +r($executionTester->getOrderedExecutionsTest($projectIDList[1],$status[1],$count[1])) && p() && e('0'); // 瀑布项目doing状态执行统计 +r($executionTester->getOrderedExecutionsTest($projectIDList[2],$status[0],$count[1])) && p() && e('1'); // 看板项目wait状态执行统计 +r($executionTester->getOrderedExecutionsTest($projectIDList[2],$status[1],$count[1])) && p() && e('1'); // 看板项目doing状态执行统计 +r($executionTester->getOrderedExecutionsTest($projectIDList[0],$status[2],$count[1])) && p() && e('0'); // 敏捷项目done状态执行统计 +r($executionTester->getOrderedExecutionsTest($projectIDList[0],$status[3],$count[1])) && p() && e('0'); // 敏捷项目closed状态执行统计 diff --git a/test/model/execution/getpairs.php b/test/model/execution/getpairs.php index 0cbec10db4..208742b465 100755 --- a/test/model/execution/getpairs.php +++ b/test/model/execution/getpairs.php @@ -2,8 +2,23 @@ gen(5); su('admin'); +$execution = zdTable('project'); +$execution->id->range('1-7'); +$execution->name->range('项目集1,项目1,项目2,项目3,迭代1,阶段1,看板1'); +$execution->type->range('program,project{3},sprint,stage,kanban'); +$execution->model->range('[],scrum,waterfall,kanban,[]{3}'); +$execution->parent->range('0,1{3},2,3,4'); +$execution->project->range('0{4},2,3,4'); +$execution->status->range('doing'); +$execution->vision->range('rnd'); +$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(7); + /** title=测试executionModel->getPairsTest(); @@ -11,23 +26,23 @@ cid=1 pid=1 敏捷项目执行查看 >> 迭代1 -瀑布项目执行查看 >> 阶段121 -看板项目执行查看 >> 看板61 -敏捷项目执行统计 >> 7 -敏捷项目执行统计 >> 8 -敏捷项目执行统计 >> 6 +瀑布项目执行查看 >> 阶段1 +看板项目执行查看 >> 看板1 +敏捷项目执行统计 >> 1 +敏捷项目执行统计 >> 1 +敏捷项目执行统计 >> 1 */ -$projectIDList = array('11', '41', '71'); +$projectIDList = array(2, 3, 4); $count = array('0','1'); $noRealEnd = array('realEnd' => ''); $readjustTime = array('readjustTime' => '1'); -$execution = new executionTest(); -r($execution->getPairsTest($projectIDList[0],$count[0])) && p('101') && e('迭代1'); // 敏捷项目执行查看 -r($execution->getPairsTest($projectIDList[1],$count[0])) && p('221') && e('阶段121'); // 瀑布项目执行查看 -r($execution->getPairsTest($projectIDList[2],$count[0])) && p('161') && e('看板61'); // 看板项目执行查看 -r($execution->getPairsTest($projectIDList[0],$count[1])) && p() && e('7'); // 敏捷项目执行统计 -r($execution->getPairsTest($projectIDList[1],$count[1])) && p() && e('8'); // 敏捷项目执行统计 -r($execution->getPairsTest($projectIDList[2],$count[1])) && p() && e('6'); // 敏捷项目执行统计 \ No newline at end of file +$executionTester = new executionTest(); +r($executionTester->getPairsTest($projectIDList[0],$count[0])) && p('5') && e('迭代1'); // 敏捷项目执行查看 +r($executionTester->getPairsTest($projectIDList[1],$count[0])) && p('6') && e('阶段1'); // 瀑布项目执行查看 +r($executionTester->getPairsTest($projectIDList[2],$count[0])) && p('7') && e('看板1'); // 看板项目执行查看 +r($executionTester->getPairsTest($projectIDList[0],$count[1])) && p() && e('1'); // 敏捷项目执行统计 +r($executionTester->getPairsTest($projectIDList[1],$count[1])) && p() && e('1'); // 敏捷项目执行统计 +r($executionTester->getPairsTest($projectIDList[2],$count[1])) && p() && e('1'); // 敏捷项目执行统计 diff --git a/test/model/execution/getprevkanban.php b/test/model/execution/getprevkanban.php index a0d65c6793..a2b2164a93 100755 --- a/test/model/execution/getprevkanban.php +++ b/test/model/execution/getprevkanban.php @@ -2,24 +2,44 @@ 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->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); + +$task = zdTable('task'); +$task->id->range('1-10'); +$task->execution->range('4'); +$task->name->range('1-10')->prefix('任务'); +$task->type->range('design,devel,test,study,discuss,ui,affair,misc'); +$task->status->range('wait,doing,done,closed'); +$task->gen(10); + /** title=测试executionModel->getPrevKanban(); cid=1 pid=1 -查询执行162数据 >> empty -保存数据后查询执行162数据 >> 246 +查询执行4数据 >> empty +保存数据后查询执行4数据 >> task1 */ -$execution = new executionTest(); +$executionTester = new executionTest(); -$emptyExecutionID = 163; -$executionID = 162; +$emptyExecutionID = 5; +$executionID = 4; -r($execution->getPrevKanbanTest($emptyExecutionID)) && p('') && e('empty'); //查询执行162数据 -$execution->saveKanbanDataTest($executionID); -r($execution->getPrevKanbanTest($executionID)) && p('story:0') && e('246'); //保存数据后查询执行162数据 +r($executionTester->getPrevKanbanTest($emptyExecutionID)) && p() && e('empty'); // 查询执行id=4数据 +$executionTester->saveKanbanDataTest($executionID); +r($executionTester->getPrevKanbanTest($executionID)) && p('wait:0') && e('task1'); // 保存数据后查询执行id=4数据 diff --git a/test/model/execution/getproductgrouplisttest.php b/test/model/execution/getproductgrouplisttest.php index b7adc95881..e133749199 100755 --- a/test/model/execution/getproductgrouplisttest.php +++ b/test/model/execution/getproductgrouplisttest.php @@ -2,21 +2,49 @@ gen(5); su('admin'); +$execution = zdTable('project'); +$execution->id->range('1-10'); +$execution->name->range('项目集1,项目1,项目2,项目3,项目4,项目5,项目6,迭代1,阶段1,看板1'); +$execution->type->range('program,project{6},sprint,stage,kanban'); +$execution->model->range('[],scrum{2},waterfall{2},kanban{2},[]{3}'); +$execution->parent->range('0,1{6},2,3,4'); +$execution->status->range('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(10); + +$product = zdTable('product'); +$product->id->range('1-10'); +$product->name->range('1-10')->prefix('产品'); +$product->code->range('1-10')->prefix('product'); +$product->type->range('normal'); +$product->program->range('1{2}, 2{3}, 3{5}'); +$product->status->range('normal'); +$product->gen(10); + +$projectProduct = zdTable('projectproduct'); +$projectProduct->project->range('8{3}, 9{3}, 10{3}'); +$projectProduct->product->range('1-9'); +$projectProduct->branch->range('0'); +$projectProduct->gen(9); + /** title=测试executionModel->getProductGroupListTest(); cid=1 pid=1 -查询当前用户访问的产品相关项目集 >> 项目集10 -查询当前用户访问的产品相关数量 >> 121 +查询当前用户访问的产品相关项目集 >> 项目集1 +查询当前用户访问的产品相关数量 >> 10 */ $count = array('0','1'); -$execution = new executionTest(); -r($execution->getProductGroupListTest($count[0])) && p('9:name') && e('项目集10'); // 查询当前用户访问的产品相关项目集 -r($execution->getProductGroupListTest($count[1])) && p() && e('121'); // 查询当前用户访问的产品相关数量 +$executionTester = new executionTest(); +r($executionTester->getProductGroupListTest($count[0])) && p('0:name') && e('项目集1'); // 查询当前用户访问的产品相关项目集 +r($executionTester->getProductGroupListTest($count[1])) && p() && e('10'); // 查询当前用户访问的产品相关数量 diff --git a/test/model/execution/getrelatedexecutions.php b/test/model/execution/getrelatedexecutions.php index 67c193df25..5323b435e4 100755 --- a/test/model/execution/getrelatedexecutions.php +++ b/test/model/execution/getrelatedexecutions.php @@ -2,6 +2,36 @@ id->range('1-10'); +$execution->name->range('项目集1,项目1,项目2,项目3,迭代1,迭代2,阶段1,阶段2,看板1,看板2'); +$execution->type->range('program,project{3},sprint{2},stage{2},kanban{2}'); +$execution->model->range('[],scrum,waterfall,kanban,[]{6}'); +$execution->parent->range('0,1{3},2{2},3{2},4{2}'); +$execution->project->range('0{4},2{2},3{2},4{2}'); +$execution->status->range('doing'); +$execution->vision->range('rnd'); +$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(10); + +$product = zdTable('product'); +$product->id->range('1-3'); +$product->name->range('正常产品1,多分支产品1,多平台产品1'); +$product->type->range('normal,branch,platform'); +$product->status->range('closed{2},normal'); +$product->createdBy->range('admin,user1'); +$product->gen(3); + +$projectproduct = zdTable('projectproduct'); +$projectproduct->project->range('1-10'); +$projectproduct->product->range('1-3'); +$projectproduct->plan->range('1-3'); +$projectproduct->gen(10); + +zdTable('user')->gen(5); su('admin'); /** @@ -11,22 +41,21 @@ cid=1 pid=1 查询敏捷执行关联查询 >> 项目1 -查询瀑布执行关联查询 >> 项目36 -查询看板执行关联查询 >> 项目57 -查询敏捷执行关联统计 >> 22 -查询瀑布执行关联统计 >> 26 -查询看板执行关联统计 >> 22 +查询瀑布执行关联查询 >> 项目3 +查询看板执行关联查询 >> 项目2 +查询敏捷执行关联统计 >> 2 +查询瀑布执行关联统计 >> 3 +查询看板执行关联统计 >> 2 */ -$executionIDList = array('101','146', '617'); +$executionIDList = array('5','7', '9'); $count = array('0','1'); $execution = new executionTest(); -//var_dump($execution->getRelatedExecutionsTest($executionIDList[2],$count[0]));die; -r($execution->getRelatedExecutionsTest($executionIDList[0],$count[0])) && p('11') && e('项目1'); // 查询敏捷执行关联查询 -r($execution->getRelatedExecutionsTest($executionIDList[1],$count[0])) && p('46') && e('项目36'); // 查询瀑布执行关联查询 -r($execution->getRelatedExecutionsTest($executionIDList[2],$count[0])) && p('67') && e('项目57'); // 查询看板执行关联查询 -r($execution->getRelatedExecutionsTest($executionIDList[0],$count[1])) && p() && e('22'); // 查询敏捷执行关联统计 -r($execution->getRelatedExecutionsTest($executionIDList[1],$count[1])) && p() && e('26'); // 查询瀑布执行关联统计 -r($execution->getRelatedExecutionsTest($executionIDList[2],$count[1])) && p() && e('22'); // 查询看板执行关联统计 \ No newline at end of file +r($execution->getRelatedExecutionsTest($executionIDList[0],$count[0])) && p('2') && e('项目1'); // 查询敏捷执行关联查询 +r($execution->getRelatedExecutionsTest($executionIDList[1],$count[0])) && p('4') && e('项目3'); // 查询瀑布执行关联查询 +r($execution->getRelatedExecutionsTest($executionIDList[2],$count[0])) && p('3') && e('项目2'); // 查询看板执行关联查询 +r($execution->getRelatedExecutionsTest($executionIDList[0],$count[1])) && p() && e('2'); // 查询敏捷执行关联统计 +r($execution->getRelatedExecutionsTest($executionIDList[1],$count[1])) && p() && e('3'); // 查询瀑布执行关联统计 +r($execution->getRelatedExecutionsTest($executionIDList[2],$count[1])) && p() && e('2'); // 查询看板执行关联统计 diff --git a/test/model/execution/getsearchbugs.php b/test/model/execution/getsearchbugs.php index cbc16adcc7..f45e80c2af 100755 --- a/test/model/execution/getsearchbugs.php +++ b/test/model/execution/getsearchbugs.php @@ -2,6 +2,51 @@ id->range('1-5'); +$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); +$execution->type->range('project{2},sprint,waterfall,kanban'); +$execution->status->range('doing{3},closed,doing'); +$execution->parent->range('0,0,1,1,2'); +$execution->grade->range('2{2},1{3}'); +$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); +$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +$task = zdTable('task'); +$task->id->range('1-10'); +$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-10'); +$bug->title->range('1-10')->prefix('Bug'); +$bug->project->range('1'); +$bug->product->range('1'); +$bug->execution->range('3-5'); +$bug->status->range('active,wait,doing'); +$bug->gen(10); + +$product = zdTable('product'); +$product->id->range('1-3'); +$product->name->range('正常产品1,多分支产品1,多平台产品1'); +$product->type->range('normal,branch,platform'); +$product->status->range('closed{2},normal'); +$product->createdBy->range('admin,user1'); +$product->gen(3); + +$projectproduct = zdTable('projectproduct'); +$projectproduct->project->range('5-10'); +$projectproduct->product->range('1-3'); +$projectproduct->plan->range('1-3'); +$projectproduct->gen(5); + su('admin'); /** @@ -10,15 +55,15 @@ title=测试executionModel->getSearchBugs(); cid=1 pid=1 -查询产品1bug >> 测试单转Bug1 -查询项目13bug优先级 >> 3 +查询产品1bug名称 >> Bug10 +查询执行3bug名称 >> Bug1 */ $productIDList = array(1 => '正常产品1'); -$executionIDList = array('103'); +$executionIDList = array('3'); $sql = '1=1'; $execution = new executionTest(); -r($execution->getSearchBugsTest($productIDList, 0, $sql)) && p('301:title') && e('测试单转Bug1'); // 查询产品1bug -r($execution->getSearchBugsTest(array(), $executionIDList[0], $sql)) && p('303:pri') && e(3); // 查询项目13bug优先级 +r($execution->getSearchBugsTest($productIDList, 0, $sql)) && p('10:title') && e('Bug10'); // 查询产品1bug名称 +r($execution->getSearchBugsTest(array(), $executionIDList[0], $sql)) && p('1:title') && e('Bug1'); // 查询执行3bug名称 diff --git a/test/model/execution/getsearchtasks.php b/test/model/execution/getsearchtasks.php index 8a7ca48f61..f2bfd620a3 100755 --- a/test/model/execution/getsearchtasks.php +++ b/test/model/execution/getsearchtasks.php @@ -2,6 +2,35 @@ id->range('1-5'); +$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); +$execution->type->range('project{2},sprint,stage,kanban'); +$execution->status->range('doing'); +$execution->parent->range('0,0,1,1,2'); +$execution->project->range('0,0,1,1,2'); +$execution->grade->range('2{2},1{3}'); +$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); +$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +$task = zdTable('task'); +$task->id->range('1-10'); +$task->name->range('1-10')->prefix('任务'); +$task->execution->range('3'); +$task->type->range('test,devel,design'); +$task->status->range('wait,doing'); +$task->estimate->range('1-10'); +$task->left->range('1-10'); +$task->consumed->range('1-10'); +$task->fromBug->range('0,1'); +$task->story->range('0,1'); +$task->parent->range('0,1'); +$task->module->range('0,2'); +$task->gen(10); + su('admin'); /** @@ -10,49 +39,48 @@ title=executionModel->getSearchTasks(); cid=1 pid=1 -测试通过sql语句获取3个任务 id 倒序 execution = '101' and deleted = '0' and parent >= 0 >> 910:name:子任务10;909:name:子任务9;908:name:子任务8; -测试通过sql语句获取3个任务 id 正序 execution = '101' and deleted = '0' and parent >= 0 >> 1:name:开发任务11;901:name:子任务1;902:name:子任务2; -测试通过sql语句获取5个任务 id 倒序 execution = '101' and deleted = '0' and parent >= 0 >> 910:name:子任务10;909:name:子任务9;908:name:子任务8;907:name:子任务7;906:name:子任务6; -测试通过sql语句获取5个任务 id 正序 execution = '101' and deleted = '0' and parent >= 0 >> 1:name:开发任务11;901:name:子任务1;902:name:子任务2;903:name:子任务3;904:name:子任务4; -测试通过sql语句获取3个任务 id 倒序 type = 'devel' and fromBug != '0' and parent >= 0 >> 0 -测试通过sql语句获取3个任务 id 正序 type = 'devel' and fromBug != '0' and parent >= 0 >> 0 -测试通过sql语句获取5个任务 id 倒序 type = 'devel' and fromBug != '0' and parent >= 0 >> 0 -测试通过sql语句获取5个任务 id 正序 type = 'devel' and fromBug != '0' and parent >= 0 >> 0 -测试通过sql语句获取3个任务 id 倒序 execution = '101' and story != '0' and parent >= 0 >> 1:name:开发任务11; -测试通过sql语句获取3个任务 id 正序 execution = '101' and story != '0' and parent >= 0 >> 1:name:开发任务11; -测试通过sql语句获取5个任务 id 倒序 execution = '101' and story != '0' and parent >= 0 >> 1:name:开发任务11; -测试通过sql语句获取5个任务 id 正序 execution = '101' and story != '0' and parent >= 0 >> 1:name:开发任务11; -测试通过sql语句获取3个任务 id 倒序 module like '%2%' and type = 'design' and parent >= 0 >> 909:name:子任务9;901:name:子任务1;801:name:更多任务201; -测试通过sql语句获取3个任务 id 正序 module like '%2%' and type = 'design' and parent >= 0 >> 1:name:开发任务11;65:name:开发任务75;73:name:开发任务83; -测试通过sql语句获取5个任务 id 倒序 module like '%2%' and type = 'design' and parent >= 0 >> 909:name:子任务9;901:name:子任务1;801:name:更多任务201;769:name:更多任务169;737:name:更多任务137; -测试通过sql语句获取5个任务 id 正序 module like '%2%' and type = 'design' and parent >= 0 >> 1:name:开发任务11;65:name:开发任务75;73:name:开发任务83;81:name:开发任务91;89:name:开发任务99; +测试通过sql语句获取3个任务 id 倒序 execution = '3' and deleted = '0' and parent >= 0 >> 10:name:任务10;9:name:任务9;8:name:任务8; +测试通过sql语句获取3个任务 id 正序 execution = '3' and deleted = '0' and parent >= 0 >> 1:name:任务1;3:name:任务3; +测试通过sql语句获取5个任务 id 倒序 execution = '3' and deleted = '0' and parent >= 0 >> 10:name:任务10;9:name:任务9;8:name:任务8;7:name:任务7;6:name:任务6; +测试通过sql语句获取5个任务 id 正序 execution = '3' and deleted = '0' and parent >= 0 >> 1:name:任务1;3:name:任务3;5:name:任务5; +测试通过sql语句获取3个任务 id 倒序 type = 'devel' and fromBug != '0' and parent >= 0 >> 8:name:任务8;2:name:任务2; +测试通过sql语句获取3个任务 id 正序 type = 'devel' and fromBug != '0' and parent >= 0 >> 2:name:任务2;8:name:任务8; +测试通过sql语句获取5个任务 id 倒序 type = 'devel' and fromBug != '0' and parent >= 0 >> 8:name:任务8;2:name:任务2; +测试通过sql语句获取5个任务 id 正序 type = 'devel' and fromBug != '0' and parent >= 0 >> 2:name:任务2;8:name:任务8; +测试通过sql语句获取3个任务 id 倒序 execution = '3' and story != '0' and parent >= 0 >> 10:name:任务10;8:name:任务8;6:name:任务6; +测试通过sql语句获取3个任务 id 正序 execution = '3' and story != '0' and parent >= 0 >> 2:name:任务2;4:name:任务4;6:name:任务6; +测试通过sql语句获取5个任务 id 倒序 execution = '3' and story != '0' and parent >= 0 >> 10:name:任务10;8:name:任务8;6:name:任务6;4:name:任务4;2:name:任务2; +测试通过sql语句获取5个任务 id 正序 execution = '3' and story != '0' and parent >= 0 >> 2:name:任务2;4:name:任务4;6:name:任务6;8:name:任务8;10:name:任务10; +测试通过sql语句获取3个任务 id 倒序 module like '%2%' and type = 'design' and parent >= 0 >> 6:name:任务6; +测试通过sql语句获取3个任务 id 正序 module like '%2%' and type = 'design' and parent >= 0 >> 6:name:任务6; +测试通过sql语句获取5个任务 id 倒序 module like '%2%' and type = 'design' and parent >= 0 >> 6:name:任务6; +测试通过sql语句获取5个任务 id 正序 module like '%2%' and type = 'design' and parent >= 0 >> 6:name:任务6; */ $condition = array(); -$condition[] = "execution = '101' and deleted = '0' and parent >= 0"; +$condition[] = "execution = '3' and deleted = '0' and parent >= 0"; $condition[] = "type = 'devel' and fromBug != '0' and parent >= 0"; -$condition[] = "execution = '101' and story != '0' and parent >= 0"; +$condition[] = "execution = '3' and story != '0' and parent >= 0"; $condition[] = "module like '%2%' and type = 'design' and parent >= 0"; $recPerPage = array('3', '5'); $orderBy = array('id_desc', 'id_asc'); - $execution = new executionTest(); -r($execution->getSearchTasksTest($condition[0], $recPerPage[0], $orderBy[0])) && p() && e('910:name:子任务10;909:name:子任务9;908:name:子任务8;'); // 测试通过sql语句获取3个任务 id 倒序 execution = '101' and deleted = '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[0], $recPerPage[0], $orderBy[1])) && p() && e('1:name:开发任务11;901:name:子任务1;902:name:子任务2;'); // 测试通过sql语句获取3个任务 id 正序 execution = '101' and deleted = '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[0], $recPerPage[1], $orderBy[0])) && p() && e('910:name:子任务10;909:name:子任务9;908:name:子任务8;907:name:子任务7;906:name:子任务6;'); // 测试通过sql语句获取5个任务 id 倒序 execution = '101' and deleted = '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[0], $recPerPage[1], $orderBy[1])) && p() && e('1:name:开发任务11;901:name:子任务1;902:name:子任务2;903:name:子任务3;904:name:子任务4;'); // 测试通过sql语句获取5个任务 id 正序 execution = '101' and deleted = '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[1], $recPerPage[0], $orderBy[0])) && p() && e('0'); // 测试通过sql语句获取3个任务 id 倒序 type = 'devel' and fromBug != '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[1], $recPerPage[0], $orderBy[1])) && p() && e('0'); // 测试通过sql语句获取3个任务 id 正序 type = 'devel' and fromBug != '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[1], $recPerPage[1], $orderBy[0])) && p() && e('0'); // 测试通过sql语句获取5个任务 id 倒序 type = 'devel' and fromBug != '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[1], $recPerPage[1], $orderBy[1])) && p() && e('0'); // 测试通过sql语句获取5个任务 id 正序 type = 'devel' and fromBug != '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[2], $recPerPage[0], $orderBy[0])) && p() && e('1:name:开发任务11;'); // 测试通过sql语句获取3个任务 id 倒序 execution = '101' and story != '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[2], $recPerPage[0], $orderBy[1])) && p() && e('1:name:开发任务11;'); // 测试通过sql语句获取3个任务 id 正序 execution = '101' and story != '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[2], $recPerPage[1], $orderBy[0])) && p() && e('1:name:开发任务11;'); // 测试通过sql语句获取5个任务 id 倒序 execution = '101' and story != '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[2], $recPerPage[1], $orderBy[1])) && p() && e('1:name:开发任务11;'); // 测试通过sql语句获取5个任务 id 正序 execution = '101' and story != '0' and parent >= 0 -r($execution->getSearchTasksTest($condition[3], $recPerPage[0], $orderBy[0])) && p() && e('909:name:子任务9;901:name:子任务1;801:name:更多任务201;'); // 测试通过sql语句获取3个任务 id 倒序 module like '%2%' and type = 'design' and parent >= 0 -r($execution->getSearchTasksTest($condition[3], $recPerPage[0], $orderBy[1])) && p() && e('1:name:开发任务11;65:name:开发任务75;73:name:开发任务83;'); // 测试通过sql语句获取3个任务 id 正序 module like '%2%' and type = 'design' and parent >= 0 -r($execution->getSearchTasksTest($condition[3], $recPerPage[1], $orderBy[0])) && p() && e('909:name:子任务9;901:name:子任务1;801:name:更多任务201;769:name:更多任务169;737:name:更多任务137;'); // 测试通过sql语句获取5个任务 id 倒序 module like '%2%' and type = 'design' and parent >= 0 -r($execution->getSearchTasksTest($condition[3], $recPerPage[1], $orderBy[1])) && p() && e('1:name:开发任务11;65:name:开发任务75;73:name:开发任务83;81:name:开发任务91;89:name:开发任务99;'); // 测试通过sql语句获取5个任务 id 正序 module like '%2%' and type = 'design' and parent >= 0 +r($execution->getSearchTasksTest($condition[0], $recPerPage[0], $orderBy[0])) && p() && e('10:name:任务10;9:name:任务9;8:name:任务8;'); // 测试通过sql语句获取3个任务 id 倒序 execution = '3' and deleted = '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[0], $recPerPage[0], $orderBy[1])) && p() && e('1:name:任务1;3:name:任务3;'); // 测试通过sql语句获取3个任务 id 正序 execution = '3' and deleted = '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[0], $recPerPage[1], $orderBy[0])) && p() && e('10:name:任务10;9:name:任务9;8:name:任务8;7:name:任务7;6:name:任务6;'); // 测试通过sql语句获取5个任务 id 倒序 execution = '3' and deleted = '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[0], $recPerPage[1], $orderBy[1])) && p() && e('1:name:任务1;3:name:任务3;5:name:任务5;'); // 测试通过sql语句获取5个任务 id 正序 execution = '3' and deleted = '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[1], $recPerPage[0], $orderBy[0])) && p() && e('8:name:任务8;2:name:任务2;'); // 测试通过sql语句获取3个任务 id 倒序 type = 'devel' and fromBug != '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[1], $recPerPage[0], $orderBy[1])) && p() && e('2:name:任务2;8:name:任务8;'); // 测试通过sql语句获取3个任务 id 正序 type = 'devel' and fromBug != '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[1], $recPerPage[1], $orderBy[0])) && p() && e('8:name:任务8;2:name:任务2;'); // 测试通过sql语句获取5个任务 id 倒序 type = 'devel' and fromBug != '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[1], $recPerPage[1], $orderBy[1])) && p() && e('2:name:任务2;8:name:任务8;'); // 测试通过sql语句获取5个任务 id 正序 type = 'devel' and fromBug != '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[2], $recPerPage[0], $orderBy[0])) && p() && e('10:name:任务10;8:name:任务8;6:name:任务6;'); // 测试通过sql语句获取3个任务 id 倒序 execution = '3' and story != '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[2], $recPerPage[0], $orderBy[1])) && p() && e('2:name:任务2;4:name:任务4;6:name:任务6;'); // 测试通过sql语句获取3个任务 id 正序 execution = '3' and story != '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[2], $recPerPage[1], $orderBy[0])) && p() && e('10:name:任务10;8:name:任务8;6:name:任务6;4:name:任务4;2:name:任务2;'); // 测试通过sql语句获取5个任务 id 倒序 execution = '3' and story != '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[2], $recPerPage[1], $orderBy[1])) && p() && e('2:name:任务2;4:name:任务4;6:name:任务6;8:name:任务8;10:name:任务10;'); // 测试通过sql语句获取5个任务 id 正序 execution = '3' and story != '0' and parent >= 0 +r($execution->getSearchTasksTest($condition[3], $recPerPage[0], $orderBy[0])) && p() && e('6:name:任务6;'); // 测试通过sql语句获取3个任务 id 倒序 module like '%2%' and type = 'design' and parent >= 0 +r($execution->getSearchTasksTest($condition[3], $recPerPage[0], $orderBy[1])) && p() && e('6:name:任务6;'); // 测试通过sql语句获取3个任务 id 正序 module like '%2%' and type = 'design' and parent >= 0 +r($execution->getSearchTasksTest($condition[3], $recPerPage[1], $orderBy[0])) && p() && e('6:name:任务6;'); // 测试通过sql语句获取5个任务 id 倒序 module like '%2%' and type = 'design' and parent >= 0 +r($execution->getSearchTasksTest($condition[3], $recPerPage[1], $orderBy[1])) && p() && e('6:name:任务6;'); // 测试通过sql语句获取5个任务 id 正序 module like '%2%' and type = 'design' and parent >= 0 diff --git a/test/model/execution/getstagelinkproductpairs.php b/test/model/execution/getstagelinkproductpairs.php index 2e04fbe066..a836175b1f 100755 --- a/test/model/execution/getstagelinkproductpairs.php +++ b/test/model/execution/getstagelinkproductpairs.php @@ -2,32 +2,70 @@ gen(5); su('admin'); +$product = zdTable('product'); +$product->id->range('1-3'); +$product->name->range('正常产品1,多分支产品1,多平台产品1'); +$product->type->range('normal,branch,platform'); +$product->status->range('closed{2},normal'); +$product->createdBy->range('admin,user1'); +$product->gen(3); + +$projectproduct = zdTable('projectproduct'); +$projectproduct->project->range('5-10'); +$projectproduct->product->range('1-3'); +$projectproduct->plan->range('1-3'); +$projectproduct->gen(5); + +$branch = zdTable('branch'); +$branch->id->range('1-2'); +$branch->product->range('2'); +$branch->name->range('分支1,分支2'); +$branch->status->range('active'); +$branch->gen(2); + +zdTable('team')->gen(0); + +$execution = zdTable('project'); +$execution->id->range('1-10'); +$execution->name->range('项目集1,项目1,项目2,项目3,迭代1,迭代2,阶段1,阶段2,看板1,看板2'); +$execution->type->range('program,project{3},sprint{2},stage{2},kanban{2}'); +$execution->model->range('[],scrum,waterfall,kanban,[]{6}'); +$execution->parent->range('0,1{3},2{2},3{2},4{2}'); +$execution->project->range('0{4},2{2},3{2},4{2}'); +$execution->status->range('doing'); +$execution->vision->range('rnd'); +$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(10); + /** title=测试executionModel->getStageLinkProductPairsTest(); cid=1 pid=1 -敏捷执行产品查询 >> 多平台产品91 -瀑布执行产品查询 >> 已关闭的正常产品31 -看板执行产品查询 >> 已关闭的多分支产品61 -敏捷执行产品统计 >> 3 -瀑布执行产品统计 >> 3 -看板执行产品统计 >> 3 +敏捷执行产品查询 >> 正常产品1 +瀑布执行产品查询 >> 多平台产品1 +看板执行产品查询 >> 多分支产品1 +敏捷执行产品统计 >> 2 +瀑布执行产品统计 >> 2 +看板执行产品统计 >> 1 */ -$sprintIDList = array('101', '102', '103'); -$stageIDList = array('131', '132', '133'); -$kanbanIDList = array('161', '162', '163'); +$sprintIDList = array('5', '6'); +$stageIDList = array('7', '8'); +$kanbanIDList = array('9', '10'); $count = array('0','1'); $execution = new executionTest(); -r($execution->getStageLinkProductPairsTest($sprintIDList, $count[0])) && p('101') && e('多平台产品91'); // 敏捷执行产品查询 -r($execution->getStageLinkProductPairsTest($stageIDList, $count[0])) && p('131') && e('已关闭的正常产品31'); // 瀑布执行产品查询 -r($execution->getStageLinkProductPairsTest($kanbanIDList, $count[0])) && p('161') && e('已关闭的多分支产品61'); // 看板执行产品查询 -r($execution->getStageLinkProductPairsTest($sprintIDList, $count[1])) && p() && e('3'); // 敏捷执行产品统计 -r($execution->getStageLinkProductPairsTest($stageIDList, $count[1])) && p() && e('3'); // 瀑布执行产品统计 -r($execution->getStageLinkProductPairsTest($kanbanIDList, $count[1])) && p() && e('3'); // 看板执行产品统计 \ No newline at end of file +r($execution->getStageLinkProductPairsTest($sprintIDList, $count[0])) && p('5') && e('正常产品1'); // 敏捷执行产品查询 +r($execution->getStageLinkProductPairsTest($stageIDList, $count[0])) && p('7') && e('多平台产品1'); // 瀑布执行产品查询 +r($execution->getStageLinkProductPairsTest($kanbanIDList, $count[0])) && p('9') && e('多分支产品1'); // 看板执行产品查询 +r($execution->getStageLinkProductPairsTest($sprintIDList, $count[1])) && p() && e('2'); // 敏捷执行产品统计 +r($execution->getStageLinkProductPairsTest($stageIDList, $count[1])) && p() && e('2'); // 瀑布执行产品统计 +r($execution->getStageLinkProductPairsTest($kanbanIDList, $count[1])) && p() && e('1'); // 看板执行产品统计 diff --git a/test/model/execution/getstatdata.php b/test/model/execution/getstatdata.php index dc50f1b7e9..458019f693 100755 --- a/test/model/execution/getstatdata.php +++ b/test/model/execution/getstatdata.php @@ -2,6 +2,54 @@ id->range('1-5'); +$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); +$execution->type->range('project{2},sprint,stage,kanban'); +$execution->status->range('doing'); +$execution->parent->range('0,0,1,1,2'); +$execution->project->range('0,0,1,1,2'); +$execution->grade->range('2{2},1{3}'); +$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); +$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +$task = zdTable('task'); +$task->id->range('1-10'); +$task->name->range('1-10')->prefix('任务'); +$task->execution->range('3-5'); +$task->type->range('test,devel'); +$task->status->range('wait,doing'); +$task->estimate->range('1-10'); +$task->left->range('1-10'); +$task->consumed->range('1-10'); +$task->gen(10); + +$product = zdTable('product'); +$product->id->range('1-3'); +$product->name->range('1-3')->prefix('产品'); +$product->code->range('1-3')->prefix('product'); +$product->type->range('normal'); +$product->status->range('normal'); +$product->gen(3); + +$projectproduct = zdTable('projectproduct'); +$projectproduct->project->range('3-5'); +$projectproduct->product->range('1'); +$projectproduct->plan->range('1-3'); +$projectproduct->gen(3); + +$team = zdTable('team'); +$team->root->range('3-5'); +$team->account->range('1-5')->prefix('user'); +$team->role->range('研发{3},测试{2}'); +$team->type->range('execution'); +$team->join->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD'); +$team->gen(5); + +zdTable('user')->gen(5); su('admin'); /** @@ -10,36 +58,36 @@ title=测试 executionModel->getStatData(); cid=1 pid=1 -测试默认值 >> 0 -测试传入空值 >> 0 -测试projectID为1的所有未关闭执行 >> 0 -测试projectID为1的所有执行 >> 0 -测试projectID为1的未开始执行 >> 0 -测试projectID为1的进行中执行 >> 0 -测试projectID为1的已挂起执行 >> 0 -测试projectID为1的已关闭执行 >> 0 -测试projectID为1的我参与执行 >> 0 -测试projectID为1的搜索出来的执行 >> 0 -测试projectID为1的评审执行 >> 0 -测试projectID为1, productID为1, branchID为0的所有执行 >> 0 -测试projectID为1, productID为1, branchID为0的所有执行和任务 >> 0 -测试projectID为1, productID为1, branchID为0的非父阶段 >> 0 -测试projectID为11的所有未关闭执行 >> 7 -测试projectID为11的所有执行 >> 7 -测试projectID为11的未开始执行 >> 7 -测试projectID为11的进行中执行 >> 7 -测试projectID为11的已挂起执行 >> 7 -测试projectID为11的已关闭执行 >> 7 -测试projectID为11的我参与执行 >> 7 -测试projectID为11的搜索出来的执行 >> 7 -测试projectID为11的评审执行 >> 7 -测试projectID为11, productID为1, branchID为0的所有执行 >> 7 -测试projectID为11, productID为1, branchID为0的所有执行和任务 >> 7 -测试projectID为11, productID为1, branchID为0的非父阶段 >> 7 +测试默认值 >> 3 +测试传入空值 >> 3 +测试projectID为10的所有未关闭执行 >> 0 +测试projectID为10的所有执行 >> 0 +测试projectID为10的未开始执行 >> 0 +测试projectID为10的进行中执行 >> 0 +测试projectID为10的已挂起执行 >> 0 +测试projectID为10的已关闭执行 >> 0 +测试projectID为10的我参与执行 >> 0 +测试projectID为10的搜索出来的执行 >> 0 +测试projectID为10的评审执行 >> 0 +测试projectID为10, productID为1, branchID为0的所有执行 >> 0 +测试projectID为10, productID为1, branchID为0的所有执行和任务 >> 0 +测试projectID为10, productID为1, branchID为0的非父阶段 >> 0 +测试projectID为2的所有未关闭执行 >> 1 +测试projectID为2的所有执行 >> 1 +测试projectID为2的未开始执行 >> 1 +测试projectID为2的进行中执行 >> 1 +测试projectID为2的已挂起执行 >> 1 +测试projectID为2的已关闭执行 >> 1 +测试projectID为2的我参与执行 >> 1 +测试projectID为2的搜索出来的执行 >> 1 +测试projectID为2的评审执行 >> 1 +测试projectID为2, productID为1, branchID为0的所有执行 >> 1 +测试projectID为2, productID为1, branchID为0的所有执行和任务 >> 1 +测试projectID为2, productID为1, branchID为0的非父阶段 >> 1 */ -$projectIdList = array(0, 1, 11); +$projectIdList = array(0, 10, 2); $browseTypeList = array('all', 'wait', 'doing', 'suspended', 'closed', 'involved', 'bySearch', 'review'); $productID = 1; $branchID = 0; @@ -48,29 +96,29 @@ $param = 'skipParent'; $execution = new executionTest(); -r($execution->getStatDataTest()) && p() && e('0'); // 测试默认值 -r($execution->getStatDataTest($projectIdList[0])) && p() && e('0'); // 测试传入空值 -r($execution->getStatDataTest($projectIdList[1])) && p() && e('0'); // 测试projectID为1的所有未关闭执行 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[0])) && p() && e('0'); // 测试projectID为1的所有执行 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[1])) && p() && e('0'); // 测试projectID为1的未开始执行 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[2])) && p() && e('0'); // 测试projectID为1的进行中执行 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[3])) && p() && e('0'); // 测试projectID为1的已挂起执行 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[4])) && p() && e('0'); // 测试projectID为1的已关闭执行 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[5])) && p() && e('0'); // 测试projectID为1的我参与执行 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[6])) && p() && e('0'); // 测试projectID为1的搜索出来的执行 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[7])) && p() && e('0'); // 测试projectID为1的评审执行 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[0], $productID, $branchID)) && p() && e('0'); // 测试projectID为1, productID为1, branchID为0的所有执行 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[0], $productID, $branchID), $withTasksList[1]) && p() && e('0'); // 测试projectID为1, productID为1, branchID为0的所有执行和任务 -r($execution->getStatDataTest($projectIdList[1], $browseTypeList[0], $productID, $branchID), $withTasksList[0], $param) && p() && e('0'); // 测试projectID为1, productID为1, branchID为0的非父阶段 -r($execution->getStatDataTest($projectIdList[2])) && p() && e('7'); // 测试projectID为11的所有未关闭执行 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[0])) && p() && e('7'); // 测试projectID为11的所有执行 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[1])) && p() && e('7'); // 测试projectID为11的未开始执行 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[2])) && p() && e('7'); // 测试projectID为11的进行中执行 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[3])) && p() && e('7'); // 测试projectID为11的已挂起执行 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[4])) && p() && e('7'); // 测试projectID为11的已关闭执行 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[5])) && p() && e('7'); // 测试projectID为11的我参与执行 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[6])) && p() && e('7'); // 测试projectID为11的搜索出来的执行 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[7])) && p() && e('7'); // 测试projectID为11的评审执行 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[0], $productID, $branchID)) && p() && e('7'); // 测试projectID为11, productID为1, branchID为0的所有执行 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[0], $productID, $branchID), $withTasksList[1]) && p() && e('7'); // 测试projectID为11, productID为1, branchID为0的所有执行和任务 -r($execution->getStatDataTest($projectIdList[2], $browseTypeList[0], $productID, $branchID), $withTasksList[0], $param) && p() && e('7'); // 测试projectID为11, productID为1, branchID为0的非父阶段 +r($execution->getStatDataTest()) && p() && e('3'); // 测试默认值 +r($execution->getStatDataTest($projectIdList[0])) && p() && e('3'); // 测试传入空值 +r($execution->getStatDataTest($projectIdList[1])) && p() && e('0'); // 测试projectID为10的所有未关闭执行 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[0])) && p() && e('0'); // 测试projectID为10的所有执行 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[1])) && p() && e('0'); // 测试projectID为10的未开始执行 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[2])) && p() && e('0'); // 测试projectID为10的进行中执行 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[3])) && p() && e('0'); // 测试projectID为10的已挂起执行 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[4])) && p() && e('0'); // 测试projectID为10的已关闭执行 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[5])) && p() && e('0'); // 测试projectID为10的我参与执行 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[6])) && p() && e('0'); // 测试projectID为10的搜索出来的执行 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[7])) && p() && e('0'); // 测试projectID为10的评审执行 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[0], $productID, $branchID)) && p() && e('0'); // 测试projectID为10, productID为1, branchID为0的所有执行 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[0], $productID, $branchID), $withTasksList[1]) && p() && e('0'); // 测试projectID为10, productID为1, branchID为0的所有执行和任务 +r($execution->getStatDataTest($projectIdList[1], $browseTypeList[0], $productID, $branchID), $withTasksList[0], $param) && p() && e('0'); // 测试projectID为10, productID为1, branchID为0的非父阶段 +r($execution->getStatDataTest($projectIdList[2])) && p() && e('1'); // 测试projectID为2的所有未关闭执行 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[0])) && p() && e('1'); // 测试projectID为2的所有执行 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[1])) && p() && e('1'); // 测试projectID为2的未开始执行 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[2])) && p() && e('1'); // 测试projectID为2的进行中执行 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[3])) && p() && e('1'); // 测试projectID为2的已挂起执行 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[4])) && p() && e('1'); // 测试projectID为2的已关闭执行 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[5])) && p() && e('1'); // 测试projectID为2的我参与执行 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[6])) && p() && e('1'); // 测试projectID为2的搜索出来的执行 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[7])) && p() && e('1'); // 测试projectID为2的评审执行 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[0], $productID, $branchID)) && p() && e('1'); // 测试projectID为2, productID为1, branchID为0的所有执行 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[0], $productID, $branchID), $withTasksList[1]) && p() && e('1'); // 测试projectID为2, productID为1, branchID为0的所有执行和任务 +r($execution->getStatDataTest($projectIdList[2], $browseTypeList[0], $productID, $branchID), $withTasksList[0], $param) && p() && e('1'); // 测试projectID为2, productID为1, branchID为0的非父阶段 diff --git a/test/model/execution/gettaskgroupbyexecution.php b/test/model/execution/gettaskgroupbyexecution.php index c585057bdd..4ae3838120 100755 --- a/test/model/execution/gettaskgroupbyexecution.php +++ b/test/model/execution/gettaskgroupbyexecution.php @@ -2,6 +2,31 @@ id->range('1-5'); +$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); +$execution->type->range('project{2},sprint,stage,kanban'); +$execution->status->range('doing'); +$execution->parent->range('0,0,1,1,2'); +$execution->project->range('0,0,1,1,2'); +$execution->grade->range('2{2},1{3}'); +$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); +$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +$task = zdTable('task'); +$task->id->range('1-10'); +$task->name->range('1-10')->prefix('任务'); +$task->execution->range('3-5'); +$task->type->range('test,devel'); +$task->status->range('wait,doing'); +$task->estimate->range('1-10'); +$task->left->range('1-10'); +$task->consumed->range('1-10'); +$task->gen(10); + su('admin'); /** @@ -10,13 +35,13 @@ title=测试 executionModel->getTaskGroupByExecution(); cid=1 pid=1 -测试空数据 >> 0 +测试空数据 >> 0 测试获取执行的任务 >> 3 */ -$executionIdList = array(0, 1, 101, 131, 161); +$executionIdList = array(0, 3, 4, 5); $execution = new executionTest(); diff --git a/test/model/execution/gettasks.php b/test/model/execution/gettasks.php index b50a9f4f2e..5ded27afd2 100755 --- a/test/model/execution/gettasks.php +++ b/test/model/execution/gettasks.php @@ -2,6 +2,49 @@ id->range('1-5'); +$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); +$execution->type->range('project{2},sprint,stage,kanban'); +$execution->status->range('doing'); +$execution->parent->range('0,0,1,1,2'); +$execution->project->range('0,0,1,1,2'); +$execution->grade->range('2{2},1{3}'); +$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); +$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +$task = zdTable('task'); +$task->id->range('1-10'); +$task->name->range('1-10')->prefix('任务'); +$task->execution->range('3-5'); +$task->type->range('test,devel'); +$task->status->range('wait,doing'); +$task->estimate->range('1-10'); +$task->left->range('1-10'); +$task->consumed->range('1-10'); +$task->gen(10); + +$product = zdTable('product'); +$product->id->range('1-3'); +$product->name->range('1-3')->prefix('产品'); +$product->code->range('1-3')->prefix('product'); +$product->type->range('normal'); +$product->status->range('normal'); +$product->gen(3); + +$query = zdTable('userquery'); +$query->id->range('1'); +$query->account->range('admin'); +$query->module->range('task'); +$query->title->range('搜索条件1'); +$query->form->range('`a:59:{s:9:"fieldname";s:0:"";s:11:"fieldstatus";s:0:"";s:9:"fielddesc";s:0:"";s:15:"fieldassignedTo";s:0:"";s:8:"fieldpri";s:1:"0";s:14:"fieldexecution";s:0:"";s:11:"fieldmodule";s:4:"ZERO";s:13:"fieldestimate";s:0:"";s:9:"fieldleft";s:0:"";s:13:"fieldconsumed";s:0:"";s:9:"fieldtype";s:0:"";s:12:"fieldfromBug";s:0:"";s:17:"fieldclosedReason";s:0:"";s:13:"fieldopenedBy";s:0:"";s:15:"fieldfinishedBy";s:0:"";s:13:"fieldclosedBy";s:0:"";s:15:"fieldcanceledBy";s:0:"";s:17:"fieldlastEditedBy";s:0:"";s:11:"fieldmailto";s:0:"";s:15:"fieldopenedDate";s:0:"";s:13:"fielddeadline";s:0:"";s:15:"fieldestStarted";s:0:"";s:16:"fieldrealStarted";s:0:"";s:17:"fieldassignedDate";s:0:"";s:17:"fieldfinishedDate";s:0:"";s:15:"fieldclosedDate";s:0:"";s:17:"fieldcanceledDate";s:0:"";s:19:"fieldlastEditedDate";s:0:"";s:18:"fieldactivatedDate";s:0:"";s:7:"fieldid";s:0:"";s:6:"andOr1";s:3:"AND";s:6:"field1";s:4:"name";s:9:"operator1";s:7:"include";s:6:"value1";s:6:"任务";s:6:"andOr2";s:3:"and";s:6:"field2";s:2:"id";s:9:"operator2";s:1:"=";s:6:"value2";s:0:"";s:6:"andOr3";s:3:"and";s:6:"field3";s:6:"status";s:9:"operator3";s:1:"=";s:6:"value3";s:0:"";s:10:"groupAndOr";s:3:"and";s:6:"andOr4";s:3:"AND";s:6:"field4";s:4:"desc";s:9:"operator4";s:7:"include";s:6:"value4";s:0:"";s:6:"andOr5";s:3:"and";s:6:"field5";s:10:"assignedTo";s:9:"operator5";s:1:"=";s:6:"value5";s:0:"";s:6:"andOr6";s:3:"and";s:6:"field6";s:3:"pri";s:9:"operator6";s:1:"=";s:6:"value6";s:1:"0";s:6:"module";s:4:"task";s:9:"actionURL";s:41:"/execution-task-3-bySearch-myQueryID.html";s:10:"groupItems";s:1:"3";s:8:"formType";s:4:"lite";}`'); +$query->sql->range("`(( 1 AND `name` LIKE '%任务%' ) AND ( 1 )) AND deleted = '0'`"); +$query->gen(1); + + su('admin'); /** @@ -10,38 +53,38 @@ title=测试executionModel->getTasksTest(); cid=1 pid=1 -敏捷执行任务查询 >> 101,开发任务11 -瀑布执行任务查询 >> 131,41 -看板执行任务查询 >> 161,done -正常产品查询任务 >> 101,开发任务11 -unclosed任务查询 >> 101,wait -wait任务查询 >> 101,wait -doing任务查询 >> 101,doing -undone任务查询 >> 101,doing -done任务查询 >> 101,done -根据查询条件查询任务 >> 101,开发任务11 -根据模块查询任务 >> 101,21 -name_asc,id_asc排序查询 >> 101,开发任务11 -id_asc排序查询 >> 101,design -pri_desc,id_desc排序查询 >> 101,wait -敏捷执行任务查询统计 >> 4 -瀑布执行任务查询统计 >> 4 -看板执行任务查询统计 >> 4 -正常产品查询任务统计 >> 1 -unclosed任务查询统计 >> 4 -wat任务查询统计 >> 2 -doing任务查询统计 >> 1 -undone任务查询统计 >> 3 -done任务查询统计 >> 1 -根据查询条件查询任务统计 >> 1 -根据模块查询任务统计 >> 8 -name_asc,id_asc排序查询统计 >> 4 -id_asc排序查询统计 >> 4 +敏捷执行任务查询 >> 3,任务1 +瀑布执行任务查询 >> 4,0 +看板执行任务查询 >> 5,wait +正常产品查询任务 >> 0 +unclosed任务查询 >> 3,wait +wait任务查询 >> 3,wait +doing任务查询 >> 3,doing +undone任务查询 >> 3,doing +done任务查询 >> 0 +根据查询条件查询任务 >> 3,任务1 +根据模块查询任务 >> 0 +name_asc,id_asc排序查询 >> 3,任务1 +id_asc排序查询 >> 3,test +pri_desc,id_desc排序查询 >> 3,wait +敏捷执行任务查询统计 >> 4 +瀑布执行任务查询统计 >> 3 +看板执行任务查询统计 >> 3 +正常产品查询任务统计 >> 0 +unclosed任务查询统计 >> 4 +wat任务查询统计 >> 2 +doing任务查询统计 >> 2 +undone任务查询统计 >> 4 +done任务查询统计 >> 0 +根据查询条件查询任务统计 >> 4 +根据模块查询任务统计 >> 0 +name_asc,id_asc排序查询统计 >> 4 +id_asc排序查询统计 >> 4 pri_desc,id_desc排序查询统计 >> 4 */ -$executionIDList = array('0', '101', '131', '161'); +$executionIDList = array('0', '3', '4', '5'); $productIDList = array('0', '1'); $browseType = array('all', 'unclosed', 'wait', 'doing', 'undone', 'done', 'closed', 'bysearch'); $queryID = array('0', '1'); @@ -50,31 +93,31 @@ $sort = array('status,id_desc', 'name_asc,id_asc', 'id_asc', 'pri_des $count = array('0', '1'); $execution = new executionTest(); -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('1:execution,name') && e('101,开发任务11'); // 敏捷执行任务查询 -r($execution->getTasksTest($productIDList[0],$executionIDList[2],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('693:execution,project') && e('131,41'); // 瀑布执行任务查询 -r($execution->getTasksTest($productIDList[0],$executionIDList[3],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('783:execution,status') && e('161,done'); // 看板执行任务查询 -r($execution->getTasksTest($productIDList[1],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('1:execution,name') && e('101,开发任务11'); // 正常产品查询任务 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[1],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('1:execution,status') && e('101,wait'); // unclosed任务查询 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[2],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('601:execution,status') && e('101,wait'); // wait任务查询 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[3],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('602:execution,status') && e('101,doing'); // doing任务查询 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[4],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('602:execution,status') && e('101,doing'); // undone任务查询 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[5],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('603:execution,status') && e('101,done'); // done任务查询 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[7],$queryID[1],$moduleID[0],$sort[0],$count[0])) && p('1:execution,name') && e('101,开发任务11'); // 根据查询条件查询任务 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[0])) && p('601:execution,module') && e('101,21'); // 根据模块查询任务 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[1],$count[0])) && p('1:execution,name') && e('101,开发任务11'); // name_asc,id_asc排序查询 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[2],$count[0])) && p('601:execution,type') && e('101,design'); // id_asc排序查询 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[3],$count[0])) && p('1:execution,status') && e('101,wait'); // pri_desc,id_desc排序查询 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // 敏捷执行任务查询统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[2],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // 瀑布执行任务查询统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[3],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // 看板执行任务查询统计 -r($execution->getTasksTest($productIDList[1],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // 正常产品查询任务统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[1],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // unclosed任务查询统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[2],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('2'); // wat任务查询统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[3],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // doing任务查询统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[4],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('3'); // undone任务查询统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[5],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // done任务查询统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[7],$queryID[1],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // 根据查询条件查询任务统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[1])) && p() && e('8'); // 根据模块查询任务统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[1],$count[1])) && p() && e('4'); // name_asc,id_asc排序查询统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[2],$count[1])) && p() && e('4'); // id_asc排序查询统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[3],$count[1])) && p() && e('4'); // pri_desc,id_desc排序查询统计 \ No newline at end of file +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('1:execution,name') && e('3,任务1'); // 敏捷执行任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[2],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('2:execution,project') && e('4,0'); // 瀑布执行任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[3],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('3:execution,status') && e('5,wait'); // 看板执行任务查询 +r($execution->getTasksTest($productIDList[1],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('1:execution,name') && e('0'); // 正常产品查询任务 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[1],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('1:execution,status') && e('3,wait'); // unclosed任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[2],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('1:execution,status') && e('3,wait'); // wait任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[3],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('4:execution,status') && e('3,doing'); // doing任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[4],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('4:execution,status') && e('3,doing'); // undone任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[5],$queryID[0],$moduleID[0],$sort[0],$count[0])) && p('3:execution,status') && e('0'); // done任务查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[7],$queryID[1],$moduleID[0],$sort[0],$count[0])) && p('1:execution,name') && e('3,任务1'); // 根据查询条件查询任务 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[0])) && p('1:execution,module') && e('0'); // 根据模块查询任务 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[1],$count[0])) && p('1:execution,name') && e('3,任务1'); // name_asc,id_asc排序查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[2],$count[0])) && p('1:execution,type') && e('3,test'); // id_asc排序查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[3],$count[0])) && p('1:execution,status') && e('3,wait'); // pri_desc,id_desc排序查询 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // 敏捷执行任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[2],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('3'); // 瀑布执行任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[3],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('3'); // 看板执行任务查询统计 +r($execution->getTasksTest($productIDList[1],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('0'); // 正常产品查询任务统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[1],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // unclosed任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[2],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('2'); // wat任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[3],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('2'); // doing任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[4],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // undone任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[5],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('0'); // done任务查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[7],$queryID[1],$moduleID[0],$sort[0],$count[1])) && p() && e('4'); // 根据查询条件查询任务统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[1])) && p() && e('0'); // 根据模块查询任务统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[1],$count[1])) && p() && e('4'); // name_asc,id_asc排序查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[2],$count[1])) && p() && e('4'); // id_asc排序查询统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[3],$count[1])) && p() && e('4'); // pri_desc,id_desc排序查询统计 diff --git a/test/model/execution/gettasks2imported.php b/test/model/execution/gettasks2imported.php index 4f315c5aa4..1d6c87e73e 100755 --- a/test/model/execution/gettasks2imported.php +++ b/test/model/execution/gettasks2imported.php @@ -2,6 +2,39 @@ id->range('1-5'); +$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); +$execution->type->range('project{2},sprint,stage,kanban'); +$execution->status->range('doing'); +$execution->parent->range('0,0,1,1,2'); +$execution->project->range('0,0,1,1,2'); +$execution->grade->range('2{2},1{3}'); +$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); +$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +$task = zdTable('task'); +$task->id->range('1-10'); +$task->name->range('1-10')->prefix('任务'); +$task->execution->range('3-5'); +$task->type->range('test,devel'); +$task->status->range('wait,doing'); +$task->estimate->range('1-10'); +$task->left->range('1-10'); +$task->consumed->range('1-10'); +$task->gen(10); + +$product = zdTable('product'); +$product->id->range('1-3'); +$product->name->range('1-3')->prefix('产品'); +$product->code->range('1-3')->prefix('product'); +$product->type->range('normal'); +$product->status->range('normal'); +$product->gen(3); + su('admin'); /** @@ -10,22 +43,22 @@ title=测试executionModel->getTasks2ImportedTest(); cid=1 pid=1 -敏捷执行任务查看 >> 更多任务1 -瀑布执行任务查看 >> test +敏捷执行任务查看 >> 任务1 +瀑布执行任务查看 >> devel 看板执行任务查看 >> wait -敏捷执行任务统计 >> 3 +敏捷执行任务统计 >> 4 敏捷执行任务统计 >> 3 敏捷执行任务统计 >> 3 */ -$executionIDList = array('101', '131', '161'); +$executionIDList = array('3', '4', '5'); $count = array('0','1'); $execution = new executionTest(); -r($execution->getTasks2ImportedTest($executionIDList[0],$count[0])) && p('601:name') && e('更多任务1'); // 敏捷执行任务查看 -r($execution->getTasks2ImportedTest($executionIDList[1],$count[0])) && p('691:type') && e('test'); // 瀑布执行任务查看 -r($execution->getTasks2ImportedTest($executionIDList[2],$count[0])) && p('61:status') && e('wait'); // 看板执行任务查看 -r($execution->getTasks2ImportedTest($executionIDList[0],$count[1])) && p() && e('3'); // 敏捷执行任务统计 -r($execution->getTasks2ImportedTest($executionIDList[1],$count[1])) && p() && e('3'); // 敏捷执行任务统计 -r($execution->getTasks2ImportedTest($executionIDList[2],$count[1])) && p() && e('3'); // 敏捷执行任务统计 \ No newline at end of file +r($execution->getTasks2ImportedTest($executionIDList[0],$count[0])) && p('1:name') && e('任务1'); // 敏捷执行任务查看 +r($execution->getTasks2ImportedTest($executionIDList[1],$count[0])) && p('2:type') && e('devel'); // 瀑布执行任务查看 +r($execution->getTasks2ImportedTest($executionIDList[2],$count[0])) && p('3:status') && e('wait'); // 看板执行任务查看 +r($execution->getTasks2ImportedTest($executionIDList[0],$count[1])) && p() && e('4'); // 敏捷执行任务统计 +r($execution->getTasks2ImportedTest($executionIDList[1],$count[1])) && p() && e('3'); // 敏捷执行任务统计 +r($execution->getTasks2ImportedTest($executionIDList[2],$count[1])) && p() && e('3'); // 敏捷执行任务统计 diff --git a/test/model/execution/getteammembers.php b/test/model/execution/getteammembers.php index 9655b0882d..9f98d690ef 100755 --- a/test/model/execution/getteammembers.php +++ b/test/model/execution/getteammembers.php @@ -2,6 +2,28 @@ id->range('1-5'); +$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); +$execution->type->range('project{2},sprint,waterfall,kanban'); +$execution->status->range('doing{3},closed,doing'); +$execution->parent->range('0,0,1,1,2'); +$execution->grade->range('2{2},1{3}'); +$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); +$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +$team = zdTable('team'); +$team->root->range('3-5'); +$team->account->range('1-5')->prefix('user'); +$team->role->range('研发{3},测试{2}'); +$team->type->range('execution'); +$team->join->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD'); +$team->gen(5); + +zdTable('user')->gen(5); su('admin'); /** @@ -10,22 +32,22 @@ title=测试executionModel->getTeamMembersTest(); cid=1 pid=1 -敏捷执行查看team >> 101,execution,482 -瀑布执行查看team >> 131,execution,开发22 -看板执行查看team >> 161,execution,开发52 +敏捷执行查看team >> 3,execution,2 +瀑布执行查看team >> 4,execution,用户2 +看板执行查看team >> 5,execution,用户3 敏捷执行team统计 >> 2 瀑布执行team统计 >> 1 看板执行team统计 >> 1 */ -$executionIDList = array('101', '131', '161'); +$executionIDList = array('3', '4', '5'); $count = array('0','1'); $execution = new executionTest(); -r($execution->getTeamMembersTest($executionIDList[0], $count[0])) && p('po82:root,type,userID') && e('101,execution,482'); // 敏捷执行查看team -r($execution->getTeamMembersTest($executionIDList[1], $count[0])) && p('test22:root,type,realname') && e('131,execution,开发22'); // 瀑布执行查看team -r($execution->getTeamMembersTest($executionIDList[2], $count[0])) && p('test52:root,type,realname') && e('161,execution,开发52'); // 看板执行查看team -r($execution->getTeamMembersTest($executionIDList[0], $count[1])) && p() && e('2'); // 敏捷执行team统计 -r($execution->getTeamMembersTest($executionIDList[1], $count[1])) && p() && e('1'); // 瀑布执行team统计 -r($execution->getTeamMembersTest($executionIDList[2], $count[1])) && p() && e('1'); // 看板执行team统计 \ No newline at end of file +r($execution->getTeamMembersTest($executionIDList[0], $count[0])) && p('user1:root,type,userID') && e('3,execution,2'); // 敏捷执行查看team +r($execution->getTeamMembersTest($executionIDList[1], $count[0])) && p('user2:root,type,realname') && e('4,execution,用户2'); // 瀑布执行查看team +r($execution->getTeamMembersTest($executionIDList[2], $count[0])) && p('user3:root,type,realname') && e('5,execution,用户3'); // 看板执行查看team +r($execution->getTeamMembersTest($executionIDList[0], $count[1])) && p() && e('2'); // 敏捷执行team统计 +r($execution->getTeamMembersTest($executionIDList[1], $count[1])) && p() && e('1'); // 瀑布执行team统计 +r($execution->getTeamMembersTest($executionIDList[2], $count[1])) && p() && e('1'); // 看板执行team统计 diff --git a/test/model/execution/getteams2import.php b/test/model/execution/getteams2import.php index c96e42aa91..a4fa0671e7 100755 --- a/test/model/execution/getteams2import.php +++ b/test/model/execution/getteams2import.php @@ -2,6 +2,25 @@ id->range('1-6'); +$execution->name->range('项目1,迭代1,迭代2,迭代3,迭代4,迭代5'); +$execution->type->range('project,stage,sprint,stage{2},sprint'); +$execution->parent->range('0,1{3},2{2}'); +$execution->status->range('wait'); +$execution->gen(6); + + +$team = zdTable('team'); +$team->root->range('3-5'); +$team->account->range('1-5')->prefix('user'); +$team->role->range('研发{3},测试{2}'); +$team->type->range('execution'); +$team->join->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD'); +$team->gen(5); + +zdTable('user')->gen(5); su('admin'); /** @@ -10,17 +29,18 @@ title=测试executionModel->getTeams2ImportTest(); cid=1 pid=1 -无效数据查询 >> 无数据 -正常数据查询 >> 迭代91 +无效数据查询 >> 无数据 +正常数据查询 >> 迭代3 正常数据查询统计 >> 1 */ -$executionID = '101'; -$accountList = array('test7', 'test82'); +$executionID = '2'; +$accountList = array('user10', 'user5'); $count = array('0','1'); $execution = new executionTest(); -r($execution->getTeams2ImportTest($accountList[0], $executionID, $count[0])) && p() && e('无数据'); // 无效数据查询 -r($execution->getTeams2ImportTest($accountList[1], $executionID, $count[0])) && p('191') && e('迭代91'); // 正常数据查询 -r($execution->getTeams2ImportTest($accountList[1], $executionID, $count[1])) && p() && e('1'); // 正常数据查询统计 \ No newline at end of file + +r($execution->getTeams2ImportTest($accountList[0], $executionID, $count[0])) && p() && e('无数据'); // 无效数据查询 +r($execution->getTeams2ImportTest($accountList[1], $executionID, $count[0])) && p('4') && e('迭代3'); // 正常数据查询 +r($execution->getTeams2ImportTest($accountList[1], $executionID, $count[1])) && p() && e('1'); // 正常数据查询统计 diff --git a/test/model/execution/gettoimport.php b/test/model/execution/gettoimport.php index 89d0214d64..6b1d88aa6b 100755 --- a/test/model/execution/gettoimport.php +++ b/test/model/execution/gettoimport.php @@ -2,6 +2,15 @@ id->range('1-7'); +$execution->name->range('项目1,迭代1,迭代2,阶段3,阶段4,看板5,看板6'); +$execution->type->range('project,sprint{2},stage{2},kanban{2}'); +$execution->parent->range('0,1,2,1,4,1,5'); +$execution->status->range('wait'); +$execution->gen(7); + su('admin'); /** @@ -11,24 +20,24 @@ cid=1 pid=1 敏捷执行查询 >> 迭代1 -瀑布执行查询 >> 阶段31 -看板执行查询 >> 看板61 +瀑布执行查询 >> 阶段3 +看板执行查询 >> 看板5 敏捷执行统计 >> 2 瀑布执行统计 >> 2 看板执行统计 >> 2 */ -$sprintExecutions = array('101', '102'); -$stageExecutions = array('131', '132'); -$kanbanExecutions = array('161', '162'); +$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('101') && e('迭代1'); // 敏捷执行查询 -r($execution->getToImportTest($stageExecutions,$type[1],$count[0])) && p('131') && e('阶段31'); // 瀑布执行查询 -r($execution->getToImportTest($kanbanExecutions,$type[2],$count[0])) && p('161') && e('看板61'); // 看板执行查询 -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'); // 看板执行统计 \ No newline at end of file +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'); // 看板执行统计 diff --git a/test/model/execution/gettotalestimate.php b/test/model/execution/gettotalestimate.php index cf2204d8ba..191b56fc19 100755 --- a/test/model/execution/gettotalestimate.php +++ b/test/model/execution/gettotalestimate.php @@ -2,6 +2,28 @@ id->range('1-5'); +$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); +$execution->type->range('project{2},sprint,waterfall,kanban'); +$execution->status->range('doing{3},closed,doing'); +$execution->parent->range('0,0,1,1,2'); +$execution->grade->range('2{2},1{3}'); +$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); +$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +$task = zdTable('task'); +$task->id->range('1-10'); +$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); + su('admin'); /** @@ -10,17 +32,17 @@ title=测试executionModel->getTotalEstimateTest(); cid=1 pid=1 -敏捷执行预计工时统计 >> 48 -瀑布执行预计工时统计 >> 17 -看板执行预计工时统计 >> 20 +敏捷执行预计工时统计 >> 24 +瀑布执行预计工时统计 >> 18 +看板执行预计工时统计 >> 18 无执行预计工时统计 >> 0 */ -$executionIDList = array('101', '131', '161'); +$executionIDList = array('3', '4', '5'); $execution = new executionTest(); -r($execution->getTotalEstimateTest($executionIDList[0])) && p() && e('48'); // 敏捷执行预计工时统计 -r($execution->getTotalEstimateTest($executionIDList[1])) && p() && e('17'); // 瀑布执行预计工时统计 -r($execution->getTotalEstimateTest($executionIDList[2])) && p() && e('20'); // 看板执行预计工时统计 -r($execution->getTotalEstimateTest('')) && p() && e('0'); // 无执行预计工时统计 \ No newline at end of file +r($execution->getTotalEstimateTest($executionIDList[0])) && p() && e('24'); // 敏捷执行预计工时统计 +r($execution->getTotalEstimateTest($executionIDList[1])) && p() && e('18'); // 瀑布执行预计工时统计 +r($execution->getTotalEstimateTest($executionIDList[2])) && p() && e('18'); // 看板执行预计工时统计 +r($execution->getTotalEstimateTest('')) && p() && e('0'); // 无执行预计工时统计 diff --git a/test/model/execution/managemembers.php b/test/model/execution/managemembers.php index d9abc6315e..7448c983c2 100755 --- a/test/model/execution/managemembers.php +++ b/test/model/execution/managemembers.php @@ -2,6 +2,28 @@ id->range('1-5'); +$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); +$execution->type->range('project{2},sprint,waterfall,kanban'); +$execution->status->range('doing{3},closed,doing'); +$execution->parent->range('0,0,1,1,2'); +$execution->grade->range('2{2},1{3}'); +$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); +$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); +$execution->gen(5); + +$team = zdTable('team'); +$team->root->range('3-5'); +$team->account->range('1-5')->prefix('user'); +$team->role->range('研发{3},测试{2}'); +$team->type->range('execution'); +$team->join->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD'); +$team->gen(5); + +zdTable('user')->gen(5); su('admin'); /** @@ -10,16 +32,16 @@ title=测试executionModel->manageMembersTest(); cid=1 pid=1 -团队管理 >> 101,execution,dev10 +团队管理 >> 3,execution,user1 团队人员管理统计 >> 3 */ -$executionID = '101'; -$realnames = array('研发主管82', '测试92'); +$executionID = '3'; +$realnames = array('用户1', '用户2', 'admin'); $roles = array('研发', '研发', '研发'); $hours = array('3.0', '6.0', '7.0'); -$accounts = array('po82', 'user92', 'dev10'); +$accounts = array('user1', 'user2', 'admin'); $limited = array('yes', 'no', 'yes'); $days = array('17', '27', '127'); @@ -27,5 +49,5 @@ $manageMembers = array('realnames' => $realnames, 'roles' => $roles, 'hours' => $count = array('0','1'); $execution = new executionTest(); -r($execution->manageMembersTest($executionID, $count[0], $manageMembers)) && p('0:root,type,account') && e('101,execution,dev10'); // 团队管理 -r($execution->manageMembersTest($executionID, $count[1], $manageMembers)) && p() && e('3'); // 团队人员管理统计 \ No newline at end of file +r($execution->manageMembersTest($executionID, $count[0], $manageMembers)) && p('0:root,type,account') && e('3,execution,user1'); // 团队管理 +r($execution->manageMembersTest($executionID, $count[1], $manageMembers)) && p() && e('3'); // 团队人员管理统计 diff --git a/test/model/execution/setmenu.php b/test/model/execution/setmenu.php new file mode 100644 index 0000000000..e1c5c6733d --- /dev/null +++ b/test/model/execution/setmenu.php @@ -0,0 +1,34 @@ +#!/usr/bin/env php +gen(5); +su('admin'); + +$execution = zdTable('project'); +$execution->id->range('1-5'); +$execution->name->range('项目集1,项目1,迭代1,阶段1,看板1'); +$execution->type->range('execution,project,sprint,stage,kanban'); +$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); + +/** + +title=测试 executionModel::setMenu(); +cid=1 +pid=1 + +执行存在的情况 >> 迭代1 +执行不存在的情况 >> 0 + +*/ + +$executionTester = new executionTest(); + +r($executionTester->setMenuTest(3)) && p() && e('迭代1'); // 执行存在的情况 +r($executionTester->setMenuTest(10)) && p() && e('0'); // 执行不存在的情况 diff --git a/test/model/execution/settreepath.php b/test/model/execution/settreepath.php index 3cc091689c..db6de3c3a1 100755 --- a/test/model/execution/settreepath.php +++ b/test/model/execution/settreepath.php @@ -6,10 +6,9 @@ include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php'; $execution = zdTable('project'); $execution->id->range('1-6'); $execution->name->range('项目1,迭代1,迭代2,迭代3,迭代4,迭代5'); -$execution->type->range('project,sprint{2},waterfall{2},kanban{1}'); +$execution->type->range('project,stage,sprint,stage{2},sprint'); $execution->parent->range('0,1{3},2{2}'); $execution->status->range('wait'); -$execution->type->range('project,stage,sprint,stage{2},sprint'); $execution->gen(6); su('admin'); diff --git a/test/model/program/accessdenied.php b/test/model/program/accessdenied.php index 414a058e13..f6c9aef232 100644 --- a/test/model/program/accessdenied.php +++ b/test/model/program/accessdenied.php @@ -4,7 +4,7 @@ include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; /** -title=测试 programModel::getStakeholdersByPrograms(); +title=测试 programModel::accessDenied(); cid=1 pid=1