* Sprint231 unit
This commit is contained in:
@@ -1393,13 +1393,14 @@ class bugTest
|
||||
/**
|
||||
* Test get bug pairs of a product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $productID
|
||||
* @param int|string $branch
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getProductBugPairsTest($productID)
|
||||
public function getProductBugPairsTest($productID, $branch = '')
|
||||
{
|
||||
$array = $this->objectModel->getProductBugPairs($productID);
|
||||
$array = $this->objectModel->getProductBugPairs($productID, $branch);
|
||||
|
||||
$title = '';
|
||||
foreach($array as $bug) $title .= ',' . $bug;
|
||||
|
||||
@@ -450,12 +450,17 @@ class taskTest
|
||||
* Test get tasks of a execution.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param int $productID
|
||||
* @param string $type
|
||||
* @param string $modules
|
||||
* @param string $orderBy
|
||||
* @param string $count
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getExecutionTasksTest($executionID,$count)
|
||||
public function getExecutionTasksTest($executionID, $productID = 0, $type = 'all', $modules = 0, $orderBy = 'status_asc, id_desc', $count = '0')
|
||||
{
|
||||
$object = $this->objectModel->getExecutionTasks($executionID);
|
||||
$object = $this->objectModel->getExecutionTasks($executionID, $productID, $type, $modules, $orderBy);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
|
||||
@@ -16,16 +16,21 @@ pid=1
|
||||
测试获取productID为5的bug >> 15:缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();15,14:BUG14,13:BUG13
|
||||
测试获取productID为6的bug >> 18:BUG18,17:BUG17,16:bug16
|
||||
测试获取不存在的product的bug >> 0
|
||||
测试获取productID为45,主干分支的bug >> 133:BUG133
|
||||
测试获取productID为45,分支为9的bug >> 134:BUG134
|
||||
|
||||
*/
|
||||
|
||||
$productIDList = array('1', '2', '3', '4','5', '6', '1000001');
|
||||
$productIDList = array('1', '2', '3', '4','5', '6', '1000001', '45');
|
||||
$branchIDList = array('9');
|
||||
|
||||
$bug=new bugTest();
|
||||
r($bug->getProductBugPairsTest($productIDList[0])) && p() && e('3:BUG3,2:BUG2,1:BUG1'); // 测试获取productID为1的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[1])) && p() && e('6:BUG6,5:BUG5,4:BUG4'); // 测试获取productID为2的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[2])) && p() && e('9:BUG9,8:bug8,7:缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 测试获取productID为3的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[3])) && p() && e('12:BUG12,11:BUG11,10:BUG10'); // 测试获取productID为4的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[4])) && p() && e('15:缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();15,14:BUG14,13:BUG13'); // 测试获取productID为5的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[5])) && p() && e('18:BUG18,17:BUG17,16:bug16'); // 测试获取productID为6的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[6])) && p() && e('0'); // 测试获取不存在的product的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[0])) && p() && e('3:BUG3,2:BUG2,1:BUG1'); // 测试获取productID为1的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[1])) && p() && e('6:BUG6,5:BUG5,4:BUG4'); // 测试获取productID为2的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[2])) && p() && e('9:BUG9,8:bug8,7:缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 测试获取productID为3的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[3])) && p() && e('12:BUG12,11:BUG11,10:BUG10'); // 测试获取productID为4的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[4])) && p() && e('15:缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();15,14:BUG14,13:BUG13'); // 测试获取productID为5的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[5])) && p() && e('18:BUG18,17:BUG17,16:bug16'); // 测试获取productID为6的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[6])) && p() && e('0'); // 测试获取不存在的product的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[7], 0)) && p() && e('133:BUG133'); // 测试获取productID为45,主干分支的bug
|
||||
r($bug->getProductBugPairsTest($productIDList[7], $branchIDList[0])) && p() && e('134:BUG134'); // 测试获取productID为45,分支为9的bug
|
||||
|
||||
@@ -12,12 +12,23 @@ pid=1
|
||||
|
||||
根据执行id获取任务列表 >> 开发任务11
|
||||
根据执行id获取任务数量 >> 4
|
||||
根据执行id,按pri升序获取第一个任务pri >> 3
|
||||
根据执行id,按pri降序获取第一个任务pri >> 1
|
||||
|
||||
*/
|
||||
|
||||
$executionID = '101';
|
||||
$productID = 0;
|
||||
$type = 'all';
|
||||
$modules = 0;
|
||||
$orderBy = array('status_asc, id_desc', 'pri_desc', 'pri_asc');
|
||||
$count = array('0','1');
|
||||
|
||||
$task = new taskTest();
|
||||
r($task->getExecutionTasksTest($executionID,$count[0])) && p('1:name') && e('开发任务11'); //根据执行id获取任务列表
|
||||
r($task->getExecutionTasksTest($executionID,$count[1])) && p() && e('4'); //根据执行id获取任务数量
|
||||
$priDescTasks = $task->getExecutionTasksTest($executionID, $productID, $type, $modules, $orderBy[1]);
|
||||
$priAscTasks = $task->getExecutionTasksTest($executionID, $productID, $type, $modules, $orderBy[2]);
|
||||
|
||||
r($task->getExecutionTasksTest($executionID)) && p('1:name') && e('开发任务11'); //根据执行id获取任务列表
|
||||
r($task->getExecutionTasksTest($executionID, $productID, $type, $modules, $orderBy[0], $count[1])) && p() && e('4'); //根据执行id获取任务数量
|
||||
r(array_shift($priDescTasks)) && p('pri') && e('3'); //根据执行id,按pri升序获取第一个任务pri
|
||||
r(array_shift($priAscTasks)) && p('pri') && e('1'); //根据执行id,按pri降序获取第一个任务pri
|
||||
|
||||
Reference in New Issue
Block a user