From caf5fbd77b6de1ace98178e8203bf4abf8934894 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 2 Jun 2023 14:05:45 +0800 Subject: [PATCH] - Remove unit test of bugModel-getOverdueBugs. --- module/bug/test/bug.class.php | 33 ------------------ module/bug/test/model/getoverduebugs.php | 44 ------------------------ 2 files changed, 77 deletions(-) delete mode 100755 module/bug/test/model/getoverduebugs.php diff --git a/module/bug/test/bug.class.php b/module/bug/test/bug.class.php index 0b03014dd4..c648b94ee0 100644 --- a/module/bug/test/bug.class.php +++ b/module/bug/test/bug.class.php @@ -361,39 +361,6 @@ class bugTest } } - /** - * Test get bugs the overdueBugs is active or unclosed. - * - * @param string $productIDList - * @param string $modules - * @access public - * @return string - */ - public function getOverdueBugsTest($productIDList, $modules) - { - global $tester; - $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); - - $bugs = $this->objectModel->getOverdueBugs($productIDList, 'all', $modules, $executions, 'id_desc', null, 0); - - $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 by Sonarqube id. * diff --git a/module/bug/test/model/getoverduebugs.php b/module/bug/test/model/getoverduebugs.php deleted file mode 100755 index 43c81c02d5..0000000000 --- a/module/bug/test/model/getoverduebugs.php +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env php -getOverdueBugs(); -cid=1 -pid=1 - -查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug >> bug8,BUG4,BUG1 -查询产品1 2 3 不存在的产品10001 与模块1821, 1825下过期未解决的bug >> BUG4,BUG1 -查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下过期未解决的bug >> 0 -查询产品1 2 3 不存在的产品10001下过期未解决的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG2,BUG1 -查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug >> bug8,BUG1 -查询产品1 3与模块1821, 1825下过期未解决的bug >> BUG1 -查询产品1 3与模块不存在的模块1000001下过期未解决的bug >> 0 -查询产品13 不存在的产品10001下过期未解决的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG2,BUG1 -查询不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug >> 0 -查询不存在的产品10001 与模块1821, 1825下过期未解决的bug >> 0 -查询不存在的产品10001 与不存在的模块1000001下过期未解决的bug >> 0 -查询不存在的产品10001下过期未解决的bug >> 0 - -*/ - -$productIDList = array('1,2,3,1000001', '1,3', '1000001'); -$moduleIDList = array('1821,1825,1832,1000001', '1821, 1825', '1000001', '0'); - -$bug=new bugTest(); - -r($bug->getOverdueBugsTest($productIDList[0], $moduleIDList[0])) && p('title') && e('bug8,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[0], $moduleIDList[3])) && p('title') && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG2,BUG1'); // 查询产品1 2 3 不存在的产品10001下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[1], $moduleIDList[0])) && p('title') && e('bug8,BUG1'); // 查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[1], $moduleIDList[3])) && p('title') && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG2,BUG1'); // 查询产品13 不存在的产品10001下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下过期未解决的bug -r($bug->getOverdueBugsTest($productIDList[2], $moduleIDList[3])) && p('title') && e('0'); // 查询不存在的产品10001下过期未解决的bug \ No newline at end of file