Merge branch 'sprint/tianshujie_case' into 'master'

* Add and modify test case of execution module.

See merge request easycorp/zentaopms!5265
This commit is contained in:
王怡栋
2022-09-05 07:46:17 +00:00
14 changed files with 78 additions and 320 deletions
+19 -138
View File
@@ -363,76 +363,6 @@ class executionTest
}
}
/**
* Check the workload format and total.
*
* @param int $executionID
* @param string $type
* @param int $percent
* @access public
* @return bool
*/
public function checkWorkloadTest($executionID = 0, $type = '', $percent = 0)
{
global $tester;
$tester->app->loadLang('programplan');
$_POST['products'] = array(1, 81, 91);
$_POST['percent'] = $percent;
$_POST['parent'] = 0;
$oldExecution = $executionID ? $this->objectModel->getByID($executionID) : '';
if(!empty($oldExecution->parent)) $_POST['parent'] = $oldExecution->parent;
$result = $this->objectModel->checkWorkload($type, $percent, $oldExecution);
if(dao::isError()) return dao::getError(true);
return $result;
}
/**
* Check begin and end date.
*
* @param int $projectID
* @param string $checkType empty|normal|gt|lt|eq
* @access public
* @return bool
*/
public function checkBeginAndEndDateTest($projectID, $checkType)
{
if($projectID) $project = $this->objectModel->getByID($projectID);
switch($checkType)
{
case 'empty':
$_POST['begin'] = '';
$_POST['end'] = '';
break;
case 'normal':
$_POST['begin'] = empty($project->begin) ? '' : date("Y-m-d",strtotime("+1 days",strtotime($project->begin)));
$_POST['end'] = empty($project->end) ? '' : date("Y-m-d",strtotime("-1 days",strtotime($project->end)));
break;
case 'lt':
$_POST['begin'] = empty($project->begin) ? '' : date("Y-m-d",strtotime("-1 days",strtotime($project->begin)));
$_POST['end'] = empty($project->end) ? '' : date("Y-m-d",strtotime("-1 days",strtotime($project->end)));
break;
case 'gt':
$_POST['begin'] = empty($project->begin) ? '' : date("Y-m-d",strtotime("+1 days",strtotime($project->begin)));
$_POST['end'] = empty($project->end) ? '' : date("Y-m-d",strtotime("+1 days",strtotime($project->end)));
break;
case 'eq':
$_POST['begin'] = empty($project->begin) ? '' : $project->begin;
$_POST['end'] = empty($project->end) ? '' : $project->end;
break;
}
$begin = $_POST['begin'];
$end = $_POST['end'];
$this->objectModel->checkBeginAndEndDate($projectID, $begin, $end);
if(dao::isError()) return dao::getError(true);
return true;
}
/**
* function getPairs test by execution
*
@@ -1225,6 +1155,25 @@ class executionTest
}
}
/**
* Link all stories by execution.
*
* @param int $executionID
* @param int $productID
* @param int $planID
* @access public
* @return int
*/
public function linkStoriesTest($executionID, $productID = 0, $planID = 0)
{
global $tester;
if($planID) $tester->dao->update(TABLE_PROJECTPRODUCT)->set('plan')->eq($planID)->where('project')->eq($executionID)->andWhere('product')->eq($productID)->exec();
$this->objectModel->linkStories($executionID);
$objects = $tester->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($executionID)->andWhere('product')->eq($productID)->fetchAll();
return count($objects);
}
/**
* function linkCases test by execution
*
@@ -1398,41 +1347,6 @@ class executionTest
}
}
/**
* function getTeamSkip test by execution
*
* @param string $taskID
* @param string $begin
* @param string $end
* @access public
* @return array
*/
public function getTeamSkipTest($taskID, $begin, $end)
{
global $tester;
$teams = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($taskID)->andWhere('type')->eq('task')->orderBy('order')->fetchAll('account');
$object = $this->objectModel->getTeamSkip($teams, $begin, $end);
if(dao::isError())
{
$error = dao::getError();
return $error;
}
else
{
if(empty($object))
{
return '无跳转数据';
}
else
{
return $object;
}
}
}
/**
* function getTeams2Import test by execution
*
@@ -2208,39 +2122,6 @@ class executionTest
}
}
/**
* Test get execution burn data.
*
* @param array $executionIDList
* @access public
* @return array
*/
public function getBurnDataTest($executionIDList)
{
global $tester;
$executions = $this->objectModel->getByIdList($executionIDList);
$objects = $this->objectModel->getBurnData($executions);
$returns = array();
foreach($objects as $executionID => $burnData)
{
$returns[$executionID] = '';
foreach($burnData as $data) $returns[$executionID] .= ",$data->value";
$returns[$executionID] = trim($returns[$executionID], ',');
}
if(dao::isError())
{
$error = dao::getError();
return $error;
}
else
{
return $returns;
}
}
/**
* Test get begin and end for CFD.
*
@@ -1,30 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
su('admin');
/**
title=测试 executionModel->checkBeginAndEndDate();
cid=1
pid=1
测试传入空值 >> 1
测试检查正常的日期 >> 1
测试检查小于开始的日期 >> 迭代开始日期应大于等于项目的开始日期:2022-05-26。\n
测试检查大于开始的日期 >> 迭代截止日期应小于等于项目的截止日期:2022-09-30。\n
测试检查等于开始跟结束的日期 >> 1
*/
$projectIdList = array(0, 11);
$checkType = array('empty', 'normal', 'lt', 'gt', 'eq');
$execution = new executionTest();
r($execution->checkBeginAndEndDateTest($projectIdList[0], $checkType[0])) && p() && e('1'); // 测试传入空值
r($execution->checkBeginAndEndDateTest($projectIdList[1], $checkType[1])) && p() && e('1'); // 测试检查正常的日期
r($execution->checkBeginAndEndDateTest($projectIdList[1], $checkType[2])) && p() && e('迭代开始日期应大于等于项目的开始日期:2022-05-26。\n'); // 测试检查小于开始的日期
r($execution->checkBeginAndEndDateTest($projectIdList[1], $checkType[3])) && p() && e('迭代截止日期应小于等于项目的截止日期:2022-09-30。\n'); // 测试检查大于开始的日期
r($execution->checkBeginAndEndDateTest($projectIdList[1], $checkType[4])) && p() && e('1'); // 测试检查等于开始跟结束的日期
-71
View File
@@ -1,71 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
su('admin');
/**
title=测试 executionModel->checkWorkload();
cid=1
pid=1
测试传入空数据 >> 0
测试创建迭代的工作量 >> 0
测试创建迭代的工作量 >> 工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n
测试创建迭代的工作量 >> "工作量比例"必须为数字\n
测试创建迭代的工作量 >> 0
测试更新迭代的工作量 >> 0
测试更新迭代的工作量 >> 工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n
测试更新迭代的工作量 >> "工作量比例"必须为数字\n
测试更新迭代的工作量 >> 0
测试创建阶段的工作量 >> 0
测试创建阶段的工作量 >> 工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n
测试创建阶段的工作量 >> "工作量比例"必须为数字\n
测试创建阶段的工作量 >> 0
测试更新阶段的工作量 >> 0
测试更新阶段的工作量 >> 工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n
测试更新阶段的工作量 >> "工作量比例"必须为数字\n
测试更新阶段的工作量 >> 0
测试创建看板的工作量 >> 0
测试创建看板的工作量 >> 工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n
测试创建看板的工作量 >> "工作量比例"必须为数字\n
测试创建看板的工作量 >> 0
测试更新看板的工作量 >> 0
测试更新看板的工作量 >> 工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n
测试更新看板的工作量 >> "工作量比例"必须为数字\n
测试更新看板的工作量 >> 0
*/
$executionIdList = array(0, 101, 131, 161);
$typeList = array('', 'create', 'update');
$percentList = array('0', '123', 'all', '10');
$execution = new executionTest();
r($execution->checkWorkloadTest($executionIdList[0], $typeList[0], $percentList[0])) && p() && e('0'); // 测试传入空数据
r($execution->checkWorkloadTest($executionIdList[1], $typeList[1], $percentList[0])) && p() && e('0'); // 测试创建迭代的工作量
r($execution->checkWorkloadTest($executionIdList[1], $typeList[1], $percentList[1])) && p() && e('工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n'); // 测试创建迭代的工作量
r($execution->checkWorkloadTest($executionIdList[1], $typeList[1], $percentList[2])) && p() && e('"工作量比例"必须为数字\n'); // 测试创建迭代的工作量
r($execution->checkWorkloadTest($executionIdList[1], $typeList[1], $percentList[3])) && p() && e('0'); // 测试创建迭代的工作量
r($execution->checkWorkloadTest($executionIdList[1], $typeList[2], $percentList[0])) && p() && e('0'); // 测试更新迭代的工作量
r($execution->checkWorkloadTest($executionIdList[1], $typeList[2], $percentList[1])) && p() && e('工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n'); // 测试更新迭代的工作量
r($execution->checkWorkloadTest($executionIdList[1], $typeList[2], $percentList[2])) && p() && e('"工作量比例"必须为数字\n'); // 测试更新迭代的工作量
r($execution->checkWorkloadTest($executionIdList[1], $typeList[2], $percentList[3])) && p() && e('0'); // 测试更新迭代的工作量
r($execution->checkWorkloadTest($executionIdList[2], $typeList[1], $percentList[0])) && p() && e('0'); // 测试创建阶段的工作量
r($execution->checkWorkloadTest($executionIdList[2], $typeList[1], $percentList[1])) && p() && e('工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n'); // 测试创建阶段的工作量
r($execution->checkWorkloadTest($executionIdList[2], $typeList[1], $percentList[2])) && p() && e('"工作量比例"必须为数字\n'); // 测试创建阶段的工作量
r($execution->checkWorkloadTest($executionIdList[2], $typeList[1], $percentList[3])) && p() && e('0'); // 测试创建阶段的工作量
r($execution->checkWorkloadTest($executionIdList[2], $typeList[2], $percentList[0])) && p() && e('0'); // 测试更新阶段的工作量
r($execution->checkWorkloadTest($executionIdList[2], $typeList[2], $percentList[1])) && p() && e('工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n'); // 测试更新阶段的工作量
r($execution->checkWorkloadTest($executionIdList[2], $typeList[2], $percentList[2])) && p() && e('"工作量比例"必须为数字\n'); // 测试更新阶段的工作量
r($execution->checkWorkloadTest($executionIdList[2], $typeList[2], $percentList[3])) && p() && e('0'); // 测试更新阶段的工作量
r($execution->checkWorkloadTest($executionIdList[3], $typeList[1], $percentList[0])) && p() && e('0'); // 测试创建看板的工作量
r($execution->checkWorkloadTest($executionIdList[3], $typeList[1], $percentList[1])) && p() && e('工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n'); // 测试创建看板的工作量
r($execution->checkWorkloadTest($executionIdList[3], $typeList[1], $percentList[2])) && p() && e('"工作量比例"必须为数字\n'); // 测试创建看板的工作量
r($execution->checkWorkloadTest($executionIdList[3], $typeList[1], $percentList[3])) && p() && e('0'); // 测试创建看板的工作量
r($execution->checkWorkloadTest($executionIdList[3], $typeList[2], $percentList[0])) && p() && e('0'); // 测试更新看板的工作量
r($execution->checkWorkloadTest($executionIdList[3], $typeList[2], $percentList[1])) && p() && e('工作量占比累计不应当超过100, 当前产品下的工作量之和为%\n'); // 测试更新看板的工作量
r($execution->checkWorkloadTest($executionIdList[3], $typeList[2], $percentList[2])) && p() && e('"工作量比例"必须为数字\n'); // 测试更新看板的工作量
r($execution->checkWorkloadTest($executionIdList[3], $typeList[2], $percentList[3])) && p() && e('0'); // 测试更新看板的工作量
-26
View File
@@ -1,26 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
su('admin');
/**
title=executionModel->getBurnData();
cid=1
pid=1
测试获取 执行ID 101 102 的燃尽图 >> 21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,36,36,36,36,36,36,36,36,36,36,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,null
测试获取 执行ID 101 103 111 的燃尽图 >> 21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,36,36,36,36,36,36,36,36,36,36,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,null
测试获取 执行ID 111 121 131 的燃尽图 >> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,null;17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,null
测试获取 执行ID 101 102 103 111 121 131 的燃尽图 >> 21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,36,36,36,36,36,36,36,36,36,36,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,null;17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,null
*/
$executionIDList = array(array(101, 102), array(101, 103, 111), array(111, 121, 131), array(101, 102, 103, 111, 121, 131));
$execution = new executionTest();
r($execution->getBurnDataTest($executionIDList[0])) && p('101;102') && e('21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,36,36,36,36,36,36,36,36,36,36,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,null'); // 测试获取 执行ID 101 102 的燃尽图
r($execution->getBurnDataTest($executionIDList[1])) && p('101;103;111') && e('21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,36,36,36,36,36,36,36,36,36,36,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,null'); // 测试获取 执行ID 101 103 111 的燃尽图
r($execution->getBurnDataTest($executionIDList[2])) && p('111;121;131') && e('0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,null;17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,null'); // 测试获取 执行ID 111 121 131 的燃尽图
r($execution->getBurnDataTest($executionIDList[3])) && p('101;102;103;111;121;131') && e('21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,36,36,36,36,36,36,36,36,36,36,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,4,4,4,4,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,23,23,23,23,23,23,23,23,23,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,null;0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,null;17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,null'); // 测试获取 执行ID 101 102 103 111 121 131 的燃尽图
View File
View File
View File
View File
+28 -28
View File
@@ -10,22 +10,22 @@ title=executionModel->getSearchTasks();
cid=1
pid=1
测试通过sql语句获取3个任务 id 倒序 execution = '101' and deleted = '0' and parent >= 0 >> 910:name:子任务10;909:name:子任务9,team:[930,920];908:name:子任务8,team:[919,929];
测试通过sql语句获取3个任务 id 正序 execution = '101' and deleted = '0' and parent >= 0 >> 1:name:开发任务11,team:[911,921];901:name:子任务1,team:[922,912];902:name:子任务2,team:[923,913];
测试通过sql语句获取5个任务 id 倒序 execution = '101' and deleted = '0' and parent >= 0 >> 910:name:子任务10;909:name:子任务9,team:[930,920];908:name:子任务8,team:[919,929];907:name:子任务7,team:[918,928];906:name:子任务6,team:[927,917];
测试通过sql语句获取5个任务 id 正序 execution = '101' and deleted = '0' and parent >= 0 >> 1:name:开发任务11,team:[911,921];901:name:子任务1,team:[922,912];902:name:子任务2,team:[923,913];903:name:子任务3,team:[914,924];904:name:子任务4,team:[915,925];
测试通过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,team:[911,921];
测试通过sql语句获取3个任务 id 正序 execution = '101' and story != '0' and parent >= 0 >> 1:name:开发任务11,team:[911,921];
测试通过sql语句获取5个任务 id 倒序 execution = '101' and story != '0' and parent >= 0 >> 1:name:开发任务11,team:[911,921];
测试通过sql语句获取5个任务 id 正序 execution = '101' and story != '0' and parent >= 0 >> 1:name:开发任务11,team:[911,921];
测试通过sql语句获取3个任务 id 倒序 module like '%2%' and type = 'design' and parent >= 0 >> 909:name:子任务9,team:[930,920];901:name:子任务1,team:[922,912];801:name:更多任务201;
测试通过sql语句获取3个任务 id 正序 module like '%2%' and type = 'design' and parent >= 0 >> 1:name:开发任务11,team:[911,921];65:name:开发任务75;73:name:开发任务83;
测试通过sql语句获取5个任务 id 倒序 module like '%2%' and type = 'design' and parent >= 0 >> 909:name:子任务9,team:[930,920];901:name:子任务1,team:[922,912];801:name:更多任务201;769:name:更多任务169;737:name:更多任务137;
测试通过sql语句获取5个任务 id 正序 module like '%2%' and type = 'design' and parent >= 0 >> 1:name:开发任务11,team:[911,921];65:name:开发任务75;73:name:开发任务83;81:name:开发任务91;89:name:开发任务99;
测试通过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;
*/
@@ -40,19 +40,19 @@ $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,team:[930,920];908:name:子任务8,team:[919,929];'); // 测试通过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,team:[911,921];901:name:子任务1,team:[922,912];902:name:子任务2,team:[923,913];'); // 测试通过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,team:[930,920];908:name:子任务8,team:[919,929];907:name:子任务7,team:[918,928];906:name:子任务6,team:[927,917];'); // 测试通过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,team:[911,921];901:name:子任务1,team:[922,912];902:name:子任务2,team:[923,913];903:name:子任务3,team:[914,924];904:name:子任务4,team:[915,925];'); // 测试通过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,team:[911,921];'); // 测试通过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,team:[911,921];'); // 测试通过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,team:[911,921];'); // 测试通过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,team:[911,921];'); // 测试通过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,team:[930,920];901:name:子任务1,team:[922,912];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,team:[911,921];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,team:[930,920];901:name:子任务1,team:[922,912];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,team:[911,921];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('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
@@ -10,7 +10,8 @@ title=测试 executionModel->getTaskGroupByExecution();
cid=1
pid=1
获取所有受限制的执行ID >> 1
测试空数据 >> 0
测试获取执行的任务 >> 3
*/
-26
View File
@@ -1,26 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
su('admin');
/**
title=测试executionModel->getTeamSkipTest();
cid=1
pid=1
正常跳过 >> 901,user92,研发
begin与end一致 >> 无跳转数据
end与begin一致 >> 无跳转数据
*/
$taskID = 901;
$begin = 'user92';
$end = 'user93';
$execution = new executionTest();
r($execution->getTeamSkipTest($taskID, $begin, $end)) && p('user92:root,account,role') && e('901,user92,研发'); // 正常跳过
r($execution->getTeamSkipTest($taskID, $begin, $begin)) && p() && e('无跳转数据'); // begin与end一致
r($execution->getTeamSkipTest($taskID, $end, $end)) && p() && e('无跳转数据'); // end与begin一致
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
$db->switchDB();
su('admin');
/**
title=测试executionModel->linkStoryTest();
cid=1
pid=1
敏捷执行关联需求 >> 2
瀑布执行关联需求 >> 0
看板执行关联需求 >> 0
*/
$executionIDList = array('101', '131', '161');
$productIDList = array('1', '0', '51');
$planIDList = array('100', '0', '52');
$execution = new executionTest();
r($execution->linkStoriesTest($executionIDList[0], $productIDList[0], $planIDList[0])) && p() && e('2'); // 敏捷执行关联需求
r($execution->linkStoriesTest($executionIDList[1], $productIDList[1], $planIDList[1])) && p() && e('0'); // 瀑布执行关联需求
r($execution->linkStoriesTest($executionIDList[2], $productIDList[2], $planIDList[2])) && p() && e('0'); // 看板执行关联需求
$db->restoreDB();
View File
View File