* Add auto test of bug.

This commit is contained in:
liumengyi
2022-03-17 17:10:55 +08:00
parent a253bc2246
commit 7e85558c74
9 changed files with 487 additions and 3 deletions
+163 -2
View File
@@ -597,15 +597,16 @@ class bugTest
* Test get bugs need confirm.
*
* @param string $productIDList
* @param string $modules
* @access public
* @return string
*/
public function getByNeedconfirmTest($productIDList)
public function getByNeedconfirmTest($productIDList, $modules)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getByNeedconfirm($productIDList, 'all', '0', $executions, 'id_desc', null, 0);
$bugs = $this->objectModel->getByNeedconfirm($productIDList, 'all', $modules, $executions, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
@@ -624,4 +625,164 @@ class bugTest
return $title;
}
}
/**
* Test get bug list of a plan.
*
* @param string $productIDList
* @param string $modules
* @access public
* @return string
*/
public function getPlanBugsTest($planID, $status)
{
$bugs = $this->objectModel->getPlanBugs($planID, $status, 'id_desc', null);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get bug by id.
*
* @param int $bugID
* @access public
* @return object
*/
public function getByIdTest($bugID)
{
$object = $this->objectModel->getById($bugID);
if(isset($object->title)) $object->title = str_replace("'", '', $object->title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $object;
}
}
/**
* Test get bug by id list.
*
* @param string $bugIDList
* @access public
* @return array
*/
public function getByListTest($bugIDList)
{
$bugs = $this->objectModel->getByList($bugIDList);
foreach($bugs as $bug)
{
if(isset($bug->title)) $bug->title = str_replace("'", '', $bug->title);
}
if(dao::isError())
{
return dao::getError();
}
else
{
return $bugs;
}
}
/**
* Test get active bugs.
*
* @param string $products
* @param string $excludeBugs
* @access public
* @return string
*/
public function getActiveBugsTest($products, $excludeBugs)
{
$bugs = $this->objectModel->getActiveBugs($products, 'all', '', $excludeBugs);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get active and postponed bugs.
*
* @param string $bugIDList
* @param int $executionID
* @access public
* @return string
*/
public function getActiveAndPostponedBugsTest($products, $executionID)
{
$bugs = $this->objectModel->getActiveAndPostponedBugs($products, $executionID);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get module owner.
*
* @param int $moduleID
* @param int $productID
* @access public
* @return string
*/
public function getModuleOwnerTest($moduleID, $productID)
{
$owner = $this->objectModel->getModuleOwner($moduleID, $productID);
if(dao::isError())
{
return dao::getError();
}
else
{
return $owner;
}
}
}
+1 -1
View File
@@ -15,7 +15,7 @@ fields:
- field: execution
range: 101-700{3}
- field: plan
range: 0
range: 1{3},4{3},7{3},0{1111111}
- field: story
range: 2-400:4
- field: storyVersion
+46
View File
@@ -0,0 +1,46 @@
#!/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->getActiveAndPostponedBugs();
cid=1
pid=1
查询产品1 2 3 不存在的产品1000001 execution为101下的bug >> BUG3,BUG2,BUG1
查询产品1 2 3 不存在的产品1000001 execution为102下的bug >> BUG6,BUG5,BUG4
查询产品1 2 3 不存在的产品1000001 execution为103下的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7
查询产品1 3 execution为101下的bug >> BUG3,BUG2,BUG1
查询产品1 3 execution为102下的bug >> 0
查询产品1 3 execution为103下的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7
查询产品1 execution为101下的bug >> BUG3,BUG2,BUG1
查询产品1 execution为102下的bug >> 0
查询产品1 execution为103下的bug >> 0
查询不存在的产品1000001 execution为101下的bug >> 0
查询不存在的产品1000001 execution为102下的bug >> 0
查询不存在的产品1000001 execution为103下的bug >> 0
*/
$productIDList = array('1,2,3,1000001', '1,3', '1', '1000001');
$executionList = array('101', '102', '103');
$bug=new bugTest();
r($bug->getActiveAndPostponedBugsTest($productIDList[0], $executionList[0])) && p() && e('BUG3,BUG2,BUG1'); // 查询产品1 2 3 不存在的产品1000001 execution为101下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[0], $executionList[1])) && p() && e('BUG6,BUG5,BUG4'); // 查询产品1 2 3 不存在的产品1000001 execution为102下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[0], $executionList[2])) && p() && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 查询产品1 2 3 不存在的产品1000001 execution为103下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[1], $executionList[0])) && p() && e('BUG3,BUG2,BUG1'); // 查询产品1 3 execution为101下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[1], $executionList[1])) && p() && e('0'); // 查询产品1 3 execution为102下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[1], $executionList[2])) && p() && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 查询产品1 3 execution为103下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[2], $executionList[0])) && p() && e('BUG3,BUG2,BUG1'); // 查询产品1 execution为101下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[2], $executionList[1])) && p() && e('0'); // 查询产品1 execution为102下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[2], $executionList[2])) && p() && e('0'); // 查询产品1 execution为103下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[3], $executionList[0])) && p() && e('0'); // 查询不存在的产品1000001 execution为101下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[3], $executionList[1])) && p() && e('0'); // 查询不存在的产品1000001 execution为102下的bug
r($bug->getActiveAndPostponedBugsTest($productIDList[3], $executionList[2])) && p() && e('0'); // 查询不存在的产品1000001 execution为103下的bug
+45
View File
@@ -0,0 +1,45 @@
#!/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->getActiveBugs();
cid=1
pid=1
查询产品1 2 3 不存在的产品1000001下 且不排除bug的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG2,BUG1
查询产品1 2 3 不存在的产品1000001下 且排除bug2的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG1
查询产品1 2 3 不存在的产品1000001下 且排除bug3 8的bug >> BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG2,BUG1
查询产品1 3下 且不排除bug的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG2,BUG1
查询产品1 3下 且排除bug2的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG1
查询产品1 3下 且排除bug3 8的bug >> BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG2,BUG1
查询产品1下 且不排除bug的bug >> BUG3,BUG2,BUG1
查询产品1下 且排除bug2的bug >> BUG3,BUG1
查询产品1下 且排除bug3 8的bug >> BUG2,BUG1
查询不存在的产品1000001下 且不排除bug的bug >> 0
查询不存在的产品1000001下 且排除bug2的bug >> 0
查询不存在的产品1000001下 且排除bug3 8的bug >> 0
*/
$productIDList = array('1,2,3,1000001', '1,3', '1', '1000001');
$statusList = array('', '2', '3,8');
$bug=new bugTest();
r($bug->getActiveBugsTest($productIDList[0], $statusList[0])) && p() && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG2,BUG1'); // 查询产品1 2 3 不存在的产品1000001下 且不排除bug的bug
r($bug->getActiveBugsTest($productIDList[0], $statusList[1])) && p() && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG1'); // 查询产品1 2 3 不存在的产品1000001下 且排除bug2的bug
r($bug->getActiveBugsTest($productIDList[0], $statusList[2])) && p() && e('BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG2,BUG1'); // 查询产品1 2 3 不存在的产品1000001下 且排除bug3 8的bug
r($bug->getActiveBugsTest($productIDList[1], $statusList[0])) && p() && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG2,BUG1'); // 查询产品1 3下 且不排除bug的bug
r($bug->getActiveBugsTest($productIDList[1], $statusList[1])) && p() && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG1'); // 查询产品1 3下 且排除bug2的bug
r($bug->getActiveBugsTest($productIDList[1], $statusList[2])) && p() && e('BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG2,BUG1'); // 查询产品1 3下 且排除bug3 8的bug
r($bug->getActiveBugsTest($productIDList[2], $statusList[0])) && p() && e('BUG3,BUG2,BUG1'); // 查询产品1下 且不排除bug的bug
r($bug->getActiveBugsTest($productIDList[2], $statusList[1])) && p() && e('BUG3,BUG1'); // 查询产品1下 且排除bug2的bug
r($bug->getActiveBugsTest($productIDList[2], $statusList[2])) && p() && e('BUG2,BUG1'); // 查询产品1下 且排除bug3 8的bug
r($bug->getActiveBugsTest($productIDList[3], $statusList[0])) && p() && e('0'); // 查询不存在的产品1000001下 且不排除bug的bug
r($bug->getActiveBugsTest($productIDList[3], $statusList[1])) && p() && e('0'); // 查询不存在的产品1000001下 且排除bug2的bug
r($bug->getActiveBugsTest($productIDList[3], $statusList[2])) && p() && e('0'); // 查询不存在的产品1000001下 且排除bug3 8的bug
+59
View File
@@ -0,0 +1,59 @@
#!/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->getById();
cid=1
pid=1
查询id为1的bug的title >> BUG1
查询id为1的bug的status >> active
查询id为1的bug的plan >> 1
查询id为1的bug的module >> 1821
查询id为1的bug的story >> 2
查询id为4的bug的title >> BUG4
查询id为4的bug的status >> active
查询id为4的bug的plan >> 4
查询id为4的bug的module >> 1825
查询id为4的bug的story >> 14
查询id为7的bug的title >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7
查询id为7的bug的status >> active
查询id为7的bug的plan >> 7
查询id为7的bug的module >> 1831
查询id为7的bug的story >> 26
查询id为不存在的1000001的bug的title >> 0
查询id为不存在的1000001的bug的status >> 0
查询id为不存在的1000001的bug的plan >> 0
查询id为不存在的1000001的bug的module >> 0
查询id为不存在的1000001的bug的story >> 0
*/
$bugIDList = array('1', '4', '7', '1000001');
$bug=new bugTest();
r($bug->getByIdTest($bugIDList[0])) && p('title') && e('BUG1'); // 查询id为1的bug的title
r($bug->getByIdTest($bugIDList[0])) && p('status') && e('active'); // 查询id为1的bug的status
r($bug->getByIdTest($bugIDList[0])) && p('plan') && e('1'); // 查询id为1的bug的plan
r($bug->getByIdTest($bugIDList[0])) && p('module') && e('1821'); // 查询id为1的bug的module
r($bug->getByIdTest($bugIDList[0])) && p('story') && e('2'); // 查询id为1的bug的story
r($bug->getByIdTest($bugIDList[1])) && p('title') && e('BUG4'); // 查询id为4的bug的title
r($bug->getByIdTest($bugIDList[1])) && p('status') && e('active'); // 查询id为4的bug的status
r($bug->getByIdTest($bugIDList[1])) && p('plan') && e('4'); // 查询id为4的bug的plan
r($bug->getByIdTest($bugIDList[1])) && p('module') && e('1825'); // 查询id为4的bug的module
r($bug->getByIdTest($bugIDList[1])) && p('story') && e('14'); // 查询id为4的bug的story
r($bug->getByIdTest($bugIDList[2])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 查询id为7的bug的title
r($bug->getByIdTest($bugIDList[2])) && p('status') && e('active'); // 查询id为7的bug的status
r($bug->getByIdTest($bugIDList[2])) && p('plan') && e('7'); // 查询id为7的bug的plan
r($bug->getByIdTest($bugIDList[2])) && p('module') && e('1831'); // 查询id为7的bug的module
r($bug->getByIdTest($bugIDList[2])) && p('story') && e('26'); // 查询id为7的bug的story
r($bug->getByIdTest($bugIDList[3])) && p('title') && e('0'); // 查询id为不存在的1000001的bug的title
r($bug->getByIdTest($bugIDList[3])) && p('status') && e('0'); // 查询id为不存在的1000001的bug的status
r($bug->getByIdTest($bugIDList[3])) && p('plan') && e('0'); // 查询id为不存在的1000001的bug的plan
r($bug->getByIdTest($bugIDList[3])) && p('module') && e('0'); // 查询id为不存在的1000001的bug的module
r($bug->getByIdTest($bugIDList[3])) && p('story') && e('0'); // 查询id为不存在的1000001的bug的story
+47
View 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->getByList();
cid=1
pid=1
查询id为1的bug title >> BUG1
查询id为2的bug status >> active
查询id为3的bug title >> BUG3
查询id为1的bug title >> BUG1
查询id为4的bug title >> BUG4
查询id为4的bug status >> active
查询id为1的bug title >> BUG1
查询id为1的bug title >> BUG1
查询id为2的bug title >> BUG2
查询id为2的bug status >> active
查询id为7的bug title >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7
查询id为7的bug title >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7
*/
$bugIDList = array('1,2,3', '1,4', '2,7', '1000001');
$fieldsList = array('*', 'id,title,status,plan,module,story', 'title,status', 'title');
$bug=new bugTest();
r($bug->getByListTest($bugIDList[0], $fieldsList[0])) && p('1:title') && e('BUG1'); // 查询id为1的bug title
r($bug->getByListTest($bugIDList[0], $fieldsList[1])) && p('2:status') && e('active'); // 查询id为2的bug status
r($bug->getByListTest($bugIDList[0], $fieldsList[2])) && p('3:title') && e('BUG3'); // 查询id为3的bug title
r($bug->getByListTest($bugIDList[0], $fieldsList[3])) && p('1:title') && e('BUG1'); // 查询id为1的bug title
r($bug->getByListTest($bugIDList[1], $fieldsList[0])) && p('4:title') && e('BUG4'); // 查询id为4的bug title
r($bug->getByListTest($bugIDList[1], $fieldsList[1])) && p('4:status') && e('active'); // 查询id为4的bug status
r($bug->getByListTest($bugIDList[1], $fieldsList[2])) && p('1:title') && e('BUG1'); // 查询id为1的bug title
r($bug->getByListTest($bugIDList[1], $fieldsList[3])) && p('1:title') && e('BUG1'); // 查询id为1的bug title
r($bug->getByListTest($bugIDList[2], $fieldsList[0])) && p('2:title') && e('BUG2'); // 查询id为2的bug title
r($bug->getByListTest($bugIDList[2], $fieldsList[1])) && p('2:status') && e('active'); // 查询id为2的bug status
r($bug->getByListTest($bugIDList[2], $fieldsList[2])) && p('7:title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 查询id为7的bug title
r($bug->getByListTest($bugIDList[2], $fieldsList[3])) && p('7:title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 查询id为7的bug title
+38
View File
@@ -0,0 +1,38 @@
#!/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->getByNeedconfirm();
cid=1
pid=1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下研发需求变更的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825下研发需求变更的bug >> BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下研发需求变更的bug >> 0
查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下研发需求变更的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1
查询产品1 3与模块1821, 1825下研发需求变更的bug >> BUG1
查询产品1 3与模块不存在的模块1000001下研发需求变更的bug >> 0
查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下研发需求变更的bug >> 0
查询不存在的产品10001 与模块1821, 1825下研发需求变更的bug >> 0
查询不存在的产品10001 与不存在的模块1000001下研发需求变更的bug >> 0
*/
$productIDList = array('1,2,3,1000001', '1,3', '1000001');
$moduleIDList = array('1821,1825,1831,1000001', '1821, 1825', '1000001');
$bug=new bugTest();
r($bug->getByNeedconfirmTest($productIDList[0], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下研发需求变更的bug
r($bug->getByNeedconfirmTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下研发需求变更的bug
r($bug->getByNeedconfirmTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下研发需求变更的bug
r($bug->getByNeedconfirmTest($productIDList[1], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1'); // 查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下研发需求变更的bug
r($bug->getByNeedconfirmTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下研发需求变更的bug
r($bug->getByNeedconfirmTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下研发需求变更的bug
r($bug->getByNeedconfirmTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下研发需求变更的bug
r($bug->getByNeedconfirmTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下研发需求变更的bug
r($bug->getByNeedconfirmTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下研发需求变更的bug
+44
View File
@@ -0,0 +1,44 @@
#!/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->getModuleOwner();
cid=1
pid=1
查询模块1821 产品1的owner >> test1
查询模块1821 产品2的owner >> test2
查询模块1821 产品3的owner >> test3
查询模块1821 不存在的产品1000001的owner >> 0
查询模块1821 产品1的owner >> test1
查询模块1821 产品2的owner >> test2
查询模块1821 产品3的owner >> test3
查询模块1821 不存在的产品1000001的owner >> 0
查询模块1821 产品1的owner >> test1
查询模块1821 产品2的owner >> test2
查询模块1821 产品3的owner >> test3
查询模块1821 不存在的产品1000001的owner >> 0
*/
$moduleIDList = array('1821', '1825', '1829');
$productIDList = array('1', '2', '3', '1000001');
$bug=new bugTest();
r($bug->getModuleOwnerTest($moduleIDList[0], $productIDList[0])) && p() && e('test1'); // 查询模块1821 产品1的owner
r($bug->getModuleOwnerTest($moduleIDList[0], $productIDList[1])) && p() && e('test2'); // 查询模块1821 产品2的owner
r($bug->getModuleOwnerTest($moduleIDList[0], $productIDList[2])) && p() && e('test3'); // 查询模块1821 产品3的owner
r($bug->getModuleOwnerTest($moduleIDList[0], $productIDList[3])) && p() && e('0'); // 查询模块1821 不存在的产品1000001的owner
r($bug->getModuleOwnerTest($moduleIDList[1], $productIDList[0])) && p() && e('test1'); // 查询模块1821 产品1的owner
r($bug->getModuleOwnerTest($moduleIDList[1], $productIDList[1])) && p() && e('test2'); // 查询模块1821 产品2的owner
r($bug->getModuleOwnerTest($moduleIDList[1], $productIDList[2])) && p() && e('test3'); // 查询模块1821 产品3的owner
r($bug->getModuleOwnerTest($moduleIDList[1], $productIDList[3])) && p() && e('0'); // 查询模块1821 不存在的产品1000001的owner
r($bug->getModuleOwnerTest($moduleIDList[2], $productIDList[0])) && p() && e('test1'); // 查询模块1821 产品1的owner
r($bug->getModuleOwnerTest($moduleIDList[2], $productIDList[1])) && p() && e('test2'); // 查询模块1821 产品2的owner
r($bug->getModuleOwnerTest($moduleIDList[2], $productIDList[2])) && p() && e('test3'); // 查询模块1821 产品3的owner
r($bug->getModuleOwnerTest($moduleIDList[2], $productIDList[3])) && p() && e('0'); // 查询模块1821 不存在的产品1000001的owner
+44
View File
@@ -0,0 +1,44 @@
#!/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->getPlanBugs();
cid=1
pid=1
查询计划1 状态为all的bug >> BUG3,BUG2,BUG1
查询计划1 状态为active的bug >> BUG3,BUG2,BUG1
查询计划1 状态为resolved的bug >> 0
查询计划1 状态为closed的bug >> 0
查询计划4 状态为all的bug >> BUG6,BUG5,BUG4
查询计划4 状态为active的bug >> BUG6,BUG5,BUG4
查询计划4 状态为resolved的bug >> 0
查询计划4 状态为closed的bug >> 0
查询计划7 状态为all的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7
查询计划7 状态为active的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7
查询计划7 状态为resolved的bug >> 0
查询计划7 状态为closed的bug >> 0
*/
$planIDList = array('1', '4', '7', '1000001');
$statusList = array('all', 'active', 'resolved', 'closed');
$bug=new bugTest();
r($bug->getPlanBugsTest($planIDList[0], $statusList[0])) && p('title') && e('BUG3,BUG2,BUG1'); // 查询计划1 状态为all的bug
r($bug->getPlanBugsTest($planIDList[0], $statusList[1])) && p('title') && e('BUG3,BUG2,BUG1'); // 查询计划1 状态为active的bug
r($bug->getPlanBugsTest($planIDList[0], $statusList[2])) && p('title') && e('0'); // 查询计划1 状态为resolved的bug
r($bug->getPlanBugsTest($planIDList[0], $statusList[3])) && p('title') && e('0'); // 查询计划1 状态为closed的bug
r($bug->getPlanBugsTest($planIDList[1], $statusList[0])) && p('title') && e('BUG6,BUG5,BUG4'); // 查询计划4 状态为all的bug
r($bug->getPlanBugsTest($planIDList[1], $statusList[1])) && p('title') && e('BUG6,BUG5,BUG4'); // 查询计划4 状态为active的bug
r($bug->getPlanBugsTest($planIDList[1], $statusList[2])) && p('title') && e('0'); // 查询计划4 状态为resolved的bug
r($bug->getPlanBugsTest($planIDList[1], $statusList[3])) && p('title') && e('0'); // 查询计划4 状态为closed的bug
r($bug->getPlanBugsTest($planIDList[2], $statusList[0])) && p('title') && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 查询计划7 状态为all的bug
r($bug->getPlanBugsTest($planIDList[2], $statusList[1])) && p('title') && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 查询计划7 状态为active的bug
r($bug->getPlanBugsTest($planIDList[2], $statusList[2])) && p('title') && e('0'); // 查询计划7 状态为resolved的bug
r($bug->getPlanBugsTest($planIDList[2], $statusList[3])) && p('title') && e('0'); // 查询计划7 状态为closed的bug