Merge branch 'sprint/tsj_uinttest' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/tsj_uinttest

This commit is contained in:
caoyanyi
2023-01-11 11:00:43 +08:00
3 changed files with 91 additions and 37 deletions
+17 -5
View File
@@ -2,21 +2,33 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
zdTable('user')->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
+56 -24
View File
@@ -2,44 +2,76 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
zdTable('user')->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条查询
$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条查询
+18 -8
View File
@@ -2,26 +2,36 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
zdTable('user')->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'); // 正常数据查询统计
$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'); // 正常数据查询统计