* Code for unit test of bug.

This commit is contained in:
liumengyi
2022-08-24 14:56:51 +08:00
parent 00b8ffc6f7
commit 8d8062122e
5 changed files with 19 additions and 9 deletions
+1 -3
View File
@@ -16,7 +16,6 @@ pid=1
指派bugID为3的bug >> assignedTo,admin,user94
指派bugID为4的bug >> assignedTo,admin,user95
指派bugID为51的bug >> assignedTo,dev1,user96
指派bugID为81的bug >> assignedTo,test1,user97
指派人不发生变化的bug >> 0
*/
@@ -36,6 +35,5 @@ r($bug->assignTest($bugIDlist[1],$bug2)) && p('0:field,old,new') && e('assigned
r($bug->assignTest($bugIDlist[2],$bug3)) && p('0:field,old,new') && e('assignedTo,admin,user94'); // 指派bugID为3的bug
r($bug->assignTest($bugIDlist[3],$bug4)) && p('0:field,old,new') && e('assignedTo,admin,user95'); // 指派bugID为4的bug
r($bug->assignTest($bugIDlist[4],$bug51)) && p('0:field,old,new') && e('assignedTo,dev1,user96'); // 指派bugID为51的bug
r($bug->assignTest($bugIDlist[5],$bug81)) && p('0:field,old,new') && e('assignedTo,test1,user97'); // 指派bugID为81的bug
r($bug->assignTest($bugIDlist[5],$bug81)) && p() && e('0'); // 指派人不发生变化的bug
$db->restoreDB();
$db->restoreDB();
+3 -3
View File
@@ -10,7 +10,7 @@ title=bugModel->getBugQuery();
cid=1
pid=1
查询 `product` = 'all' 的bugQuery >> 1 AND `product` IN ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110','111','112','113','114','115','116','117','118','119','120','1','2','3','4','5','6','7','8','9','10','21','22','23','24','25','26','27','28','29','30','41','42','43','44','45','46','47','48','49','50','61','62','63','64','65','66','67','68','69','70','81','82','83','84','85','86','87','88','89','90','101','102','103','104','105','106','107','108','109','110
查询 `product` = 'all' 的bugQuery >> 1 AND `product` IN ('1','2','3','4','5','6','7','8','9','10','21','22','23','24','25','26','27','28','29','30','41','42','43','44','45','46','47','48','49','50','61','62','63','64','65','66','67','68','69','70','81','82','83','84','85','86','87','88','89','90','101','102','103','104','105','106','107','108','109','110','11','12','13','14','15','16','17','18','19','20','31','32','33','34','35','36','37','38','39','40','51','52','53','54','55','56','57','58','59','60','71','72','73','74','75','76','77','78','79','80','91','92','93','94','95','96','97','98','99','100','111','112','113','114','115','116','117','118','119','120','1','2','3','4','5','6','7','8','9','10','21','22','23','24','25','26','27','28','29','30','41','42','43','44','45','46','47','48','49','50','61','62','63','64','65','66','67','68','69','70','81','82','83','84','85','86','87','88','89','90','101','102','103','104','105','106','107','108','109','110')
查询 `project` = 'all' 的bugQuery >> 1 AND `project` in (11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750)
查询 `resolvedDate` = '2022-01-01' 的bugQuery >> `resolvedDate` != '0000-00-00 00:00:00' AND `resolvedDate` > '2022-01-01'
查询 `closedDate` = '2022-01-01' 的bugQuery >> `closedDate` != '0000-00-00 00:00:00' AND `closedDate` <= '2022-01-01'
@@ -31,10 +31,10 @@ $bugQuery[] = " `product` = '1' and `project` = '1' and `story` > 'abc'";
$bug=new bugTest();
r($bug->getBugQueryTest($bugQuery[0])) && p() && e("1 AND `product` IN ('1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29','30','31','32','33','34','35','36','37','38','39','40','41','42','43','44','45','46','47','48','49','50','51','52','53','54','55','56','57','58','59','60','61','62','63','64','65','66','67','68','69','70','71','72','73','74','75','76','77','78','79','80','81','82','83','84','85','86','87','88','89','90','91','92','93','94','95','96','97','98','99','100','101','102','103','104','105','106','107','108','109','110','111','112','113','114','115','116','117','118','119','120','1','2','3','4','5','6','7','8','9','10','21','22','23','24','25','26','27','28','29','30','41','42','43','44','45','46','47','48','49','50','61','62','63','64','65','66','67','68','69','70','81','82','83','84','85','86','87','88','89','90','101','102','103','104','105','106','107','108','109','110')"); // 查询 `product` = 'all' 的bugQuery
r($bug->getBugQueryTest($bugQuery[0])) && p() && e("1 AND `product` IN ('1','2','3','4','5','6','7','8','9','10','21','22','23','24','25','26','27','28','29','30','41','42','43','44','45','46','47','48','49','50','61','62','63','64','65','66','67','68','69','70','81','82','83','84','85','86','87','88','89','90','101','102','103','104','105','106','107','108','109','110','11','12','13','14','15','16','17','18','19','20','31','32','33','34','35','36','37','38','39','40','51','52','53','54','55','56','57','58','59','60','71','72','73','74','75','76','77','78','79','80','91','92','93','94','95','96','97','98','99','100','111','112','113','114','115','116','117','118','119','120','1','2','3','4','5','6','7','8','9','10','21','22','23','24','25','26','27','28','29','30','41','42','43','44','45','46','47','48','49','50','61','62','63','64','65','66','67','68','69','70','81','82','83','84','85','86','87','88','89','90','101','102','103','104','105','106','107','108','109','110')"); // 查询 `product` = 'all' 的bugQuery
r($bug->getBugQueryTest($bugQuery[1])) && p() && e("1 AND `project` in (11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750)"); // 查询 `project` = 'all' 的bugQuery
r($bug->getBugQueryTest($bugQuery[2])) && p() && e(" `resolvedDate` != '0000-00-00 00:00:00' AND `resolvedDate` > '2022-01-01'"); // 查询 `resolvedDate` = '2022-01-01' 的bugQuery
r($bug->getBugQueryTest($bugQuery[3])) && p() && e(" `closedDate` != '0000-00-00 00:00:00' AND `closedDate` <= '2022-01-01'"); // 查询 `closedDate` = '2022-01-01' 的bugQuery
r($bug->getBugQueryTest($bugQuery[4])) && p() && e(" `story` IN (2,12,20,21,22,23,24,25,26,27,28,29,32,42,52,62,70,71,72,73,74,75,76,77,78,79,82,92,102,112,120,121,122,123,124,125,126,127,128,129,132,142,152,162,172,182,192,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,302,312,320,321,322,323,324,325,326,327,328,329,332,342,352,362,372,382,392,402,412,420,421,422,423,424,425,426,427,428,429,432,442) AND `story` != 0"); // 查询 `story` LIKE '%abc%' 的bugQuery
r($bug->getBugQueryTest($bugQuery[5])) && p() && e(" `story` NOT IN (2,12,20,21,22,23,24,25,26,27,28,29,32,42,52,62,70,71,72,73,74,75,76,77,78,79,82,92,102,112,120,121,122,123,124,125,126,127,128,129,132,142,152,162,172,182,192,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,302,312,320,321,322,323,324,325,326,327,328,329,332,342,352,362,372,382,392,402,412,420,421,422,423,424,425,426,427,428,429,432,442) AND `story` != 0"); // 查询 `story` NOT LIKE '%abc%' 的bugQuery
r($bug->getBugQueryTest($bugQuery[6])) && p() && e("`product` = '1' and `project` = '1' and `story` > 'abc' AND `story` != 0"); // 查询 `product` = '1' and `project` = '1' and `story` > 'abc' 的bugQuery
r($bug->getBugQueryTest($bugQuery[6])) && p() && e("`product` = '1' and `project` = '1' and `story` > 'abc' AND `story` != 0"); // 查询 `product` = '1' and `project` = '1' and `story` > 'abc' 的bugQuery
+1 -1
View File
@@ -30,4 +30,4 @@ r($bug->getRelatedObjectsTest($objects[1], $pairs[0])) && p() && e(':,0:'); //
r($bug->getRelatedObjectsTest($objects[2], $pairs[1])) && p() && e(':,0:'); // 获取bug关联的 case 的 id,title
r($bug->getRelatedObjectsTest($objects[3], $pairs[0])) && p() && e(':,0:,trunk:主干'); // 获取bug关联的 resolvedBuild 的 id,name
r($bug->getRelatedObjectsTest($objects[4], $pairs[0])) && p() && e(':,0:,trunk:主干,1:项目版本版本1'); // 获取bug关联的 openedBuild 的 id,name
r($bug->getRelatedObjectsTest($objects[5], $pairs[1])) && p() && e(':,0:,2:软件需求2,6:软件需求6,10:软件需求10,14:软件需求14,18:软件需求18,22:软件需求22,26:软件需求26,30:软件需求30,34:软件需求34'); // 获取bug关联的 story 的 id,title
r($bug->getRelatedObjectsTest($objects[5], $pairs[1])) && p() && e(':,0:,2:软件需求2,6:软件需求6,10:软件需求10,14:软件需求14,18:软件需求18,22:软件需求22,26:软件需求26,30:软件需求30,34:软件需求34'); // 获取bug关联的 story 的 id,title
+3 -1
View File
@@ -10,6 +10,8 @@ title=bugModel->getReviewBugs();
cid=1
pid=1
*/
$productIDList = array('1,2,3,1000001', '1,3');
@@ -36,4 +38,4 @@ r($bug->getReviewBugsTest($productIDList[1], $branch[1], $moduleIDList[1], $exec
r($bug->getReviewBugsTest($productIDList[1], $branch[0], $moduleIDList[0], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支all 模块1821, 1825, 1832 不存在的模块1000001 执行101 111下审批人为当前用户的bug
r($bug->getReviewBugsTest($productIDList[1], $branch[1], $moduleIDList[0], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支1 模块1821, 1825, 1832 不存在的模块1000001 执行101 111下审批人为当前用户的bug
r($bug->getReviewBugsTest($productIDList[1], $branch[0], $moduleIDList[1], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支all 模块1821, 1825 执行101 111下审批人为当前用户的bug
r($bug->getReviewBugsTest($productIDList[1], $branch[1], $moduleIDList[1], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支1 模块1821, 1825 执行101 111下审批人为当前用户的bug
r($bug->getReviewBugsTest($productIDList[1], $branch[1], $moduleIDList[1], $executions[1], $orderBy)) && p('') && e(''); // 查询产品1 3 与分支1 模块1821, 1825 执行101 111下审批人为当前用户的bug
+11 -1
View File
@@ -10,6 +10,16 @@ title=bugModel->getStatistic();
cid=1
pid=1
查询product id为0创建日期在今天的统计信息 >> 0
查询product id为1创建日期在今天的统计信息 >> 0
查询product id为1创建日期在今天的统计信息 >> 0
查询product id为1创建日期在今天的统计信息 >> 0
查询product id为11解决日期在今天的统计信息 >> 1
查询product id为31解决日期在今天的统计信息 >> 0
查询product id为61解决日期在今天的统计信息 >> 0
查询product id为91关闭日期在今天的统计信息 >> 0
查询product id为10001关闭日期在今天的统计信息 >> 0
*/
$productIDList = array('1', '11', '31', '61', '91', '10001');
@@ -24,4 +34,4 @@ r($bug->getStatisticTest($productIDList[1])) && p('openedDate:num') && e('1');
r($bug->getStatisticTest($productIDList[2])) && p('openedDate:num') && e('0'); // 查询product id为31解决日期在今天的统计信息
r($bug->getStatisticTest($productIDList[3])) && p('openedDate:num') && e('0'); // 查询product id为61解决日期在今天的统计信息
r($bug->getStatisticTest($productIDList[4])) && p('openedDate:num') && e('0'); // 查询product id为91关闭日期在今天的统计信息
r($bug->getStatisticTest($productIDList[5])) && p('openedDate:num') && e('0'); // 查询product id为10001关闭日期在今天的统计信息
r($bug->getStatisticTest($productIDList[5])) && p('openedDate:num') && e('0'); // 查询product id为10001关闭日期在今天的统计信息