Merge branch 'sgm_projecttest' into 'master'
Sgm projecttest See merge request easycorp/zentaopms!2813
This commit is contained in:
@@ -25,7 +25,7 @@ $data = array(
|
||||
'parent' => '0',
|
||||
'name' => '测试更新项目集十',
|
||||
'begin' => '2020-10-10',
|
||||
'end' => '2022-06-01',
|
||||
'end' => '2022-06-03',
|
||||
'acl' => 'private',
|
||||
'budget' => '100',
|
||||
'budgetUnit' => 'CNY',
|
||||
@@ -37,7 +37,7 @@ $data = array(
|
||||
$normalProgram = $data;
|
||||
|
||||
$emptyTitleProgram = $data;
|
||||
$emptyTitleProgram['name'] = '项目集1';
|
||||
$emptyTitleProgram['name'] = '';
|
||||
|
||||
$emptyBeginProgram = $data;
|
||||
$emptyBeginProgram['begin'] = '';
|
||||
@@ -52,9 +52,9 @@ $beginLtParentProgram = $data;
|
||||
$beginLtParentProgram['parent'] = '9';
|
||||
$beginLtParentProgram['begin'] = '2019-01-01';
|
||||
|
||||
r($program->update(10, $normalProgram)) && p('name') && e('测试更新项目集十'); // 正常更新项目集的情况
|
||||
r($program->update(10, $emptyTitleProgram)) && p('message[name]:0') && e('『项目集名称』已经有『项目集1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 更新项目集名称重复时
|
||||
r($program->update(10, $emptyBeginProgram)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 当计划完成为空时更新项目集信息
|
||||
r($program->update(10, $normalProgram)) && p('name') && e('测试更新项目集十'); // 正常更新项目集的情况
|
||||
r($program->update(10, $emptyTitleProgram)) && p('message[name]:0') && e('『项目集名称』不能为空。'); // 更新项目集名称为空时
|
||||
r($program->update(10, $emptyBeginProgram)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 当计划完成为空时更新项目集信息
|
||||
r($program->update(10, $emptyEndProgram)) && p('message:end') && e('子项目的最大完成日期:2022-05-27,父项目的完成日期不能小于子项目的最大完成日期'); //当计划完成小于计划开始时
|
||||
r($program->update(10, $beginGtEndProgram)) && p('message:begin') && e('子项目集的最小开始日期:2022-02-01,父项目集的开始日期不能大于子项目集的最小开始日期'); // 父项目集的开始日期大于子项目集的开始日期时
|
||||
r($program->update(10, $beginLtParentProgram)) && p('message:begin;message:end') && e('父项目集的开始日期:2022-02-09,开始日期不能小于父项目集的开始日期;父项目集的完成日期:2022-04-16,完成日期不能大于父项目集的完成日期'); // 项目集开始、结束日期和子项目不符的情况
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::activate();
|
||||
title=测试 projectModel->activate();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -14,10 +14,12 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$beginId = array(66, 67);
|
||||
$changes1 = $tester->project->activate(66);
|
||||
$changes2 = $tester->project->activate(73);
|
||||
|
||||
r($project->checkStatus($beginId[0])) && p() && e('1'); //开始id为66状态不是closed的项目
|
||||
r($project->checkStatus($beginId[1])) && p() && e('0'); //开始id为67状态是closed的项目
|
||||
system("./ztest init");
|
||||
r($changes1) && p('1:field,old,new') && e('status,closed,doing'); // 激活id为66状态是closed的项目
|
||||
r($changes2) && p('1:field,old,new') && e('status,suspended,doing'); // 激活id为73状态是suspended的项目
|
||||
system("./ztest init");
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试taskModel->batchUpdate();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project();
|
||||
$projectIdList = array(11, 12, 13);
|
||||
|
||||
$data['names'] = array(11 => '批量修改项目11', 12 => '批量修改项目12', 13 => '批量修改项目13');
|
||||
$data['parents'] = array(11 => 1, 12 => 2, 13 => 3);
|
||||
$data['projectIdList'] = $projectIdList;
|
||||
$data['PMs'] = array(11 => 'admin', 12 => '', 13 => '');
|
||||
$data['begins'] = array(11 => '2022-02-08', 12 => '2022-03-05', 13 => '2022-02-19');
|
||||
$data['ends'] = array(11 => '2022-04-13', 12 => '2022-04-13', 13 => '2022-04-13');
|
||||
$data['dayses'] = array(11 => 10, 12 => 10, 13 => 14);
|
||||
$data['acls'] = array(11 => 'open', 12 => 'private', 13 => 'program');
|
||||
|
||||
$projects = $project->batchUpdate($data);
|
||||
|
||||
r(count($projects)) && p() && e('3'); // 查看被编辑了的项目数量
|
||||
r($projects) && p('11:name,parent,PM,begin,acl') && e('批量修改项目11,1,admin,2022-02-08,open'); // 查看被编辑了的项目11详情
|
||||
r($projects) && p('12:name,parent,PM,begin,acl') && e('批量修改项目12,2,,2022-03-05,private'); // 查看被编辑了的项目12详情
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->checkCanChangeModel();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
r($tester->project->checkCanChangeModel(11, 'scrum')) && p() && e('0'); // 查看ID为11的敏捷项目是否可切换项目管理模型
|
||||
r($tester->project->checkCanChangeModel(41, 'waterfall')) && p() && e('0'); // 查看ID为41的瀑布项目是否可切换项目管理模型
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::close();
|
||||
title=测试 projectModel->close();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -15,13 +15,16 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$closeId = array(20, 26, 41);
|
||||
$realEnd1 = array('realEnd' => '2022-03-11');
|
||||
$_POST['realEnd'] = '2022-03-11';
|
||||
|
||||
//var_dump($project->checkStatusOff($closeId[0], $realEnd1));die;
|
||||
r($project->checkStatusOff($closeId[0], $realEnd1)) && p() && e('1'); //关闭id为20状态不是closed的项目
|
||||
r($project->checkStatusOff($closeId[1], $realEnd1)) && p() && e('0'); //关闭id为26状态是closed的项目
|
||||
r($project->checkStatusOff($closeId[2], $realEnd1)) && p() && e('0'); //关闭id为41状态是suspended的项目
|
||||
system("./ztest init");
|
||||
$changes1 = $tester->project->close(19);
|
||||
$changes2 = $tester->project->close(26);
|
||||
$changes3 = $tester->project->close(33);
|
||||
|
||||
r($changes1) && p('1:field,old,new') && e('status,wait,closed'); // 关闭id为20状态不是closed的项目
|
||||
r($changes2) && p('1:field,old,new') && e('closedBy,,admin'); // 关闭id为26状态是closed的项目
|
||||
r($changes3) && p('1:field,old,new') && e('status,suspended,closed'); // 关闭id为41状态是suspended的项目
|
||||
system("./ztest init");
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->computerProgress();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
$tester->loadModel('execution');
|
||||
|
||||
$executions = $tester->execution->getList(11);
|
||||
$executions = $tester->project->computerProgress($executions);
|
||||
|
||||
r(count($executions)) && p('') && e('7'); // 查看项目11下的所有执行的数量
|
||||
r($executions) && p('551:totalEstimate,totalConsumed,totalLeft,progress,totalReal') && e('10,3,10,23.08,13'); // 查看计算后的执行工时汇总信息
|
||||
r($executions) && p('641:totalEstimate,totalConsumed,totalLeft,progress,totalReal') && e('1,3,1,75,4'); // 查看计算后的执行工时汇总信息
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::create();
|
||||
title=测试 projectModel->create();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -55,10 +55,10 @@ $moreThanParent = $data;
|
||||
$moreThanParent['parent'] = '1';
|
||||
$moreThanParent['begin'] = '2018-01-01';
|
||||
|
||||
r($project->create($normalProject)) && p('name') && e('测试新增项目一'); // 创建新项目
|
||||
r($project->create($emptyNameProject)) && p('message[name]:0') && e('『项目名称』不能为空。'); // 项目名称为空时
|
||||
r($project->create($emptyBeginProject)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 项目的开始时间为空
|
||||
r($project->create($emptyEndProject)) && p('message[end]:0') && e('『计划完成』不能为空。'); // 项目的完成时间为空
|
||||
r($project->create($beginGtEndProject)) && p('message[end]:0') && e('『计划完成』应当大于『2022-01-12』。'); // 项目的计划完成时间大于计划开始时间
|
||||
r($project->create($moreThanParent)) && p('message:begin;message:end') && e('父项目的开始日期:2022-01-16,开始日期不能小于父项目的开始日期'); // 项目的完成日期大于父项目的完成日期(需要实时更新日期)
|
||||
r($project->create($normalProject)) && p('name') && e('测试新增项目一'); // 创建新项目
|
||||
r($project->create($emptyNameProject)) && p('message[name]:0') && e('『项目名称』不能为空。'); // 项目名称为空时
|
||||
r($project->create($emptyEndProject)) && p('message[end]:0') && e('『计划完成』不能为空。'); // 项目的完成时间为空
|
||||
r($project->create($beginGtEndProject)) && p('message[end]:0') && e('『计划完成』应当大于『2022-02-07』。'); // 项目的计划完成时间大于计划开始时间
|
||||
r($project->create($emptyBeginProject)) && p('message:begin') && e('项目集的最小开始日期:2022-02-07,项目的开始日期不能小于项目集的最小开始日期'); // 项目的开始时间为空
|
||||
r($project->create($moreThanParent)) && p('message:begin;message:end') && e('项目集的最小开始日期:2022-02-07,项目的开始日期不能小于项目集的最小开始日期;'); // 项目的完成日期大于父项目的完成日期(需要实时更新日期)
|
||||
system("./ztest init");
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::getDataByProject();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取parent为11首个项目的id >> 129
|
||||
获取parent为11的首个项目的id >> 130
|
||||
获取parent为11的首个项目的id >> 131
|
||||
获取parent为10000的首个项目的id >> 0
|
||||
获取parent为131的首个版本的id >> 1
|
||||
获取parent为132的首个版本的id >> 6
|
||||
获取parent为10000的首个版本的id >> 0
|
||||
获取parent为132的首个发布的id >> 1
|
||||
获取parent为132的首个发布的id >> 6
|
||||
获取parent为10000的首个发布的id >> 0
|
||||
|
||||
*/
|
||||
|
||||
/* 还有case bug testtask doc表要写,暂时表中没数据 */
|
||||
|
||||
$t = new Project('admin');
|
||||
|
||||
$PID = array(39, 40, 'sprint', 41, 'stage', 10000, 131, 132, 10000, 131, 132, 10000);
|
||||
|
||||
r($t->getExecutionData($PID[0])) && p('id') && e('129'); //获取parent为11首个项目的id
|
||||
r($t->getExecutionData($PID[1], $PID[2])) && p('id') && e('130'); //获取parent为11的首个项目的id
|
||||
r($t->getExecutionData($PID[3], $PID[4])) && p('id') && e('131'); //获取parent为11的首个项目的id
|
||||
r($t->getExecutionData($PID[5])) && p('id') && e('0'); //获取parent为10000的首个项目的id
|
||||
r($t->getBuildData($PID[6])) && p('id') && e('1'); //获取parent为131的首个版本的id
|
||||
r($t->getBuildData($PID[7])) && p('id') && e('6'); //获取parent为132的首个版本的id
|
||||
r($t->getBuildData($PID[8])) && p('id') && e('0'); //获取parent为10000的首个版本的id
|
||||
r($t->getReleaseData($PID[9])) && p('id') && e('1'); //获取parent为132的首个发布的id
|
||||
r($t->getReleaseData($PID[10])) && p('id') && e('6'); //获取parent为132的首个发布的id
|
||||
r($t->getReleaseData($PID[11])) && p('id') && e('0'); //获取parent为10000的首个发布的id
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->getMembers2Import();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$members = $tester->project->getMembers2Import(11, array('admin'));
|
||||
|
||||
r(count($members)) && p() && e('1'); // 获取id为11的项目团队成员个数,排除admin
|
||||
r($members) && p('pm92:role') && e('产品经理92'); // 获取id为11的项目团队成员的角色
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::getStats();
|
||||
title=测试 projectModel->getStats();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -18,13 +18,21 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$t = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$OpenImplement = array('all', 'undone', 'doing', 'wait', '11', '12');
|
||||
|
||||
r($t->getByStatusExe($OpenImplement[0])) && p() && e('630'); //查看所有执行
|
||||
r($t->getByStatusExe($OpenImplement[1])) && p() && e('0'); //查看未完成的执行
|
||||
r($t->getByStatusExe($OpenImplement[2])) && p() && e('315'); //查看所有进行中的执行
|
||||
r($t->getByStatusExe($OpenImplement[3])) && p() && e('315'); //查看所有进行中的执行
|
||||
r($t->getByProject($OpenImplement[4])) && p() && e('7'); //查看id为11项目的执行
|
||||
r($t->getByProject($OpenImplement[5])) && p() && e('7'); //查看id为12项目的执行
|
||||
$allExecutions = $tester->project->getStats(0, 'all');
|
||||
$undoneExecutions = $tester->project->getStats(0, 'undone');
|
||||
$doingExecutions = $tester->project->getStats(0, 'doing');
|
||||
$waitExecutions = $tester->project->getStats(0, 'wait');
|
||||
$project11Executions = $tester->project->getStats(11);
|
||||
$project12Executions = $tester->project->getStats(12);
|
||||
|
||||
r(count($allExecutions)) && p() && e('630'); // 查看所有执行数量
|
||||
r(count($undoneExecutions)) && p() && e('630'); // 查看未完成的执行数量
|
||||
r(count($doingExecutions)) && p() && e('315'); // 查看所有进行中的执行数量
|
||||
r(count($waitExecutions)) && p() && e('315'); // 查看所有进行中的执行数量
|
||||
r(count($project11Executions)) && p() && e('7'); // 查看id为11项目的执行数量
|
||||
r(count($project12Executions)) && p() && e('7'); // 查看id为12项目的执行数量
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->getStats4Kanban();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
$kanbanGroup = $tester->project->getStats4Kanban();
|
||||
|
||||
r(count($kanbanGroup['kanbanGroup'])) && p() && e('2'); //统计获取到的看板数据的分组数量
|
||||
r(count($kanbanGroup['kanbanGroup']['other'])) && p() && e('11'); //统计获取到的看板数据的其他数量
|
||||
r(count($kanbanGroup['kanbanGroup']['other'][1]['wait'])) && p() && e('3'); //统计获取到的看板数据的其他下的项目集1下的wait的项目数量
|
||||
r(count($kanbanGroup['kanbanGroup']['other'][1]['doing'])) && p() && e('4'); //统计获取到的看板数据的其他下的项目集1下的doing的项目数量
|
||||
@@ -1,22 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::getTeamMembers();
|
||||
title=测试 projectModel->getTeamMemberPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取id为11的项目团队成员个数 >> 2
|
||||
获取id为1的项目团队成员个数 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$getIdNub = array(11, 1);
|
||||
$members = $tester->project->getTeamMemberPairs(11);
|
||||
|
||||
r($project->getTeamMemberPairs($getIdNub[0])) && p() && e('2'); //获取id为11的项目团队成员个数
|
||||
r($project->getTeamMemberPairs($getIdNub[1])) && p() && e('0'); //获取id为1的项目团队成员个数
|
||||
r(count($members)) && p() && e('3'); // 获取id为11的项目团队成员个数
|
||||
r($members) && p('pm92') && e('产品经理92'); // 获取id为11的项目团队成员的详细信息
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,9 +14,10 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$getNu = array(11, array('admin', 'pm92'), 11, array('admin'), true);
|
||||
$members = $tester->project->getTeamMembers(11);
|
||||
|
||||
r($project->getTeamMembers($getNu[0], $getNu[1])) && p() && e('2'); //获取id为11的项目团队成员个数
|
||||
r($project->getTeamMembers($getNu[2], $getNu[3], $getNu[4])) && p() && e('1'); //获取id为11的项目团队成员个数,开启新手引导
|
||||
r(count($members)) && p() && e('2'); // 获取id为11的项目团队成员个数
|
||||
r($members) && p('pm92:role,totalHours,realname') && e('项目经理,343.0,产品经理92'); // 获取id为11的项目团队成员的详细信息
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->unlinkMember();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$_POST['accounts'] = array('test2', 'user10', 'dev1');
|
||||
$_POST['roles'] = array('测试', '市场', '研发');
|
||||
$_POST['days'] = array('10', '12', '11');
|
||||
$_POST['hours'] = array('7.5', '8', '8.5');
|
||||
$_POST['removeExecution'] = 'no';
|
||||
|
||||
$tester->project->manageMembers(11);
|
||||
$members = $tester->project->getTeamMemberPairs(11);
|
||||
|
||||
r(count($members)) && p('') && e('4'); // 查看维护团队之后的成员数量
|
||||
r($members) && p('dev1') && e('开发1'); // 查看维护团队之后的成员详情
|
||||
r($members) && p('test2') && e('测试2'); // 查看维护团队之后的成员详情
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->start();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
$_POST['end'] = '2023-07-01';
|
||||
|
||||
$changes1 = $tester->project->putoff(81);
|
||||
$changes2 = $tester->project->putoff(0);
|
||||
|
||||
r($changes1[0]) && p('new') && e('2023-07-01'); // 延期ID为81的项目,查看延期后的日期
|
||||
r($changes2) && p() && e('0'); // 延期ID为0的项目,返回空
|
||||
system("./ztest init");
|
||||
@@ -2,26 +2,20 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::start();
|
||||
title=测试 projectModel->start();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
开始id为81状态是suspended的项目(代码缺失elBegan参数,报警告) >> 1
|
||||
开始id为83状态是wait的项目 >> 1
|
||||
开始id为82状态是closed的项目 >> 0
|
||||
开始id为85状态是doing的项目 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
$project = new Project();
|
||||
|
||||
$statusId = array(81, 83, 82, 85);
|
||||
|
||||
r($project->checkStatusBegin($statusId[0])) && p() && e('1'); // 开始id为81状态是suspended的项目(代码缺失elBegan参数,报警告)
|
||||
r($project->checkStatusBegin($statusId[1])) && p() && e('1'); // 开始id为83状态是wait的项目
|
||||
r($project->checkStatusBegin($statusId[2])) && p() && e('0'); // 开始id为82状态是closed的项目
|
||||
r($project->checkStatusBegin($statusId[3])) && p() && e('0'); // 开始id为85状态是doing的项目
|
||||
system("./ztest init");
|
||||
r($project->start(81)) && p('name,status') && e('项目71,doing'); // 开始id为81状态是suspended的项目
|
||||
r($project->start(82)) && p() && e('0'); // 开始id为82状态是closed的项目
|
||||
r($project->start(83)) && p('name,status') && e('项目73,doing'); // 开始id为83状态是wait的项目
|
||||
r($project->start(85)) && p() && e('0'); // 开始id为85状态是doing的项目
|
||||
system("./ztest init");
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::suspend();
|
||||
title=测试 projectModel->suspend();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
暂停id为56状态是doing的项目 >> 1
|
||||
暂停id为73状态是suspended的项目 >> 0
|
||||
暂停id为74状态是closed的项目 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$t = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
r($t->checkStatusStop(56)) && p() && e('1'); // 暂停id为56状态是doing的项目
|
||||
r($t->checkStatusStop(73)) && p() && e('0'); // 暂停id为73状态是suspended的项目
|
||||
r($t->checkStatusStop(74)) && p() && e('0'); // 暂停id为74状态是closed的项目
|
||||
system("./ztest init");
|
||||
$changes1 = $tester->project->suspend(56);
|
||||
$changes2 = $tester->project->suspend(73);
|
||||
$changes3 = $tester->project->suspend(74);
|
||||
|
||||
r($changes1[0]) && p('new') && e('suspended'); // 挂起id为56状态是doing的项目
|
||||
r($changes2[0]) && p('field') && e('suspendedDate'); // 挂起id为73状态是suspended的项目
|
||||
r($changes3[0]) && p('new') && e('suspended'); // 挂起id为74状态是closed的项目
|
||||
system("./ztest init");
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->unlinkMember();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$beforeMembers = $tester->project->getTeamMemberPairs(11);
|
||||
$tester->project->unlinkMember(11, 'admin', false);
|
||||
$afterMembers = $tester->project->getTeamMemberPairs(11);
|
||||
|
||||
r(count($beforeMembers)) && p('') && e('3'); // 查看移除团队成员之前的ID为11的项目团队成员数量
|
||||
r(count($afterMembers)) && p('') && e('2'); // 查看移除团队成员之后的ID为11的项目团队成员数量
|
||||
r($beforeMembers) && p('pm92') && e('产品经理92'); // 查看项目ID为11的团队成员的真实姓名
|
||||
r($afterMembers) && p('pm92') && e('产品经理92'); // 查看项目ID为11的团队成员的真实姓名
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::update();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
更新id为10的项目信息 >> 测试更新项目十
|
||||
当计划开始为空时更新项目信息 >> 『计划开始』不能为空。
|
||||
当计划完成为空时更新项目信息 >> 『计划完成』不能为空。
|
||||
当计划完成小于计划开始时 >> 『计划完成』应当大于『2020-10-10』。
|
||||
项目名称已经存在时 >> 『项目名称』已经有『项目1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
|
||||
项目开始时间小于父项目时 >> 父项目的开始日期:2019-09-09,开始日期不能小于父项目的开始日期;父项目的完成日期:2019-09-09,完成日期不能大于父项目的完成日期
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->app->loadConfig('execution');
|
||||
|
||||
$project = new Project();
|
||||
|
||||
$data = array(
|
||||
'parent' => '0',
|
||||
'name' => '测试更新项目十',
|
||||
'begin' => '2020-10-10',
|
||||
'end' => '2022-06-01',
|
||||
'acl' => 'private',
|
||||
'budget' => '100',
|
||||
'budgetUnit' => 'CNY',
|
||||
'PM' => 'admin',
|
||||
'products' => array(1, 2, 3),
|
||||
'whitelist' => array('dev10', 'dev12')
|
||||
);
|
||||
|
||||
$normalProject = $data;
|
||||
|
||||
$noProductProject = $data;
|
||||
$noProductProject['products'] = array();
|
||||
|
||||
$emptyTitleProject = $data;
|
||||
$emptyTitleProject['name'] = '';
|
||||
|
||||
$emptyBeginProject = $data;
|
||||
$emptyBeginProject['begin'] = '';
|
||||
|
||||
$emptyEndProject = $data;
|
||||
$emptyEndProject['end'] = '';
|
||||
|
||||
$beginGtEndProject = $data;
|
||||
$beginGtEndProject['begin'] = '2022-07-01';
|
||||
|
||||
$beginLtParentProject = $data;
|
||||
$beginLtParentProject['parent'] = '9';
|
||||
$beginLtParentProject['begin'] = '2019-01-01';
|
||||
|
||||
r($project->update(10, $normalProject)) && p('name') && e('测试更新项目十'); // 正常更新项目的情况
|
||||
r($project->update(10, $noProductProject)) && p('message:0') && e('最少关联一个产品'); // 未关联产品的项目
|
||||
r($project->update(10, $emptyTitleProject)) && p('message[name]:0') && e('『项目名称』不能为空。'); // 更新项目名称为空时
|
||||
r($project->update(10, $emptyBeginProject)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 当计划完成为空时更新项目信息
|
||||
r($project->update(10, $emptyEndProject)) && p('message[end]:0') && e('『计划完成』不能为空。'); // 当计划完成小于计划开始时
|
||||
r($project->update(10, $beginGtEndProject)) && p('message[end]:0') && e('『计划完成』应当大于『2022-07-01』。'); // 父项目的开始日期大于子项目的开始日期时
|
||||
r($project->update(10, $beginLtParentProject)) && p('message:begin;message:end') && e('项目集的最小开始日期:2022-02-15,项目的开始日期不能小于项目集的最小开始日期;项目集的最大完成日期:2022-04-22,项目的完成日期不能大于项目集的最大完成日期'); // 项目开始、结束日期和子项目不符的情况
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->updateProductProgram();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$productIdList = array(1, 2, 3, 4);
|
||||
$tester->project->updateProductProgram(7, 1, $productIdList);
|
||||
|
||||
$products = $tester->loadModel('product')->getByIdList($productIdList);
|
||||
|
||||
r(count($products)) && p('') && e('4'); // 查看被更新了项目集的产品数量
|
||||
r($products) && p('1:program,name') && e('1,正常产品1'); // 查看被更新了项目集的产品详情
|
||||
r($products) && p('2:program,name') && e('1,正常产品2'); // 查看被更新了项目集的产品详情
|
||||
r($products) && p('3:program,name') && e('1,正常产品3'); // 查看被更新了项目集的产品详情
|
||||
r($products) && p('4:program,name') && e('1,正常产品4'); // 查看被更新了项目集的产品详情
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->updateProducts();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
$tester->loadModel('product');
|
||||
|
||||
$beforeProducts = $tester->product->getProductPairsByProject(11);
|
||||
|
||||
$productIdList = array(1, 2, 3, 4);
|
||||
$tester->project->updateProducts(11, $productIdList);
|
||||
|
||||
$afterProducts = $tester->product->getProductPairsByProject(11);
|
||||
|
||||
r(count($beforeProducts)) && p() && e('3'); // 查看更新项目关联的产品之前的产品数量
|
||||
r(count($afterProducts)) && p() && e('4'); // 查看更新项目关联的产品之后的产品数量
|
||||
r($beforeProducts) && p('81') && e('多平台产品81'); // 查看更新项目关联的产品之前的产品名称
|
||||
r($afterProducts) && p('4') && e('正常产品4'); // 查看更新项目关联的产品之后的产品名称
|
||||
system("./ztest init");
|
||||
Reference in New Issue
Block a user