From 69539bd1852260a7819a044d772e85566771972b Mon Sep 17 00:00:00 2001 From: liumengyi Date: Tue, 22 Mar 2022 08:31:54 +0800 Subject: [PATCH] * Add auto test of bug. --- test/class/bug.class.php | 404 +++++++++++++++++- test/model/bug/getbuginfofromresult.php | 33 ++ .../bug/getdataofbugsperactivatedcount.php | 18 + test/model/bug/getdataofbugsperassignedto.php | 24 ++ test/model/bug/getdataofbugsperbuild.php | 22 + test/model/bug/getdataofbugsperexecution.php | 34 ++ test/model/bug/getdataofbugspermodule.php | 37 ++ test/model/bug/getdataofbugsperpri.php | 24 ++ test/model/bug/getdataofbugsperresolution.php | 31 ++ test/model/bug/getdataofbugsperseverity.php | 24 ++ test/model/bug/getdataofbugsperstatus.php | 22 + test/model/bug/getdataofbugspertype.php | 34 ++ test/model/bug/getdataofclosedbugsperday.php | 18 + test/model/bug/getdataofclosedbugsperuser.php | 18 + test/model/bug/getdataofopenedbugsperday.php | 18 + test/model/bug/getdataofopenedbugsperuser.php | 18 + .../model/bug/getdataofresolvedbugsperday.php | 37 ++ .../bug/getdataofresolvedbugsperuser.php | 20 + test/model/bug/getstorybugcounts.php | 32 ++ test/model/bug/getstorybugs.php | 32 ++ 20 files changed, 896 insertions(+), 4 deletions(-) create mode 100755 test/model/bug/getbuginfofromresult.php create mode 100755 test/model/bug/getdataofbugsperactivatedcount.php create mode 100755 test/model/bug/getdataofbugsperassignedto.php create mode 100755 test/model/bug/getdataofbugsperbuild.php create mode 100755 test/model/bug/getdataofbugsperexecution.php create mode 100755 test/model/bug/getdataofbugspermodule.php create mode 100755 test/model/bug/getdataofbugsperpri.php create mode 100755 test/model/bug/getdataofbugsperresolution.php create mode 100755 test/model/bug/getdataofbugsperseverity.php create mode 100755 test/model/bug/getdataofbugsperstatus.php create mode 100755 test/model/bug/getdataofbugspertype.php create mode 100755 test/model/bug/getdataofclosedbugsperday.php create mode 100755 test/model/bug/getdataofclosedbugsperuser.php create mode 100755 test/model/bug/getdataofopenedbugsperday.php create mode 100755 test/model/bug/getdataofopenedbugsperuser.php create mode 100755 test/model/bug/getdataofresolvedbugsperday.php create mode 100755 test/model/bug/getdataofresolvedbugsperuser.php create mode 100755 test/model/bug/getstorybugcounts.php create mode 100755 test/model/bug/getstorybugs.php diff --git a/test/class/bug.class.php b/test/class/bug.class.php index 4fec212792..8167405ecb 100644 --- a/test/class/bug.class.php +++ b/test/class/bug.class.php @@ -1346,7 +1346,7 @@ class bugTest * @param int $buildID * @param int $productID * @access public - * @return array + * @return string */ public function getProductLeftBugsTest($buildID, $productID) { @@ -1372,7 +1372,7 @@ class bugTest * * @param int $productID * @access public - * @return array + * @return string */ public function getProductBugPairsTest($productID) { @@ -1398,7 +1398,7 @@ class bugTest * * @param int $productID * @access public - * @return array + * @return string */ public function getProductMemberPairsTest($productID) { @@ -1425,7 +1425,7 @@ class bugTest * @param int $buildID * @param int $productID * @access public - * @return array + * @return string */ public function getReleaseBugsTest($buildID, $productID) { @@ -1445,4 +1445,400 @@ class bugTest return $title; } } + + /** + * Test get bugs of a story. + * + * @param int $storyID + * @access public + * @return string + */ + public function getStoryBugsTest($storyID) + { + $array = $this->objectModel->getStoryBugs($storyID); + + $title = ''; + foreach($array as $bug) $title .= ',' . $bug->title; + $title = trim($title, ','); + $title = str_replace("'", '', $title); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $title; + } + } + + /** + * Test get case bugs. + * + * @param int $runID + * @param int $caseID + * @param int $version + * @access public + * @return string + */ + public function getCaseBugsTest($runID, $caseID = 0, $version = 0) + { + $array = $this->objectModel->getCaseBugs($runID, $caseID, $version); + + $title = ''; + foreach($array as $bug) $title .= ',' . $bug->title; + $title = trim($title, ','); + $title = str_replace("'", '', $title); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $title; + } + } + + /** + * Test get counts of some stories' bugs. + * + * @param array $storyIDList + * @param int $storyID + * @access public + * @return int + */ + public function getStoryBugCountsTest($storyIDList, $storyID) + { + $array = $this->objectModel->getStoryBugCounts($storyIDList); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return isset($array[$storyID]) ? $array[$storyID] : 0; + } + } + + /** + * Test get report data of bugs per execution. + * + * @access public + * @return array + */ + public function getDataOfBugsPerExecutionTest() + { + $array = $this->objectModel->getDataOfBugsPerExecution(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of bugs per build. + * + * @access public + * @return array + */ + public function getDataOfBugsPerBuildTest() + { + $array = $this->objectModel->getDataOfBugsPerBuild(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of bugs per module. + * + * @access public + * @return array + */ + public function getDataOfBugsPerModuleTest() + { + $array = $this->objectModel->getDataOfBugsPerModule(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of opened bugs per day. + * + * @access public + * @return array + */ + public function getDataOfOpenedBugsPerDayTest() + { + $array = $this->objectModel->getDataOfOpenedBugsPerDay(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of resolved bugs per day. + * + * @access public + * @return array + */ + public function getDataOfResolvedBugsPerDayTest() + { + $array = $this->objectModel->getDataOfResolvedBugsPerDay(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of closed bugs per day. + * + * @access public + * @return array + */ + public function getDataOfClosedBugsPerDayTest() + { + $array = $this->objectModel->getDataOfClosedBugsPerDay(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of openeded bugs per user. + * + * @access public + * @return array + */ + public function getDataOfOpenedBugsPerUserTest() + { + $array = $this->objectModel->getDataOfOpenedBugsPerUser(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of resolved bugs per user. + * + * @access public + * @return array + */ + public function getDataOfResolvedBugsPerUserTest() + { + $array = $this->objectModel->getDataOfResolvedBugsPerUser(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of closed bugs per user. + * + * @access public + * @return array + */ + public function getDataOfClosedBugsPerUserTest() + { + $array = $this->objectModel->getDataOfClosedBugsPerUser(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of bugs per severity. + * + * @access public + * @return array + */ + public function getDataOfBugsPerSeverityTest() + { + $array = $this->objectModel->getDataOfBugsPerSeverity(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of bugs per resolution. + * + * @access public + * @return array + */ + public function getDataOfBugsPerResolutionTest() + { + $array = $this->objectModel->getDataOfBugsPerResolution(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of bugs per status. + * + * @access public + * @return array + */ + public function getDataOfBugsPerStatusTest() + { + $array = $this->objectModel->getDataOfBugsPerStatus(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of bugs per pri. + * + * @access public + * @return array + */ + public function getDataOfBugsPerPriTest() + { + $array = $this->objectModel->getDataOfBugsPerPri(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of bugs per status. + * + * @access public + * @return array + */ + public function getDataOfBugsPerActivatedCountTest() + { + $array = $this->objectModel->getDataOfBugsPerActivatedCount(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of bugs per type. + * + * @access public + * @return array + */ + public function getDataOfBugsPerTypeTest() + { + $array = $this->objectModel->getDataOfBugsPerType(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } + + /** + * Test get report data of bugs per assignedTo. + * + * @access public + * @return array + */ + public function getDataOfBugsPerAssignedToTest() + { + $array = $this->objectModel->getDataOfBugsPerAssignedTo(); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $array; + } + } } diff --git a/test/model/bug/getbuginfofromresult.php b/test/model/bug/getbuginfofromresult.php new file mode 100755 index 0000000000..5147c28e72 --- /dev/null +++ b/test/model/bug/getbuginfofromresult.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +getExecutionBugs(); +cid=1 +pid=1 + +测试获取执行ID为101的bug >> BUG3,BUG2,BUG1 +测试获取执行ID为102的bug >> BUG6,BUG5,BUG4 +测试获取执行ID为103的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7 +测试获取执行ID为104的bug >> BUG12,BUG11,BUG10 +测试获取执行ID为105的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();15,BUG14,BUG13 +测试获取执行ID为106的bug >> BUG18,BUG17,bug16 +测试获取不存在的执行的bug >> 0 + + +*/ + + +$executionIDList = array('101', '102', '103', '104', '105', '106', '1000001'); + +$bug=new bugTest(); +r($bug->getExecutionBugsTest($executionIDList[0])) && p() && e('BUG3,BUG2,BUG1'); // 测试获取执行ID为101的bug +r($bug->getExecutionBugsTest($executionIDList[1])) && p() && e('BUG6,BUG5,BUG4'); // 测试获取执行ID为102的bug +r($bug->getExecutionBugsTest($executionIDList[2])) && p() && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7'); // 测试获取执行ID为103的bug +r($bug->getExecutionBugsTest($executionIDList[3])) && p() && e('BUG12,BUG11,BUG10'); // 测试获取执行ID为104的bug +r($bug->getExecutionBugsTest($executionIDList[4])) && p() && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();15,BUG14,BUG13'); // 测试获取执行ID为105的bug +r($bug->getExecutionBugsTest($executionIDList[5])) && p() && e('BUG18,BUG17,bug16'); // 测试获取执行ID为106的bug +r($bug->getExecutionBugsTest($executionIDList[6])) && p() && e('0'); // 测试获取不存在的执行的bug diff --git a/test/model/bug/getdataofbugsperactivatedcount.php b/test/model/bug/getdataofbugsperactivatedcount.php new file mode 100755 index 0000000000..739a8f941d --- /dev/null +++ b/test/model/bug/getdataofbugsperactivatedcount.php @@ -0,0 +1,18 @@ +#!/usr/bin/env php +getDataOfBugsPerActivatedCount(); +cid=1 +pid=1 + +获取bug激活次数数据 >> 激活次数:0,300 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfBugsPerActivatedCountTest()) && p('0:name,value') && e('激活次数:0,300'); // 获取bug激活次数数据 diff --git a/test/model/bug/getdataofbugsperassignedto.php b/test/model/bug/getdataofbugsperassignedto.php new file mode 100755 index 0000000000..502b8e2d33 --- /dev/null +++ b/test/model/bug/getdataofbugsperassignedto.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +getDataOfBugsPerAssignedTo(); +cid=1 +pid=1 + +获取用户admin数据 >> admin,80 +获取用户dev1数据 >> 开发1,80 +获取用户test1数据 >> 测试1,80 +获取用户closed数据 >> Closed,20 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfBugsPerAssignedToTest()) && p('admin:name,value') && e('admin,80'); // 获取用户admin数据 +r($bug->getDataOfBugsPerAssignedToTest()) && p('dev1:name,value') && e('dev1,80'); // 获取用户dev1数据 +r($bug->getDataOfBugsPerAssignedToTest()) && p('test1:name,value') && e('test1,80'); // 获取用户test1数据 +r($bug->getDataOfBugsPerAssignedToTest()) && p('closed:name,value') && e('closed,20'); // 获取用户closed数据 diff --git a/test/model/bug/getdataofbugsperbuild.php b/test/model/bug/getdataofbugsperbuild.php new file mode 100755 index 0000000000..0134f8e00a --- /dev/null +++ b/test/model/bug/getdataofbugsperbuild.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +getDataOfBugsPerBuild(); +cid=1 +pid=1 + +获取主干bug数 >> 主干,291 +获取bug数 >> ,3 +获取迭代版本版本1bug数 >> 迭代版本版本1,6 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfBugsPerBuildTest()) && p('trunk:name,value') && e('主干,291'); // 获取主干bug数 +r($bug->getDataOfBugsPerBuildTest()) && p('0:name,value') && e(',3'); // 获取bug数 +r($bug->getDataOfBugsPerBuildTest()) && p('1:name,value') && e('迭代版本版本1,6'); // 获取迭代版本版本1bug数 diff --git a/test/model/bug/getdataofbugsperexecution.php b/test/model/bug/getdataofbugsperexecution.php new file mode 100755 index 0000000000..77b6b2b7cc --- /dev/null +++ b/test/model/bug/getdataofbugsperexecution.php @@ -0,0 +1,34 @@ +#!/usr/bin/env php +getDataOfBugsPerExecution(); +cid=1 +pid=1 + +获取执行101数据 >> 迭代1,3,迭代1 +获取执行102数据 >> 迭代2,3,迭代2 +获取执行103数据 >> 迭代3,3,迭代3 +获取执行131数据 >> 阶段31,3,阶段31 +获取执行132数据 >> 阶段32,3,阶段32 +获取执行133数据 >> 阶段33,3,阶段33 +获取执行161数据 >> 看板61,3,看板61 +获取执行162数据 >> 看板62,3,看板62 +获取执行163数据 >> 看板63,3,看板63 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfBugsPerExecutionTest()) && p('101:name,value,title') && e('迭代1,3,迭代1'); // 获取执行101数据 +r($bug->getDataOfBugsPerExecutionTest()) && p('102:name,value,title') && e('迭代2,3,迭代2'); // 获取执行102数据 +r($bug->getDataOfBugsPerExecutionTest()) && p('103:name,value,title') && e('迭代3,3,迭代3'); // 获取执行103数据 +r($bug->getDataOfBugsPerExecutionTest()) && p('131:name,value,title') && e('阶段31,3,阶段31'); // 获取执行131数据 +r($bug->getDataOfBugsPerExecutionTest()) && p('132:name,value,title') && e('阶段32,3,阶段32'); // 获取执行132数据 +r($bug->getDataOfBugsPerExecutionTest()) && p('133:name,value,title') && e('阶段33,3,阶段33'); // 获取执行133数据 +r($bug->getDataOfBugsPerExecutionTest()) && p('161:name,value,title') && e('看板61,3,看板61'); // 获取执行161数据 +r($bug->getDataOfBugsPerExecutionTest()) && p('162:name,value,title') && e('看板62,3,看板62'); // 获取执行162数据 +r($bug->getDataOfBugsPerExecutionTest()) && p('163:name,value,title') && e('看板63,3,看板63'); // 获取执行163数据 diff --git a/test/model/bug/getdataofbugspermodule.php b/test/model/bug/getdataofbugspermodule.php new file mode 100755 index 0000000000..d873788b4b --- /dev/null +++ b/test/model/bug/getdataofbugspermodule.php @@ -0,0 +1,37 @@ +#!/usr/bin/env php +getDataOfBugsPerModule(); +cid=1 +pid=1 + +获取module0数据 >> /,291 +获取module1821数据 >> /产品模块1,1 +获取module1822数据 >> /产品模块2,1 +获取module1823数据 >> /产品模块3,1 +获取module1825数据 >> /产品模块5,1 +获取module1826数据 >> /产品模块6,1 +获取module1827数据 >> /产品模块7,1 +获取module1831数据 >> /产品模块11,1 +获取module1832数据 >> /产品模块12,1 +获取module1833数据 >> /产品模块13,1 + + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfBugsPerModuleTest()) && p('0:name,value') && e('/,291'); // 获取module0数据 +r($bug->getDataOfBugsPerModuleTest()) && p('1821:name,value') && e('/产品模块1821,1'); // 获取module1821数据 +r($bug->getDataOfBugsPerModuleTest()) && p('1822:name,value') && e('/产品模块1822,1'); // 获取module1822数据 +r($bug->getDataOfBugsPerModuleTest()) && p('1823:name,value') && e('/产品模块1823,1'); // 获取module1823数据 +r($bug->getDataOfBugsPerModuleTest()) && p('1825:name,value') && e('/产品模块1825,1'); // 获取module1825数据 +r($bug->getDataOfBugsPerModuleTest()) && p('1826:name,value') && e('/产品模块1826,1'); // 获取module1826数据 +r($bug->getDataOfBugsPerModuleTest()) && p('1827:name,value') && e('/产品模块1827,1'); // 获取module1827数据 +r($bug->getDataOfBugsPerModuleTest()) && p('1831:name,value') && e('/产品模块1831,1'); // 获取module1831数据 +r($bug->getDataOfBugsPerModuleTest()) && p('1832:name,value') && e('/产品模块1832,1'); // 获取module1832数据 +r($bug->getDataOfBugsPerModuleTest()) && p('1833:name,value') && e('/产品模块1833,1'); // 获取module1833数据 diff --git a/test/model/bug/getdataofbugsperpri.php b/test/model/bug/getdataofbugsperpri.php new file mode 100755 index 0000000000..2ddad468aa --- /dev/null +++ b/test/model/bug/getdataofbugsperpri.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +getDataOfBugsPerPri(); +cid=1 +pid=1 + +获取pri为1的数据 >> 优先级:1,75 +获取pri为2的数据 >> 优先级:2,75 +获取pri为3的数据 >> 优先级:3,75 +获取pri为4的数据 >> 优先级:4,75 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfBugsPerPriTest()) && p('1:name,value') && e('优先级:1,75'); // 获取pri为1的数据 +r($bug->getDataOfBugsPerPriTest()) && p('2:name,value') && e('优先级:2,75'); // 获取pri为2的数据 +r($bug->getDataOfBugsPerPriTest()) && p('3:name,value') && e('优先级:3,75'); // 获取pri为3的数据 +r($bug->getDataOfBugsPerPriTest()) && p('4:name,value') && e('优先级:4,75'); // 获取pri为4的数据 diff --git a/test/model/bug/getdataofbugsperresolution.php b/test/model/bug/getdataofbugsperresolution.php new file mode 100755 index 0000000000..51571b1b54 --- /dev/null +++ b/test/model/bug/getdataofbugsperresolution.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +getDataOfBugsPerResolution(); +cid=1 +pid=1 + +获取状态为fixed的数据 >> 已解决,45 +获取状态为duplicate的数据 >> 重复Bug,30 +获取状态为external的数据 >> 设计如此,18 +获取状态为external的数据 >> 外部原因,18 +获取状态为willnotfix的数 >> 不予解决,18 +获取状态为postponed的数据 >> 延期处理,12 +获取状态为notrepro的数据 >> 无法重现,9 + + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfBugsPerResolutionTest()) && p('fixed:name,value') && e('已解决,45'); // 获取状态为fixed的数据 +r($bug->getDataOfBugsPerResolutionTest()) && p('duplicate:name,value') && e('重复Bug,30'); // 获取状态为duplicate的数据 +r($bug->getDataOfBugsPerResolutionTest()) && p('bydesign:name,value') && e('设计如此,18'); // 获取状态为external的数据 +r($bug->getDataOfBugsPerResolutionTest()) && p('external:name,value') && e('外部原因,18'); // 获取状态为external的数据 +r($bug->getDataOfBugsPerResolutionTest()) && p('willnotfix:name,value') && e('不予解决,18'); // 获取状态为willnotfix的数据 +r($bug->getDataOfBugsPerResolutionTest()) && p('postponed:name,value') && e('延期处理,12'); // 获取状态为postponed的数据 +r($bug->getDataOfBugsPerResolutionTest()) && p('notrepro:name,value') && e('无法重现,9'); // 获取状态为notrepro的数据 diff --git a/test/model/bug/getdataofbugsperseverity.php b/test/model/bug/getdataofbugsperseverity.php new file mode 100755 index 0000000000..714db1ef40 --- /dev/null +++ b/test/model/bug/getdataofbugsperseverity.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +getDataOfBugsPerSeverity(); +cid=1 +pid=1 + +获取严重程度1数据 >> 1,75 +获取严重程度2数据 >> 2,75 +获取严重程度3数据 >> 3,75 +获取严重程度4数据 >> 4,75 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfBugsPerSeverityTest()) && p('1:name,value') && e('1,75'); // 获取严重程度1数据 +r($bug->getDataOfBugsPerSeverityTest()) && p('2:name,value') && e('2,75'); // 获取严重程度2数据 +r($bug->getDataOfBugsPerSeverityTest()) && p('3:name,value') && e('3,75'); // 获取严重程度3数据 +r($bug->getDataOfBugsPerSeverityTest()) && p('4:name,value') && e('4,75'); // 获取严重程度4数据 diff --git a/test/model/bug/getdataofbugsperstatus.php b/test/model/bug/getdataofbugsperstatus.php new file mode 100755 index 0000000000..9853562ea6 --- /dev/null +++ b/test/model/bug/getdataofbugsperstatus.php @@ -0,0 +1,22 @@ +#!/usr/bin/env php +getDataOfBugsPerStatus(); +cid=1 +pid=1 + +获取状态为active的数据 >> 激活,150 +获取状态为resolved的数据 >> 已解决,90 +获取状态为closed的数据 >> 已关闭,60 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfBugsPerStatusTest()) && p('active:name,value') && e('激活,150'); // 获取状态为active的数据 +r($bug->getDataOfBugsPerStatusTest()) && p('resolved:name,value') && e('已解决,90'); // 获取状态为resolved的数据 +r($bug->getDataOfBugsPerStatusTest()) && p('closed:name,value') && e('已关闭,60'); // 获取状态为closed的数据 diff --git a/test/model/bug/getdataofbugspertype.php b/test/model/bug/getdataofbugspertype.php new file mode 100755 index 0000000000..ce8dc819e3 --- /dev/null +++ b/test/model/bug/getdataofbugspertype.php @@ -0,0 +1,34 @@ +#!/usr/bin/env php +getDataOfBugsPerType(); +cid=1 +pid=1 + +获取类型为codeerror的数据 >> 代码错误,34 +获取类型为config的数据 >> 配置相关,34 +获取类型为install的数据 >> 安装部署,34 +获取类型为security的数据 >> 安全相关,33 +获取类型为performance的数据 >> 性能问题,33 +获取类型为standard的数据 >> 标准规范,33 +获取类型为automation的数据 >> 测试脚本,33 +获取类型为designdefect的数据 >> 设计缺陷,33 +获取类型为others的数据 >> 其他,33 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfBugsPerTypeTest()) && p('codeerror:name,value') && e('代码错误,34'); // 获取类型为codeerror的数据 +r($bug->getDataOfBugsPerTypeTest()) && p('config:name,value') && e('配置相关,34'); // 获取类型为config的数据 +r($bug->getDataOfBugsPerTypeTest()) && p('install:name,value') && e('安装部署,34'); // 获取类型为install的数据 +r($bug->getDataOfBugsPerTypeTest()) && p('security:name,value') && e('安全相关,33'); // 获取类型为security的数据 +r($bug->getDataOfBugsPerTypeTest()) && p('performance:name,value') && e('性能问题,33'); // 获取类型为performance的数据 +r($bug->getDataOfBugsPerTypeTest()) && p('standard:name,value') && e('标准规范,33'); // 获取类型为standard的数据 +r($bug->getDataOfBugsPerTypeTest()) && p('automation:name,value') && e('测试脚本,33'); // 获取类型为automation的数据 +r($bug->getDataOfBugsPerTypeTest()) && p('designdefect:name,value') && e('设计缺陷,33'); // 获取类型为designdefect的数据 +r($bug->getDataOfBugsPerTypeTest()) && p('others:name,value') && e('其他,33'); // 获取类型为others的数据 diff --git a/test/model/bug/getdataofclosedbugsperday.php b/test/model/bug/getdataofclosedbugsperday.php new file mode 100755 index 0000000000..731cacc9da --- /dev/null +++ b/test/model/bug/getdataofclosedbugsperday.php @@ -0,0 +1,18 @@ +#!/usr/bin/env php +getDataOfClosedBugsPerDay(); +cid=1 +pid=1 + +获取关闭bug的数据 >> 0 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfClosedBugsPerDayTest()) && p() && e('0'); // 获取关闭bug的数据 diff --git a/test/model/bug/getdataofclosedbugsperuser.php b/test/model/bug/getdataofclosedbugsperuser.php new file mode 100755 index 0000000000..1b7b21b933 --- /dev/null +++ b/test/model/bug/getdataofclosedbugsperuser.php @@ -0,0 +1,18 @@ +#!/usr/bin/env php +getDataOfClosedBugsPerUser(); +cid=1 +pid=1 + +获取admin关闭的数据 >> admin,100 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfClosedBugsPerUserTest()) && p('admin:name,value') && e('admin,100'); // 获取admin关闭的数据 diff --git a/test/model/bug/getdataofopenedbugsperday.php b/test/model/bug/getdataofopenedbugsperday.php new file mode 100755 index 0000000000..81b4484f33 --- /dev/null +++ b/test/model/bug/getdataofopenedbugsperday.php @@ -0,0 +1,18 @@ +#!/usr/bin/env php +getDataOfOpenedBugsPerDay(); +cid=1 +pid=1 + +获取创建的数据 >> 300 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfOpenedBugsPerDayTest()) && p('0:value') && e('300'); // 获取创建的数据 diff --git a/test/model/bug/getdataofopenedbugsperuser.php b/test/model/bug/getdataofopenedbugsperuser.php new file mode 100755 index 0000000000..2fcddec550 --- /dev/null +++ b/test/model/bug/getdataofopenedbugsperuser.php @@ -0,0 +1,18 @@ +#!/usr/bin/env php +getDataOfOpenedBugsPerUser(); +cid=1 +pid=1 + +获取admin创建的数据 >> admin,300 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfOpenedBugsPerUserTest()) && p('admin:name,value') && e('admin,300'); // 获取admin创建的数据 diff --git a/test/model/bug/getdataofresolvedbugsperday.php b/test/model/bug/getdataofresolvedbugsperday.php new file mode 100755 index 0000000000..8bd3b7e5ab --- /dev/null +++ b/test/model/bug/getdataofresolvedbugsperday.php @@ -0,0 +1,37 @@ +#!/usr/bin/env php +getDataOfResolvedBugsPerDay(); +cid=1 +pid=1 + +获取解决的bug0 >> 14 +获取解决的bug1 >> 14 +获取解决的bug2 >> 14 +获取解决的bug3 >> 14 +获取解决的bug4 >> 14 +获取解决的bug5 >> 14 +获取解决的bug6 >> 14 +获取解决的bug7 >> 14 +获取解决的bug8 >> 14 +获取解决的bug9 >> 14 + + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfResolvedBugsPerDayTest()) && p('0:value') && e('14'); // 获取解决的bug0 +r($bug->getDataOfResolvedBugsPerDayTest()) && p('1:value') && e('14'); // 获取解决的bug1 +r($bug->getDataOfResolvedBugsPerDayTest()) && p('2:value') && e('14'); // 获取解决的bug2 +r($bug->getDataOfResolvedBugsPerDayTest()) && p('3:value') && e('14'); // 获取解决的bug3 +r($bug->getDataOfResolvedBugsPerDayTest()) && p('4:value') && e('14'); // 获取解决的bug4 +r($bug->getDataOfResolvedBugsPerDayTest()) && p('5:value') && e('14'); // 获取解决的bug5 +r($bug->getDataOfResolvedBugsPerDayTest()) && p('6:value') && e('14'); // 获取解决的bug6 +r($bug->getDataOfResolvedBugsPerDayTest()) && p('7:value') && e('14'); // 获取解决的bug7 +r($bug->getDataOfResolvedBugsPerDayTest()) && p('8:value') && e('14'); // 获取解决的bug8 +r($bug->getDataOfResolvedBugsPerDayTest()) && p('9:value') && e('14'); // 获取解决的bug9 diff --git a/test/model/bug/getdataofresolvedbugsperuser.php b/test/model/bug/getdataofresolvedbugsperuser.php new file mode 100755 index 0000000000..05ca287d74 --- /dev/null +++ b/test/model/bug/getdataofresolvedbugsperuser.php @@ -0,0 +1,20 @@ +#!/usr/bin/env php +getDataOfResolvedBugsPerUser(); +cid=1 +pid=1 + +获取admin解决的bug数 >> admin,60 +获取$assignTo解决的bug数 >> $assignedTo,90 + +*/ + + +$bug=new bugTest(); +r($bug->getDataOfResolvedBugsPerUserTest()) && p('admin:name,value') && e('admin,60'); // 获取admin解决的bug数 +r($bug->getDataOfResolvedBugsPerUserTest()) && p('$assignedTo:name,value') && e('$assignedTo,90'); // 获取$assignTo解决的bug数 diff --git a/test/model/bug/getstorybugcounts.php b/test/model/bug/getstorybugcounts.php new file mode 100755 index 0000000000..ed005c5922 --- /dev/null +++ b/test/model/bug/getstorybugcounts.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +getStoryBugCounts(); +cid=1 +pid=1 + +测试获取关联storyID为2的bug数量 >> 3 +测试获取关联storyID为6的bug数量 >> 3 +测试获取关联storyID为10的bug数量 >> 3 +测试获取关联storyID为14的bug数量 >> 3 +测试获取关联storyID为18的bug数量 >> 3 +测试获取关联storyID为22的bug数量 >> 3 +测试获取关联storyID不存在的bug数量 >> 0 + +*/ + + +$storyIDList = array('2', '6', '10', '14', '18', '22', '1000001'); + +$bug=new bugTest(); +r($bug->getStoryBugCountsTest($storyIDList, $storyIDList[0])) && p() && e('3'); // 测试获取关联storyID为2的bug数量 +r($bug->getStoryBugCountsTest($storyIDList, $storyIDList[1])) && p() && e('3'); // 测试获取关联storyID为6的bug数量 +r($bug->getStoryBugCountsTest($storyIDList, $storyIDList[2])) && p() && e('3'); // 测试获取关联storyID为10的bug数量 +r($bug->getStoryBugCountsTest($storyIDList, $storyIDList[3])) && p() && e('3'); // 测试获取关联storyID为14的bug数量 +r($bug->getStoryBugCountsTest($storyIDList, $storyIDList[4])) && p() && e('3'); // 测试获取关联storyID为18的bug数量 +r($bug->getStoryBugCountsTest($storyIDList, $storyIDList[5])) && p() && e('3'); // 测试获取关联storyID为22的bug数量 +r($bug->getStoryBugCountsTest($storyIDList, $storyIDList[6])) && p() && e('0'); // 测试获取关联storyID不存在的bug数量 diff --git a/test/model/bug/getstorybugs.php b/test/model/bug/getstorybugs.php new file mode 100755 index 0000000000..87b4133fe4 --- /dev/null +++ b/test/model/bug/getstorybugs.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +getStoryBugs(); +cid=1 +pid=1 + +测试获取关联需求ID为2的bug >> BUG1,BUG101,BUG201 +测试获取关联需求ID为6的bug >> BUG2,BUG102,BUG202 +测试获取关联需求ID为10的bug >> BUG3,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();103,BUG203 +测试获取关联需求ID为14的bug >> BUG4,bug104,BUG204 +测试获取关联需求ID为18的bug >> BUG5,BUG105,BUG205 +测试获取关联需求ID为22的bug >> BUG6,BUG106,BUG206 +测试获取不存在的关联需求的bug >> 0 + +*/ + + +$storyIDList = array('2', '6', '10', '14', '18', '22', '1000001'); + +$bug=new bugTest(); +r($bug->getStoryBugsTest($storyIDList[0])) && p() && e('BUG1,BUG101,BUG201'); // 测试获取关联需求ID为2的bug +r($bug->getStoryBugsTest($storyIDList[1])) && p() && e('BUG2,BUG102,BUG202'); // 测试获取关联需求ID为6的bug +r($bug->getStoryBugsTest($storyIDList[2])) && p() && e('BUG3,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();103,BUG203'); // 测试获取关联需求ID为10的bug +r($bug->getStoryBugsTest($storyIDList[3])) && p() && e('BUG4,bug104,BUG204'); // 测试获取关联需求ID为14的bug +r($bug->getStoryBugsTest($storyIDList[4])) && p() && e('BUG5,BUG105,BUG205'); // 测试获取关联需求ID为18的bug +r($bug->getStoryBugsTest($storyIDList[5])) && p() && e('BUG6,BUG106,BUG206'); // 测试获取关联需求ID为22的bug +r($bug->getStoryBugsTest($storyIDList[6])) && p() && e('0'); // 测试获取不存在的关联需求的bug