* Add auto test of bug.
This commit is contained in:
@@ -789,8 +789,8 @@ class bugTest
|
||||
/**
|
||||
* Test update a bug.
|
||||
*
|
||||
* @param mixed $bugID
|
||||
* @param array $param
|
||||
* @param int $bugID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
@@ -1044,6 +1044,7 @@ class bugTest
|
||||
*
|
||||
* @param array $bugIDList
|
||||
* @param int $branchID
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
@@ -1062,4 +1063,231 @@ class bugTest
|
||||
return !empty($object[$bugID]) ? $object[$bugID] : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch change module.
|
||||
*
|
||||
* @param array $bugIDList
|
||||
* @param int $moduleID
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function batchChangeModuleTest($bugIDList, $moduleID, $bugID)
|
||||
{
|
||||
$bugs = $this->objectModel->getByList($bugIDList);
|
||||
|
||||
$object = $this->objectModel->batchChangeModule($bugIDList, $moduleID, $bugs);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return !empty($object[$bugID]) ? $object[$bugID] : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch change plan.
|
||||
*
|
||||
* @param array $bugIDList
|
||||
* @param int $planID
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function batchChangePlanTest($bugIDList, $planID, $bugID)
|
||||
{
|
||||
$object = $this->objectModel->batchChangePlan($bugIDList, $planID);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return !empty($object[$bugID]) ? $object[$bugID] : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch resolve bugs.
|
||||
*
|
||||
* @param array $bugIDList
|
||||
* @param string $resolution
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function batchResolveTest($bugIDList, $resolution, $bugID)
|
||||
{
|
||||
$object = $this->objectModel->batchResolve($bugIDList, $resolution, 'trunk');
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return !empty($object[$bugID]) ? $object[$bugID] : 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test activate a bug.
|
||||
*
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function activateObject($bugID)
|
||||
{
|
||||
$change = $this->objectModel->activate($bugID, '');
|
||||
$_POST['assignedTo'] = 'admin';
|
||||
|
||||
if($change == array()) $change = '没有数据更新';
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $change;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test close a bug.
|
||||
*
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function closeObject($bugID)
|
||||
{
|
||||
$change = $this->objectModel->close($bugID, '');
|
||||
|
||||
if($change == array()) $change = '没有数据更新';
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $change;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test process the openedBuild and resolvedBuild fields for bugs.
|
||||
*
|
||||
* @param array $bugIDList
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function processBuildForBugsTest($bugIDList)
|
||||
{
|
||||
$bugs = $this->objectModel->getByList($bugIDList);
|
||||
$array = $this->objectModel->processBuildForBugs($bugs);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test extract accounts from some bugs.
|
||||
*
|
||||
* @param array $bugIDList
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function extractAccountsFromListTest($bugIDList)
|
||||
{
|
||||
$bugs = $this->objectModel->getByList($bugIDList);
|
||||
$array = $this->objectModel->extractAccountsFromList($bugs);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test extract accounts from a bug.
|
||||
*
|
||||
* @param int $bugID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function extractAccountsFromSingleTest($bugID)
|
||||
{
|
||||
$bug = $this->objectModel->getByID($bugID);
|
||||
$array = $this->objectModel->extractAccountsFromSingle($bug);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $array;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user bugs.
|
||||
*
|
||||
* @param string $account
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserBugsTest($account, $type = 'assignedTo')
|
||||
{
|
||||
$array = $this->objectModel->getUserBugs($account, $type);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return count($array);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get bug pairs of a user.
|
||||
*
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserBugPairsTest($account)
|
||||
{
|
||||
$array = $this->objectModel->getUserBugPairs($account);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return count($array);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
31
test/model/bug/activate.php
Executable file
31
test/model/bug/activate.php
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; su('admin');
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=bugModel->activate();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试激活状态为active的bug1 >> activatedCount,0,1
|
||||
测试激活状态为active的bug2 >> activatedCount,0,1
|
||||
测试激活状态为resolved的bug51 >> assignedTo,dev1,admin;activatedCount,0,1
|
||||
测试激活状态为resolved的bug52 >> assignedTo,dev1,admin;activatedCount,0,1
|
||||
测试激活状态为closed的bug81 >> assignedTo,test1,admin;activatedCount,0,1
|
||||
测试激活状态为closed的bug82 >> assignedTo,test1,admin;activatedCount,0,1
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$bugIDList = array('1', '2', '51', '52', '81', '82');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->activateObject($bugIDList[0])) && p('2:field,old,new') && e('activatedCount,0,1'); // 测试激活状态为active的bug1
|
||||
r($bug->activateObject($bugIDList[1])) && p('1:field,old,new') && e('activatedCount,0,1'); // 测试激活状态为active的bug2
|
||||
r($bug->activateObject($bugIDList[2])) && p('0:field,old,new;2:field,old,new') && e('assignedTo,dev1,admin;activatedCount,0,1'); // 测试激活状态为resolved的bug51
|
||||
r($bug->activateObject($bugIDList[3])) && p('0:field,old,new;2:field,old,new') && e('assignedTo,dev1,admin;activatedCount,0,1'); // 测试激活状态为resolved的bug52
|
||||
r($bug->activateObject($bugIDList[4])) && p('0:field,old,new;2:field,old,new') && e('assignedTo,test1,admin;activatedCount,0,1'); // 测试激活状态为closed的bug81
|
||||
r($bug->activateObject($bugIDList[5])) && p('0:field,old,new;2:field,old,new') && e('assignedTo,test1,admin;activatedCount,0,1'); // 测试激活状态为closed的bug82
|
||||
system("./ztest init");
|
||||
73
test/model/bug/batchchangemodule.php
Executable file
73
test/model/bug/batchchangemodule.php
Executable file
@@ -0,0 +1,73 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试bugModel->batchChangeModule();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
修改bug1 2模块为0 >> module,1821,0
|
||||
修改bug1 2模块为8 >> module,0,8
|
||||
修改bug1 2模块为9 >> module,8,9
|
||||
修改bug1 2模块为10 >> module,9,10
|
||||
修改bug1 2模块为11 >> module,10,11
|
||||
修改bug1 2模块为11 未发生变化 >> 0
|
||||
修改bug1 3模块为0 >> module,11,0
|
||||
修改bug1 3模块为8 >> module,0,8
|
||||
修改bug1 3模块为9 >> module,8,9
|
||||
修改bug1 3模块为10 >> module,9,10
|
||||
修改bug1 3模块为11 >> module,10,11
|
||||
修改bug1 3模块为11 未发生变化 >> 0
|
||||
修改bug1 4模块为0 >> module,11,0
|
||||
修改bug1 4模块为8 >> module,0,8
|
||||
修改bug1 4模块为9 >> module,8,9
|
||||
修改bug1 4模块为10 >> module,9,10
|
||||
修改bug1 4模块为11 >> module,10,11
|
||||
修改bug1 4模块为11 未发生变化 >> 0
|
||||
修改bug2 3模块为0 >> module,11,0
|
||||
修改bug2 3模块为8 >> module,0,8
|
||||
修改bug2 3模块为9 >> module,8,9
|
||||
修改bug2 3模块为10 >> module,9,10
|
||||
修改bug2 3模块为11 >> module,10,11
|
||||
修改bug2 3模块为11 未发生变化 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$bugIDList1 = array('1', '2');
|
||||
$bugIDList2 = array('1', '3');
|
||||
$bugIDList3 = array('1', '4');
|
||||
$bugIDList4 = array('2', '3');
|
||||
|
||||
$moduleList = array('0', '8', '9', '10', '11');
|
||||
|
||||
|
||||
$bug = new bugTest();
|
||||
r($bug->batchChangeModuleTest($bugIDList1, $moduleList[0], $bugIDList1[0])) && p('0:field,old,new') && e('module,1821,0');// 修改bug1 2模块为0
|
||||
r($bug->batchChangeModuleTest($bugIDList1, $moduleList[1], $bugIDList1[1])) && p('0:field,old,new') && e('module,0,8'); // 修改bug1 2模块为8
|
||||
r($bug->batchChangeModuleTest($bugIDList1, $moduleList[2], $bugIDList1[0])) && p('0:field,old,new') && e('module,8,9'); // 修改bug1 2模块为9
|
||||
r($bug->batchChangeModuleTest($bugIDList1, $moduleList[3], $bugIDList1[1])) && p('0:field,old,new') && e('module,9,10'); // 修改bug1 2模块为10
|
||||
r($bug->batchChangeModuleTest($bugIDList1, $moduleList[4], $bugIDList1[0])) && p('0:field,old,new') && e('module,10,11'); // 修改bug1 2模块为11
|
||||
r($bug->batchChangeModuleTest($bugIDList1, $moduleList[4], $bugIDList1[1])) && p() && e('0'); // 修改bug1 2模块为11 未发生变化
|
||||
r($bug->batchChangeModuleTest($bugIDList2, $moduleList[0], $bugIDList2[0])) && p('0:field,old,new') && e('module,11,0'); // 修改bug1 3模块为0
|
||||
r($bug->batchChangeModuleTest($bugIDList2, $moduleList[1], $bugIDList2[1])) && p('0:field,old,new') && e('module,0,8'); // 修改bug1 3模块为8
|
||||
r($bug->batchChangeModuleTest($bugIDList2, $moduleList[2], $bugIDList2[0])) && p('0:field,old,new') && e('module,8,9'); // 修改bug1 3模块为9
|
||||
r($bug->batchChangeModuleTest($bugIDList2, $moduleList[3], $bugIDList2[1])) && p('0:field,old,new') && e('module,9,10'); // 修改bug1 3模块为10
|
||||
r($bug->batchChangeModuleTest($bugIDList2, $moduleList[4], $bugIDList2[0])) && p('0:field,old,new') && e('module,10,11'); // 修改bug1 3模块为11
|
||||
r($bug->batchChangeModuleTest($bugIDList2, $moduleList[4], $bugIDList2[1])) && p() && e('0'); // 修改bug1 3模块为11 未发生变化
|
||||
r($bug->batchChangeModuleTest($bugIDList3, $moduleList[0], $bugIDList3[0])) && p('0:field,old,new') && e('module,11,0'); // 修改bug1 4模块为0
|
||||
r($bug->batchChangeModuleTest($bugIDList3, $moduleList[1], $bugIDList3[1])) && p('0:field,old,new') && e('module,0,8'); // 修改bug1 4模块为8
|
||||
r($bug->batchChangeModuleTest($bugIDList3, $moduleList[2], $bugIDList3[0])) && p('0:field,old,new') && e('module,8,9'); // 修改bug1 4模块为9
|
||||
r($bug->batchChangeModuleTest($bugIDList3, $moduleList[3], $bugIDList3[1])) && p('0:field,old,new') && e('module,9,10'); // 修改bug1 4模块为10
|
||||
r($bug->batchChangeModuleTest($bugIDList3, $moduleList[4], $bugIDList3[0])) && p('0:field,old,new') && e('module,10,11'); // 修改bug1 4模块为11
|
||||
r($bug->batchChangeModuleTest($bugIDList3, $moduleList[4], $bugIDList3[1])) && p() && e('0'); // 修改bug1 4模块为11 未发生变化
|
||||
r($bug->batchChangeModuleTest($bugIDList4, $moduleList[0], $bugIDList4[0])) && p('0:field,old,new') && e('module,11,0'); // 修改bug2 3模块为0
|
||||
r($bug->batchChangeModuleTest($bugIDList4, $moduleList[1], $bugIDList4[1])) && p('0:field,old,new') && e('module,0,8'); // 修改bug2 3模块为8
|
||||
r($bug->batchChangeModuleTest($bugIDList4, $moduleList[2], $bugIDList4[0])) && p('0:field,old,new') && e('module,8,9'); // 修改bug2 3模块为9
|
||||
r($bug->batchChangeModuleTest($bugIDList4, $moduleList[3], $bugIDList4[1])) && p('0:field,old,new') && e('module,9,10'); // 修改bug2 3模块为10
|
||||
r($bug->batchChangeModuleTest($bugIDList4, $moduleList[4], $bugIDList4[0])) && p('0:field,old,new') && e('module,10,11'); // 修改bug2 3模块为11
|
||||
r($bug->batchChangeModuleTest($bugIDList4, $moduleList[4], $bugIDList4[1])) && p() && e('0'); // 修改bug2 3模块为11 未发生变化
|
||||
system("./ztest init");
|
||||
49
test/model/bug/batchchangeplan.php
Executable file
49
test/model/bug/batchchangeplan.php
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试bugModel->batchChangePlan();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
修改计划为0 未发生变化 >> 0
|
||||
修改计划为计划1 >> plan,0,1
|
||||
修改计划为计划2 >> plan,1,2
|
||||
修改计划为0 未发生变化 >> 0
|
||||
修改计划为计划1 >> plan,0,1
|
||||
修改计划为计划2 >> plan,1,2
|
||||
修改计划为0 未发生变化 >> 0
|
||||
修改计划为计划1 >> plan,0,1
|
||||
修改计划为计划2 >> plan,1,2
|
||||
修改计划为0 未发生变化 >> 0
|
||||
修改计划为计划1 >> plan,0,1
|
||||
修改计划为计划2 >> plan,1,2
|
||||
|
||||
*/
|
||||
|
||||
$bugIDList1 = array('136', '137', '138');
|
||||
$bugIDList2 = array('133', '134', '135');
|
||||
$bugIDList3 = array('130', '131', '132');
|
||||
$bugIDList4 = array('175', '176', '177');
|
||||
|
||||
$planList = array('0', '1', '2');
|
||||
|
||||
|
||||
$bug = new bugTest();
|
||||
r($bug->batchChangePlanTest($bugIDList1, $planList[0], $bugIDList1[0])) && p() && e('0'); // 修改计划为0 未发生变化
|
||||
r($bug->batchChangePlanTest($bugIDList1, $planList[1], $bugIDList1[1])) && p('0:field,old,new') && e('plan,0,1'); // 修改计划为计划1
|
||||
r($bug->batchChangePlanTest($bugIDList1, $planList[2], $bugIDList1[2])) && p('0:field,old,new') && e('plan,1,2'); // 修改计划为计划2
|
||||
r($bug->batchChangePlanTest($bugIDList2, $planList[0], $bugIDList2[0])) && p() && e('0'); // 修改计划为0 未发生变化
|
||||
r($bug->batchChangePlanTest($bugIDList2, $planList[1], $bugIDList2[1])) && p('0:field,old,new') && e('plan,0,1'); // 修改计划为计划1
|
||||
r($bug->batchChangePlanTest($bugIDList2, $planList[2], $bugIDList2[2])) && p('0:field,old,new') && e('plan,1,2'); // 修改计划为计划2
|
||||
r($bug->batchChangePlanTest($bugIDList3, $planList[0], $bugIDList3[0])) && p() && e('0'); // 修改计划为0 未发生变化
|
||||
r($bug->batchChangePlanTest($bugIDList3, $planList[1], $bugIDList3[1])) && p('0:field,old,new') && e('plan,0,1'); // 修改计划为计划1
|
||||
r($bug->batchChangePlanTest($bugIDList3, $planList[2], $bugIDList3[2])) && p('0:field,old,new') && e('plan,1,2'); // 修改计划为计划2
|
||||
r($bug->batchChangePlanTest($bugIDList4, $planList[0], $bugIDList4[0])) && p() && e('0'); // 修改计划为0 未发生变化
|
||||
r($bug->batchChangePlanTest($bugIDList4, $planList[1], $bugIDList4[1])) && p('0:field,old,new') && e('plan,0,1'); // 修改计划为计划1
|
||||
r($bug->batchChangePlanTest($bugIDList4, $planList[2], $bugIDList4[2])) && p('0:field,old,new') && e('plan,1,2'); // 修改计划为计划2
|
||||
system("./ztest init");
|
||||
47
test/model/bug/batchresolve.php
Executable file
47
test/model/bug/batchresolve.php
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试bugModel->batchResolve();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
解决bug1 2 3,解决方式为bydesign >> resolution,,bydesign;status,active,resolved
|
||||
解决bug4 5 6,解决方式为duplicate >> resolution,,duplicate;status,active,resolved
|
||||
解决bug7 8 9,解决方式为external >> resolution,,external;status,active,resolved
|
||||
解决bug10 11 12,解决方式为fixed >> resolution,,fixed;status,active,resolved
|
||||
解决bug13 14 15,解决方式为notrepro >> resolution,,notrepro;status,active,resolved
|
||||
解决bug16 17 18,解决方式为postponed >> resolution,,postponed;status,active,resolved
|
||||
解决bug19 20 21,解决方式为willnotfix >> resolution,,willnotfix;status,active,resolved
|
||||
解决bug22 23 24,解决方式为tostory >> resolution,,tostory;status,active,resolved
|
||||
解决bug状态为resolve的bug >> 0
|
||||
|
||||
*/
|
||||
|
||||
$bugIDList1 = array('1', '2', '3');
|
||||
$bugIDList2 = array('4', '5', '6');
|
||||
$bugIDList3 = array('7', '8', '9');
|
||||
$bugIDList4 = array('10', '11', '12');
|
||||
$bugIDList5 = array('13', '14', '15');
|
||||
$bugIDList6 = array('16', '17', '18');
|
||||
$bugIDList7 = array('19', '20', '21');
|
||||
$bugIDList8 = array('22', '23', '24');
|
||||
|
||||
$resolutionList = array('bydesign', 'duplicate', 'external', 'fixed', 'notrepro', 'postponed', 'willnotfix', 'tostory');
|
||||
|
||||
|
||||
$bug = new bugTest();
|
||||
r($bug->batchResolveTest($bugIDList1, $resolutionList[0], $bugIDList1[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,,bydesign;status,active,resolved'); // 解决bug1 2 3,解决方式为bydesign
|
||||
r($bug->batchResolveTest($bugIDList2, $resolutionList[1], $bugIDList2[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,,duplicate;status,active,resolved'); // 解决bug4 5 6,解决方式为duplicate
|
||||
r($bug->batchResolveTest($bugIDList3, $resolutionList[2], $bugIDList3[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,,external;status,active,resolved'); // 解决bug7 8 9,解决方式为external
|
||||
r($bug->batchResolveTest($bugIDList4, $resolutionList[3], $bugIDList4[0])) && p('0:field,old,new;4:field,old,new') && e('resolution,,fixed;status,active,resolved'); // 解决bug10 11 12,解决方式为fixed
|
||||
r($bug->batchResolveTest($bugIDList5, $resolutionList[4], $bugIDList5[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,,notrepro;status,active,resolved'); // 解决bug13 14 15,解决方式为notrepro
|
||||
r($bug->batchResolveTest($bugIDList6, $resolutionList[5], $bugIDList6[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,,postponed;status,active,resolved'); // 解决bug16 17 18,解决方式为postponed
|
||||
r($bug->batchResolveTest($bugIDList7, $resolutionList[6], $bugIDList7[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,,willnotfix;status,active,resolved'); // 解决bug19 20 21,解决方式为willnotfix
|
||||
r($bug->batchResolveTest($bugIDList8, $resolutionList[7], $bugIDList8[0])) && p('0:field,old,new;3:field,old,new') && e('resolution,,tostory;status,active,resolved'); // 解决bug22 23 24,解决方式为tostory
|
||||
r($bug->batchResolveTest($bugIDList8, $resolutionList[7], $bugIDList8[0])) && p('0:field,old,new;3:field,old,new') && e('0'); // 解决bug状态为resolve的bug
|
||||
system("./ztest init");
|
||||
30
test/model/bug/close.php
Executable file
30
test/model/bug/close.php
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; su('admin');
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=bugModel->close();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试关闭状态为active的bug1 >> assignedTo,admin,closed;status,active,closed
|
||||
测试关闭状态为active的bug2 >> assignedTo,admin,closed;status,active,closed
|
||||
测试关闭状态为resolved的bug51 >> assignedTo,dev1,closed;status,resolved,closed
|
||||
测试关闭状态为resolved的bug52 >> assignedTo,dev1,closed;status,resolved,closed
|
||||
测试关闭状态为closed的bug81 >> assignedTo,dev1,closed;status,active,closed
|
||||
测试关闭状态为closed的bug82 >> assignedTo,dev1,closed;status,active,closed
|
||||
*/
|
||||
|
||||
|
||||
$bugIDList = array('1', '2', '51', '52', '34', '36');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->closeObject($bugIDList[0])) && p('0:field,old,new;1:field,old,new') && e('assignedTo,admin,closed;status,active,closed'); // 测试关闭状态为active的bug1
|
||||
r($bug->closeObject($bugIDList[1])) && p('0:field,old,new;1:field,old,new') && e('assignedTo,admin,closed;status,active,closed'); // 测试关闭状态为active的bug2
|
||||
r($bug->closeObject($bugIDList[2])) && p('0:field,old,new;1:field,old,new') && e('assignedTo,dev1,closed;status,resolved,closed'); // 测试关闭状态为resolved的bug51
|
||||
r($bug->closeObject($bugIDList[3])) && p('0:field,old,new;1:field,old,new') && e('assignedTo,dev1,closed;status,resolved,closed'); // 测试关闭状态为resolved的bug52
|
||||
r($bug->closeObject($bugIDList[4])) && p('0:field,old,new;1:field,old,new') && e('assignedTo,dev1,closed;status,active,closed'); // 测试关闭状态为closed的bug81
|
||||
r($bug->closeObject($bugIDList[5])) && p('0:field,old,new;1:field,old,new') && e('assignedTo,dev1,closed;status,active,closed'); // 测试关闭状态为closed的bug82
|
||||
system("./ztest init");
|
||||
@@ -27,9 +27,9 @@ $bug51 = array('assignedTo' => 'dev1' , 'status' => 'active', 'type' => 'standa
|
||||
$bug81 = array('assignedTo' => 'test1' , 'status' => 'active', 'type' => 'others', 'pri' => '1');
|
||||
|
||||
$bug = new bugTest();
|
||||
r($bug->confirmTest($bugIDlist[0],$bug1)) && p('0:field,old,new;1:field,old,new') && e('assignedTo,admin,user92'); // 确认指派人变化的bug
|
||||
r($bug->confirmTest($bugIDlist[1],$bug3)) && p('0:field,old,new;1:field,old,new') && e('assignedTo,admin,user94'); // 确认类型变化的bug
|
||||
r($bug->confirmTest($bugIDlist[2],$bug4)) && p('0:field,old,new') && e('assignedTo,admin,user95'); // 确认已确认的bug
|
||||
r($bug->confirmTest($bugIDlist[3],$bug51)) && p('0:field,old,new;1:field,old,new') && e('assignedTo,dev1,user96'); // 确认优先级变化的bug
|
||||
r($bug->confirmTest($bugIDlist[4],$bug81)) && p('0:field,old,new') && e('assignedTo,test1,user97'); // 确认bug
|
||||
r($bug->confirmTest($bugIDlist[0],$bug1)) && p('0:field,old,new;1:field,old,new') && e('assignedTo,admin,user92;confirmed,0,1'); // 确认指派人变化的bug
|
||||
r($bug->confirmTest($bugIDlist[1],$bug3)) && p('0:field,old,new;1:field,old,new') && e('assignedTo,admin,user94;confirmed,0,1'); // 确认类型变化的bug
|
||||
r($bug->confirmTest($bugIDlist[2],$bug4)) && p('0:field,old,new') && e('assignedTo,admin,user95'); // 确认已确认的bug
|
||||
r($bug->confirmTest($bugIDlist[3],$bug51)) && p('0:field,old,new;1:field,old,new') && e('assignedTo,dev1,user96;pri,3,2'); // 确认优先级变化的bug
|
||||
r($bug->confirmTest($bugIDlist[4],$bug81)) && p('0:field,old,new') && e('assignedTo,test1,user97'); // 确认bug
|
||||
system("./ztest init");
|
||||
|
||||
36
test/model/bug/extractaccountsfromlist.php
Executable file
36
test/model/bug/extractaccountsfromlist.php
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; su('admin');
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=bugModel->extractAccountsFromList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试提取bug1 2 3的用户 >> admin;
|
||||
测试提取bug4 5 6的用户 >> admin;
|
||||
测试提取bug51 52 53的用户 >> admin;dev1
|
||||
测试提取bug54 55 56的用户 >> admin;dev1
|
||||
测试提取bug81 82 83的用户 >> admin;test1
|
||||
测试提取bug84 85 86的用户 >> admin;test1
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$bugIDList1 = array('1', '2', '3');
|
||||
$bugIDList2 = array('4', '5', '6');
|
||||
$bugIDList3 = array('51', '52', '53');
|
||||
$bugIDList4 = array('54', '55', '56');
|
||||
$bugIDList5 = array('81', '82', '83');
|
||||
$bugIDList6 = array('84', '85', '86');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->extractAccountsFromListTest($bugIDList1)) && p('0;1') && e('admin;'); // 测试提取bug1 2 3的用户
|
||||
r($bug->extractAccountsFromListTest($bugIDList2)) && p('0;1') && e('admin;'); // 测试提取bug4 5 6的用户
|
||||
r($bug->extractAccountsFromListTest($bugIDList3)) && p('0;1') && e('admin;dev1'); // 测试提取bug51 52 53的用户
|
||||
r($bug->extractAccountsFromListTest($bugIDList4)) && p('0;1') && e('admin;dev1'); // 测试提取bug54 55 56的用户
|
||||
r($bug->extractAccountsFromListTest($bugIDList5)) && p('0;1') && e('admin;test1'); // 测试提取bug81 82 83的用户
|
||||
r($bug->extractAccountsFromListTest($bugIDList6)) && p('0;1') && e('admin;test1'); // 测试提取bug84 85 86的用户
|
||||
59
test/model/bug/extractaccountsfromsingle.php
Executable file
59
test/model/bug/extractaccountsfromsingle.php
Executable file
@@ -0,0 +1,59 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; su('admin');
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=bugModel->extractAccountsFromSingle();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试提取bug1的用户 >> admin;
|
||||
测试提取bug2的用户 >> admin;
|
||||
测试提取bug3的用户 >> admin;
|
||||
测试提取bug4的用户 >> admin;
|
||||
测试提取bug5的用户 >> admin;
|
||||
测试提取bug6的用户 >> admin;
|
||||
测试提取bug51的用户 >> admin;dev1
|
||||
测试提取bug52的用户 >> admin;dev1
|
||||
测试提取bug53的用户 >> admin;dev1
|
||||
测试提取bug54的用户 >> admin;dev1
|
||||
测试提取bug55的用户 >> admin;dev1
|
||||
测试提取bug56的用户 >> admin;dev1
|
||||
测试提取bug81的用户 >> admin;test1
|
||||
测试提取bug82的用户 >> admin;test1
|
||||
测试提取bug83的用户 >> admin;test1
|
||||
测试提取bug84的用户 >> admin;test1
|
||||
测试提取bug85的用户 >> admin;test1
|
||||
测试提取bug86的用户 >> admin;test1
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$bugIDList1 = array('1', '2', '3');
|
||||
$bugIDList2 = array('4', '5', '6');
|
||||
$bugIDList3 = array('51', '52', '53');
|
||||
$bugIDList4 = array('54', '55', '56');
|
||||
$bugIDList5 = array('81', '82', '83');
|
||||
$bugIDList6 = array('84', '85', '86');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList1[0])) && p('0;1') && e('admin;'); // 测试提取bug1的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList1[1])) && p('0;1') && e('admin;'); // 测试提取bug2的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList1[2])) && p('0;1') && e('admin;'); // 测试提取bug3的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList2[0])) && p('0;1') && e('admin;'); // 测试提取bug4的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList2[1])) && p('0;1') && e('admin;'); // 测试提取bug5的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList2[2])) && p('0;1') && e('admin;'); // 测试提取bug6的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList3[0])) && p('0;1') && e('admin;dev1'); // 测试提取bug51的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList3[1])) && p('0;1') && e('admin;dev1'); // 测试提取bug52的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList3[2])) && p('0;1') && e('admin;dev1'); // 测试提取bug53的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList4[0])) && p('0;1') && e('admin;dev1'); // 测试提取bug54的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList4[1])) && p('0;1') && e('admin;dev1'); // 测试提取bug55的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList4[2])) && p('0;1') && e('admin;dev1'); // 测试提取bug56的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList5[0])) && p('0;1') && e('admin;test1'); // 测试提取bug81的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList5[1])) && p('0;1') && e('admin;test1'); // 测试提取bug82的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList5[2])) && p('0;1') && e('admin;test1'); // 测试提取bug83的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList6[0])) && p('0;1') && e('admin;test1'); // 测试提取bug84的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList6[1])) && p('0;1') && e('admin;test1'); // 测试提取bug85的用户
|
||||
r($bug->extractAccountsFromSingleTest($bugIDList6[2])) && p('0;1') && e('admin;test1'); // 测试提取bug86的用户
|
||||
28
test/model/bug/getuserbugpairs.php
Executable file
28
test/model/bug/getuserbugpairs.php
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; su('admin');
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=bugModel->getUserBugPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试获取用户admin的bug >> 80
|
||||
测试获取用户test1的bug >> 80
|
||||
测试获取用户test2的bug >> 0
|
||||
测试获取用户dev1的bug >> 50
|
||||
测试获取用户po1的bug >> 0
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$accountIDList = array('admin', 'test1', 'test2', 'dev1', 'po1');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->getUserBugPairsTest($accountIDList[0])) && p() && e('80'); // 测试获取用户admin的bug
|
||||
r($bug->getUserBugPairsTest($accountIDList[1])) && p() && e('50'); // 测试获取用户test1的bug
|
||||
r($bug->getUserBugPairsTest($accountIDList[2])) && p() && e('0'); // 测试获取用户test2的bug
|
||||
r($bug->getUserBugPairsTest($accountIDList[3])) && p() && e('50'); // 测试获取用户dev1的bug
|
||||
r($bug->getUserBugPairsTest($accountIDList[4])) && p() && e('0'); // 测试获取用户po1的bug
|
||||
28
test/model/bug/getuserbugs.php
Executable file
28
test/model/bug/getuserbugs.php
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; su('admin');
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=bugModel->getUserBugs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试获取用户admin的bug >> 80
|
||||
测试获取用户test1的bug >> 80
|
||||
测试获取用户test2的bug >> 0
|
||||
测试获取用户dev1的bug >> 50
|
||||
测试获取用户po1的bug >> 0
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$accountIDList = array('admin', 'test1', 'test2', 'dev1', 'po1');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->getUserBugsTest($accountIDList[0])) && p() && e('80'); // 测试获取用户admin的bug
|
||||
r($bug->getUserBugsTest($accountIDList[1])) && p() && e('50'); // 测试获取用户test1的bug
|
||||
r($bug->getUserBugsTest($accountIDList[2])) && p() && e('0'); // 测试获取用户test2的bug
|
||||
r($bug->getUserBugsTest($accountIDList[3])) && p() && e('50'); // 测试获取用户dev1的bug
|
||||
r($bug->getUserBugsTest($accountIDList[4])) && p() && e('0'); // 测试获取用户po1的bug
|
||||
36
test/model/bug/processbuildforbugs.php
Executable file
36
test/model/bug/processbuildforbugs.php
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; su('admin');
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=bugModel->processBuildForBugs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试处理bug1 2 3的openedBuild resolvedBuild字段 >> 产品1正常的发布1,;0,;产品1正常的发布1,
|
||||
测试处理bug4 5 6的openedBuild resolvedBuild字段 >> 主干,;主干,;主干,
|
||||
测试处理bug51 52 53的openedBuild resolvedBuild字段 >> 主干,;主干,;主干,
|
||||
测试处理bug54 55 56的openedBuild resolvedBuild字段 >> 主干,;主干,;主干,主干
|
||||
测试处理bug81 82 83的openedBuild resolvedBuild字段 >> 主干,;主干,;主干,
|
||||
测试处理bug84 85 86的openedBuild resolvedBuild字段 >> 主干,;主干,;主干,
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$bugIDList1 = array('1', '2', '3');
|
||||
$bugIDList2 = array('4', '5', '6');
|
||||
$bugIDList3 = array('51', '52', '53');
|
||||
$bugIDList4 = array('54', '55', '56');
|
||||
$bugIDList5 = array('81', '82', '83');
|
||||
$bugIDList6 = array('84', '85', '86');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->processBuildForBugsTest($bugIDList1)) && p('1:openedBuild,resolvedBuild;2:openedBuild,resolvedBuild;3:openedBuild,resolvedBuild') && e('产品1正常的发布1,;0,;产品1正常的发布1,'); // 测试处理bug1 2 3的openedBuild resolvedBuild字段
|
||||
r($bug->processBuildForBugsTest($bugIDList2)) && p('4:openedBuild,resolvedBuild;5:openedBuild,resolvedBuild;6:openedBuild,resolvedBuild') && e('主干,;主干,;主干,'); // 测试处理bug4 5 6的openedBuild resolvedBuild字段
|
||||
r($bug->processBuildForBugsTest($bugIDList3)) && p('51:openedBuild,resolvedBuild;52:openedBuild,resolvedBuild;53:openedBuild,resolvedBuild') && e('主干,;主干,;主干,'); // 测试处理bug51 52 53的openedBuild resolvedBuild字段
|
||||
r($bug->processBuildForBugsTest($bugIDList4)) && p('54:openedBuild,resolvedBuild;55:openedBuild,resolvedBuild;56:openedBuild,resolvedBuild') && e('主干,;主干,;主干,主干'); // 测试处理bug54 55 56的openedBuild resolvedBuild字段
|
||||
r($bug->processBuildForBugsTest($bugIDList5)) && p('81:openedBuild,resolvedBuild;82:openedBuild,resolvedBuild;83:openedBuild,resolvedBuild') && e('主干,;主干,;主干,'); // 测试处理bug81 82 83的openedBuild resolvedBuild字段
|
||||
r($bug->processBuildForBugsTest($bugIDList6)) && p('84:openedBuild,resolvedBuild;85:openedBuild,resolvedBuild;86:openedBuild,resolvedBuild') && e('主干,;主干,;主干,'); // 测试处理bug84 85 86的openedBuild resolvedBuild字段
|
||||
Reference in New Issue
Block a user