diff --git a/db/update16.4.sql b/db/update16.4.sql index b807f73ccc..e6ac4d5f6e 100644 --- a/db/update16.4.sql +++ b/db/update16.4.sql @@ -60,4 +60,3 @@ INSERT INTO `zt_config` (`vision`,`owner`, `module`, `section`, `key`, `value`) INSERT INTO `zt_config` (`vision`,`owner`, `module`, `section`, `key`, `value`) VALUES ('lite','system', 'project', '', 'defaultCurrency', 'CNY'); ALTER TABLE `zt_apistruct` CHANGE `desc` `desc` text COLLATE 'utf8_general_ci' NOT NULL DEFAULT '' AFTER `type`; -ALTER TABLE `zt_review` ADD `doc` mediumint NULL AFTER `template`; diff --git a/test/class/bug.class.php b/test/class/bug.class.php index fb0bf4dc0f..70ec0f7e77 100644 --- a/test/class/bug.class.php +++ b/test/class/bug.class.php @@ -46,6 +46,14 @@ class bugTest } } + /** + * Test batch create bugs. + * + * @param int $productID + * @param array $param + * @access public + * @return object + */ public function batchCreateObject($productID, $param = array()) { $modules = array('0', '0', '0'); @@ -108,7 +116,7 @@ class bugTest * @param array $bug * @param int $executionID * @access public - * @return int + * @return object|int */ public function createBugFromGitlabIssueTest($bug, $executionID) { @@ -129,7 +137,7 @@ class bugTest * Test get bugs. * * @access public - * @return int + * @return string */ public function getBugsTest($product, $branch, $browseType, $module) { @@ -149,6 +157,463 @@ class bugTest $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 check delay bug. + * + * @param object $bug + * @param string $status + * @access public + * @return object + */ + public function checkDelayBugTest($bug, $status) + { + $bug->status = $status; + $bug->deadline = $bug->deadline ? date('Y-m-d',strtotime("$bug->deadline day")) : '0000-00-00'; + $bug->resolvedDate = $bug->resolvedDate ? date('Y-m-d',strtotime("$bug->resolvedDate day")) : '0000-00-00'; + + $object = $this->objectModel->checkDelayBug($bug); + if(!isset($object->delay)) $object->delay = 0; + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $object; + } + } + + /** + * Test check delay bugs. + * + * @param string $productIDList + * @access public + * @return string + */ + public function checkDelayedBugsTest($productID) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + /* Load pager. */ + $tester->app->loadClass('pager', $static = true); + $pager = new pager(0, 20 ,1); + + $bugs = $this->objectModel->getAllBugs($productID, 0, 0, $executions, 'id_asc', $pager, 0); + $bugs = $this->objectModel->checkDelayedBugs($bugs); + + $delay = ''; + foreach($bugs as $bug) + { + $delay .= ',' . (!isset($bug->delay) ? 0 : $bug->delay); + } + $delay = trim($delay, ','); + + if(dao::isError()) + { + return dao::getError(); + } + else + { + return $delay; + } + } + + /** + * Test get bugs of a module. + * + * @param string $productIDList + * @param string $moduleIDList + * @access public + * @return string + */ + public function getModuleBugsTest($productIDList, $moduleIDList) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getModuleBugs($productIDList, 'all', $moduleIDList, $executions); + + $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 all bugs. + * + * @param string $productIDList + * @param string $moduleIDList + * @access public + * @return string + */ + public function getAllBugsTest($productIDList, $moduleIDList) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getAllBugs($productIDList, 'all', $moduleIDList, $executions, 'id_desc'); + + $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 bugs of assign to me. + * + * @param string $productIDList + * @param string $moduleIDList + * @access public + * @return string + */ + public function getByAssigntomeTest($productIDList, $moduleIDList) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getByAssigntome($productIDList, 'all', $moduleIDList, $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 bugs of opened by me. + * + * @param string $productIDList + * @param string $moduleIDList + * @access public + * @return string + */ + public function getByOpenedbymeTest($productIDList, $moduleIDList) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getByOpenedbyme($productIDList, 'all', $moduleIDList, $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 bugs of resolved by me. + * + * @param string $productIDList + * @access public + * @return string + */ + public function getByResolvedbymeTest($productIDList) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getByResolvedbyme($productIDList, 'all', '0', $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 bugs of nobody to do. + * + * @param string $productIDList + * @access public + * @return string + */ + public function getByAssigntonullTest($productIDList) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getByAssigntonull($productIDList, 'all', '0', $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 unconfirmed bugs. + * + * @param string $productIDList + * @param string $modules + * @access public + * @return string + */ + public function getUnconfirmedTest($productIDList, $modules) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getUnconfirmed($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 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 bugs the status is active or unclosed. + * + * @param string $productIDList + * @param string $modules + * @access public + * @return string + */ + public function getByStatusTest($productIDList, $modules, $status) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getByStatus($productIDList, 'all', $modules, $executions, $status, '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 unclosed bugs for long time. + * + * @param string $productIDList + * @param string $modules + * @access public + * @return string + */ + public function getByLonglifebugsTest($productIDList, $modules) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getByLonglifebugs($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 postponed bugs. + * + * @param string $productIDList + * @access public + * @return string + */ + public function getByPostponedbugsTest($productIDList) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getByPostponedbugs($productIDList, 'all', '0', $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 bugs need confirm. + * + * @param string $productIDList + * @access public + * @return string + */ + public function getByNeedconfirmTest($productIDList) + { + global $tester; + $executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete'); + + $bugs = $this->objectModel->getByNeedconfirm($productIDList, 'all', '0', $executions, 'id_desc', null, 0); + + $title = ''; + foreach($bugs as $bug) + { + $title .= ',' . $bug->title; + } + $title = trim($title, ','); + $title = str_replace("'", '', $title); if(dao::isError()) { diff --git a/test/class/execution.class.php b/test/class/execution.class.php index ad0c193582..12e317336a 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -1263,6 +1263,7 @@ class executionTest public function getTeamSkipTest($taskID, $begin, $end) { global $tester; + $teams = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($taskID)->andWhere('type')->eq('task')->orderBy('order')->fetchAll('account'); $object = $this->objectModel->getTeamSkip($teams, $begin, $end); @@ -1591,8 +1592,12 @@ class executionTest */ public function getBurnDataFlotTest($executionID = 0, $count) { + $date = date("Y-m-d"); $object = $this->objectModel->getBurnDataFlot($executionID, $burnBy = 'left'); + $todayData = array(); + foreach ($object[$date] as $key => $value) $todayData[$key] = $value; + if(dao::isError()) { $error = dao::getError(); @@ -1600,7 +1605,7 @@ class executionTest } elseif($count == "1") { - return count($object); + return sizeof($todayData); } else { diff --git a/test/class/user.class.php b/test/class/user.class.php old mode 100644 new mode 100755 index c74010d5b8..dc5da2b4bf --- a/test/class/user.class.php +++ b/test/class/user.class.php @@ -520,14 +520,8 @@ class userTest { $myObjects = $this->objectModel->getObjects($account, $type, $status, $orderBy); - if(dao::isError()) - { - return dao::getError(); - } - else - { - return $myObjects; - } + if(dao::isError()) return dao::getError(); + return $myObjects; } /** @@ -542,14 +536,8 @@ class userTest { $contacts = $this->objectModel->getContactLists($account, $params); - if(dao::isError()) - { - return dao::getError(); - } - else - { - return $contacts; - } + if(dao::isError()) return dao::getError(); + return $contacts; } /** @@ -597,7 +585,7 @@ class userTest */ public function getContactUserPairsTest($accountList) { - return $this->objectModel->getContactListByID($listID); + return $this->objectModel->getContactUserPairs($accountList); } /** @@ -612,14 +600,8 @@ class userTest { $listID = $this->objectModel->createContactList($listName, $userList); - if(dao::isError()) - { - return dao::getError(); - } - else - { - return $listID; - } + if(dao::isError()) return dao::getError(); + return $this->objectModel->getContactListByID($listID); } /** @@ -635,13 +617,97 @@ class userTest { $this->objectModel->updateContactList($listID, $listName, $userList); - if(dao::isError()) - { - return dao::getError(); - } - else - { - return $this->objectModel->getContactListByID($listID); - } + if(dao::isError()) return dao::getError(); + return $this->objectModel->getContactListByID($listID); + } + + /** + * Test delete a contact list. + * + * @param int $listID + * @access public + * @return void + */ + public function deleteContactListTest($listID) + { + $this->objectModel->deleteContactList($listID); + + if(dao::isError()) return dao::getError(); + return $this->objectModel->getContactListByID($listID); + } + + /** + * Test delete a contact list. + * + * @param object $user + * @access public + * @return void + */ + public function getDataInJSONTest($user) + { + $user = $this->objectModel->getDataInJSON($user); + + if(dao::isError()) return dao::getError(); + return $user; + } + + /** + * Test get weak users. + * + * @access public + * @return void + */ + public function getWeakUsersTest() + { + $users = $this->objectModel->getWeakUsers(); + + if(dao::isError()) return dao::getError(); + return $users; + } + + /** + * Test compute password strength. + * + * @access public + * @return void + */ + public function computePasswordStrengthTest($password) + { + $strength = $this->objectModel->computePasswordStrength($password); + + if(dao::isError()) return dao::getError(); + return $strength; + } + + /** + * Test compute user view. + * + * @param string $account + * @param bool $force + * @access public + * @return void + */ + public function computeUserViewTest($account, $force = false) + { + $userview = $this->objectModel->computeUserView($account, $force); + + if(dao::isError()) return dao::getError(); + return $userview; + } + + /** + * Test get product members. + * + * @param string $account + * @param bool $force + * @access public + * @return void + */ + public function getProductMembersTest($allProducts) + { + $members = $this->objectModel->getProductMembers($allProducts); + + if(dao::isError()) return dao::getError(); + return $members; } } diff --git a/test/data/bug.yaml b/test/data/bug.yaml index b0c1f76e22..c8fabb5ed1 100644 --- a/test/data/bug.yaml +++ b/test/data/bug.yaml @@ -11,13 +11,13 @@ fields: - field: branch range: 0 - field: module - range: 0 + range: 1821-1823,1825-1827,1831-1833,0{1000000} - field: execution range: 101-700{3} - field: plan range: 0 - field: story - range: 0 + range: 2-400:4 - field: storyVersion range: 1 - field: task @@ -57,7 +57,7 @@ fields: - field: color range: [#3da7f5,#75c941,#2dbdb2,#797ec9,#ffaf38,#ff4e3e] - field: confirmed - range: [0,1]:R + range: 0,1 - field: activatedCount range: 0 - field: mailto @@ -77,8 +77,11 @@ fields: type: timestamp format: "YYYY-MM-DD" - field: deadline - range: "(+2w):60" + range: "(-1M)-(+1w):-1D" type: timestamp + prefix: "" + postfix: "" + loop: 0 format: "YYYY-MM-DD" - field: resolvedBy range: []{50},$assignedTo{30},admin{20} @@ -87,7 +90,12 @@ fields: - field: resolvedBuild range: []{55},trunk{15},[]{25},trunk{5} - field: resolvedDate - range: + range: "(+1w)-(-2w):-1D" + type: timestamp + prefix: "" + postfix: "" + loop: 0 + format: "YYYY-MM-DD" - field: closedBy range: []{80},admin{20} - field: closedDate diff --git a/test/data/story.yaml b/test/data/story.yaml index f27bcd379b..e6afab3695 100644 --- a/test/data/story.yaml +++ b/test/data/story.yaml @@ -260,7 +260,7 @@ fields: format: "" - field: version note: "版本号" - range: 1 + range: 2{100},1{300} prefix: "" postfix: "" loop: 0 diff --git a/test/data/userview.yaml b/test/data/userview.yaml new file mode 100644 index 0000000000..dc46327f4a --- /dev/null +++ b/test/data/userview.yaml @@ -0,0 +1,36 @@ +title: table zt_userview +desc: "可访问权限" +author: automated export +version: "1.0" +fields: + - field: account + note: "用户名" + fields: + - field: account1 + range: test{100},dev{100},td{100},top{100} + - field: account2 + range: 1-100,1-100,1-100,1-100 + - field: programs + note: "项目集" + range: 1-10 + prefix: "," + postfix: "" + format: "" + - field: products + note: "产品" + range: 1-100 + prefix: "," + postfix: "" + format: "" + - field: projects + note: "项目" + range: 11-100 + prefix: "," + postfix: "" + format: "" + - field: sprints + note: "迭代" + range: 101-700 + prefix: "," + postfix: "" + format: "" diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index 182ba933f0..22bb18f4a6 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -7,6 +7,7 @@ $builder->todo = array('rows' => 2000, 'extends' => array('todo')); $builder->effort = array('rows' => 100, 'extends' => array('effort')); $builder->usergroup = array('rows' => 600, 'extends' => array('usergroup')); $builder->usercontact = array('rows' => 61, 'extends' => array('usercontact')); +$builder->userview = array('rows' => 400, 'extends' => array('userview')); $builder->dept = array('rows' => 100, 'extends' => array('dept')); $builder->action = array('rows' => 100, 'extends' => array('action')); diff --git a/test/data/zentao/processor.php b/test/data/zentao/processor.php index bf9a124e6e..1cd0d98ebb 100644 --- a/test/data/zentao/processor.php +++ b/test/data/zentao/processor.php @@ -91,6 +91,37 @@ class Processor foreach($users as $account => $user) $this->dao->update(TABLE_USER)->data($user)->where('account')->eq($account)->exec(); $this->dao->update(TABLE_USERCONTACT)->set('account')->eq('admin')->where('account')->like('admin%')->exec(); + + $productIDList = $this->dao->select('id')->from(TABLE_PRODUCT)->fetchAll(); + $projectIDList = $this->dao->select('id')->from(TABLE_PROJECT)->where('type')->eq('project')->fetchAll(); + $sprintIDList = $this->dao->select('id')->from(TABLE_EXECUTION)->where('type')->in('sprint,stage,kanban')->fetchAll(); + + $product = array(); + $project = array(); + $sprint = array(); + foreach($productIDList as $productID) $product[] = $productID->id; + foreach($projectIDList as $projectID) $project[] = $projectID->id; + foreach($sprintIDList as $sprintID) $sprint[] = $sprintID->id; + + $products = ",".join(",",$product); + $projects = ",".join(",",$project); + $sprints = ",".join(",",$sprint); + + $userViews = new stdclass(); + $userViews->account = 'admin'; + $userViews->programs = ',1,2,3,4,5,6,7,8,9,10'; + $userViews->products = $products; + $userViews->projects = $projects; + $userViews->sprints = $sprints; + $this->dao->insert(TABLE_USERVIEW)->data($userViews)->exec(); + + $guestViews = new stdclass(); + $guestViews->account = 'guest'; + $guestViews->programs = ''; + $guestViews->products = ''; + $guestViews->projects = ''; + $guestViews->sprints = ''; + $this->dao->insert(TABLE_USERVIEW)->data($guestViews)->exec(); } /** diff --git a/test/model/bug/checkdelayedbug.php b/test/model/bug/checkdelayedbug.php new file mode 100755 index 0000000000..e00159c9aa --- /dev/null +++ b/test/model/bug/checkdelayedbug.php @@ -0,0 +1,68 @@ +#!/usr/bin/env php +checkDelayBug(); +cid=1 +pid=1 + +检查deadline在1天前 resolvedDate不存在 状态为未解决的bug是否延期 >> 1 +检查deadline在1天前 resolvedDate不存在 状态为已解决的bug是否延期 >> 1 +检查deadline在1天前 resolvedDate不存在 状态为已关闭的bug是否延期 >> 1 +检查deadline在3天前 resolvedDate在1天前 状态为未解决的bug是否延期 >> 2 +检查deadline在3天前 resolvedDate在1天前 状态为已解决的bug是否延期 >> 2 +检查deadline在3天前 resolvedDate在1天前 状态为已关闭的bug是否延期 >> 2 +检查deadline在3天前 resolvedDate在4天前 状态为未解决的bug是否延期 >> 0 +检查deadline在3天前 resolvedDate在4天前 状态为已解决的bug是否延期 >> 0 +检查deadline在3天前 resolvedDate在4天前 状态为已关闭的bug是否延期 >> 0 +检查deadline在3天后 resolvedDate在4天后 状态为未解决的bug是否延期 >> 1 +检查deadline在3天后 resolvedDate在4天后 状态为已解决的bug是否延期 >> 1 +检查deadline在3天后 resolvedDate在4天后 状态为已关闭的bug是否延期 >> 1 +检查deadline在3天后 resolvedDate在4天前 状态为未解决的bug是否延期 >> 0 +检查deadline在3天后 resolvedDate在4天前 状态为已解决的bug是否延期 >> 0 +检查deadline在3天后 resolvedDate在4天前 状态为已关闭的bug是否延期 >> 0 + +*/ + +$bug1 = new stdclass(); +$bug1->deadline = '-1'; +$bug1->resolvedDate = '0'; + +$bug2 = new stdclass(); +$bug2->deadline = '-3'; +$bug2->resolvedDate = '-1'; + +$bug3 = new stdclass(); +$bug3->deadline = '-3'; +$bug3->resolvedDate = '-4'; + +$bug4 = new stdclass(); +$bug4->deadline = '3'; +$bug4->resolvedDate = '4'; + +$bug5 = new stdclass(); +$bug5->deadline = '3'; +$bug5->resolvedDate = '-4'; + +$statusList = array('active', 'resolved', 'closed'); + +$bug = new bugTest(); +r($bug->checkDelayBugTest($bug1, $statusList[0])) && p('delay') && e('1'); // 检查deadline在1天前 resolvedDate不存在 状态为未解决的bug是否延期 +r($bug->checkDelayBugTest($bug1, $statusList[1])) && p('delay') && e('1'); // 检查deadline在1天前 resolvedDate不存在 状态为已解决的bug是否延期 +r($bug->checkDelayBugTest($bug1, $statusList[2])) && p('delay') && e('1'); // 检查deadline在1天前 resolvedDate不存在 状态为已关闭的bug是否延期 +r($bug->checkDelayBugTest($bug2, $statusList[0])) && p('delay') && e('2'); // 检查deadline在3天前 resolvedDate在1天前 状态为未解决的bug是否延期 +r($bug->checkDelayBugTest($bug2, $statusList[1])) && p('delay') && e('2'); // 检查deadline在3天前 resolvedDate在1天前 状态为已解决的bug是否延期 +r($bug->checkDelayBugTest($bug2, $statusList[2])) && p('delay') && e('2'); // 检查deadline在3天前 resolvedDate在1天前 状态为已关闭的bug是否延期 +r($bug->checkDelayBugTest($bug3, $statusList[0])) && p('delay') && e('0'); // 检查deadline在3天前 resolvedDate在4天前 状态为未解决的bug是否延期 +r($bug->checkDelayBugTest($bug3, $statusList[1])) && p('delay') && e('0'); // 检查deadline在3天前 resolvedDate在4天前 状态为已解决的bug是否延期 +r($bug->checkDelayBugTest($bug3, $statusList[2])) && p('delay') && e('0'); // 检查deadline在3天前 resolvedDate在4天前 状态为已关闭的bug是否延期 +r($bug->checkDelayBugTest($bug4, $statusList[0])) && p('delay') && e('1'); // 检查deadline在3天后 resolvedDate在4天后 状态为未解决的bug是否延期 +r($bug->checkDelayBugTest($bug4, $statusList[1])) && p('delay') && e('1'); // 检查deadline在3天后 resolvedDate在4天后 状态为已解决的bug是否延期 +r($bug->checkDelayBugTest($bug4, $statusList[2])) && p('delay') && e('1'); // 检查deadline在3天后 resolvedDate在4天后 状态为已关闭的bug是否延期 +r($bug->checkDelayBugTest($bug5, $statusList[0])) && p('delay') && e('0'); // 检查deadline在3天后 resolvedDate在4天前 状态为未解决的bug是否延期 +r($bug->checkDelayBugTest($bug5, $statusList[1])) && p('delay') && e('0'); // 检查deadline在3天后 resolvedDate在4天前 状态为已解决的bug是否延期 +r($bug->checkDelayBugTest($bug5, $statusList[2])) && p('delay') && e('0'); // 检查deadline在3天后 resolvedDate在4天前 状态为已关闭的bug是否延期 diff --git a/test/model/bug/checkdelayedbugs.php b/test/model/bug/checkdelayedbugs.php new file mode 100755 index 0000000000..56972e14a5 --- /dev/null +++ b/test/model/bug/checkdelayedbugs.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +checkDelayedBugs(); +cid=1 +pid=1 + +检查deadline在resolvedDate前 状态为未解决的bug是否延期 >> 35,33,31 +检查deadline在resolvedDate后 状态为未解决的bug是否延期 >> 0,0,0 +检查deadline在resolvedDate前 状态为已解决的bug是否延期 >> 10,8,6 +检查deadline在resolvedDate后 状态为已解决的bug是否延期 >> 0,0,0 +检查deadline在resolvedDate前 状态为已关闭的bug是否延期 >> 6,4,2 +检查deadline在resolvedDate后 状态为已关闭的bug是否延期 >> 0,0,0 + + + +*/ + +$productIDList = array('1', '7','18', '20', '28', '33'); + +$bug = new bugTest(); +r($bug->checkDelayedBugsTest($productIDList[0])) && p('delay') && e('35,33,31'); // 检查deadline在resolvedDate前 状态为未解决的bug是否延期 +r($bug->checkDelayedBugsTest($productIDList[1])) && p('delay') && e('0,0,0'); // 检查deadline在resolvedDate后 状态为未解决的bug是否延期 +r($bug->checkDelayedBugsTest($productIDList[2])) && p('delay') && e('10,8,6'); // 检查deadline在resolvedDate前 状态为已解决的bug是否延期 +r($bug->checkDelayedBugsTest($productIDList[3])) && p('delay') && e('0,0,0'); // 检查deadline在resolvedDate后 状态为已解决的bug是否延期 +r($bug->checkDelayedBugsTest($productIDList[4])) && p('delay') && e('6,4,2'); // 检查deadline在resolvedDate前 状态为已关闭的bug是否延期 +r($bug->checkDelayedBugsTest($productIDList[5])) && p('delay') && e('0,0,0'); // 检查deadline在resolvedDate后 状态为已关闭的bug是否延期 diff --git a/test/model/bug/createbugfromgitlabissue.php b/test/model/bug/createbugfromgitlabissue.php index a908ac8797..4643b3ea58 100755 --- a/test/model/bug/createbugfromgitlabissue.php +++ b/test/model/bug/createbugfromgitlabissue.php @@ -10,12 +10,12 @@ title=bugModel->createBugFromGitlabIssue (); cid=1 pid=1 -测试正常的创建来源于gitlab issue的bug title >> 问题1 -测试短时间内重复创建来源于gitlab issue的bug >> 0 -测试正常的创建来源于gitlab issue的bug execution >> 101 -测试正常的创建来源于gitlab issue的bug pri >> 3 -测试正常的创建来源于gitlab issue的bug severity >> 3 -测试创建没有标题 来源于gitlab issue的异常bug >> 『Bug标题』不能为空。 +测试正常的创建来源于gitlab issue的bug的title >> 问题1 +测试正常的创建来源于gitlab issue的bug的execution >> 101 +测试正常的创建来源于gitlab issue的bug的pri >> 3 +测试正常的创建来源于gitlab issue的bug的severity >> 3 +测试创建没有标题 来源于gitlab issue的异常bug >> 『Bug标题』不能为空。 +测试短时间内重复创建来源于gitlab issue的bug >> 0 */ @@ -43,11 +43,11 @@ $bug5->title = ''; $bug5->execution = $executionID; $bug=new bugTest(); -r($bug->createBugFromGitlabIssueTest($bug1, $executionID)) && p('title') && e('问题1'); // 测试正常的创建来源于gitlab issue的bug title -r($bug->createBugFromGitlabIssueTest($bug1, $executionID)) && p('task') && e('0'); // 测试短时间内重复创建来源于gitlab issue的bug -r($bug->createBugFromGitlabIssueTest($bug2, $executionID)) && p('execution') && e($executionID); // 测试正常的创建来源于gitlab issue的bug execution -r($bug->createBugFromGitlabIssueTest($bug3, $executionID)) && p('pri') && e('3'); // 测试正常的创建来源于gitlab issue的bug pri -r($bug->createBugFromGitlabIssueTest($bug4, $executionID)) && p('severity') && e('3'); // 测试正常的创建来源于gitlab issue的bug severity +r($bug->createBugFromGitlabIssueTest($bug1, $executionID)) && p('title') && e('问题1'); // 测试正常的创建来源于gitlab issue的bug的title +r($bug->createBugFromGitlabIssueTest($bug2, $executionID)) && p('execution') && e("$executionID"); // 测试正常的创建来源于gitlab issue的bug的execution +r($bug->createBugFromGitlabIssueTest($bug3, $executionID)) && p('pri') && e('3'); // 测试正常的创建来源于gitlab issue的bug的pri +r($bug->createBugFromGitlabIssueTest($bug4, $executionID)) && p('severity') && e('3'); // 测试正常的创建来源于gitlab issue的bug的severity r($bug->createBugFromGitlabIssueTest($bug5, $executionID)) && p('title:0') && e('『Bug标题』不能为空。'); // 测试创建没有标题 来源于gitlab issue的异常bug +r($bug->createBugFromGitlabIssueTest($bug1, $executionID)) && p('task') && e('0'); // 测试短时间内重复创建来源于gitlab issue的bug system("./ztest init"); diff --git a/test/model/bug/getallbugs.php b/test/model/bug/getallbugs.php new file mode 100755 index 0000000000..075176cbae --- /dev/null +++ b/test/model/bug/getallbugs.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php +getAllBugs(); +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->getAllBugsTest($productIDList[0], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug +r($bug->getAllBugsTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下的bug +r($bug->getAllBugsTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下的bug +r($bug->getAllBugsTest($productIDList[1], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1'); // 查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下的bug +r($bug->getAllBugsTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下的bug +r($bug->getAllBugsTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下的bug +r($bug->getAllBugsTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug +r($bug->getAllBugsTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下的bug +r($bug->getAllBugsTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下的bug diff --git a/test/model/bug/getbugs.php b/test/model/bug/getbugs.php index 4067cf0aa3..555f068e81 100755 --- a/test/model/bug/getbugs.php +++ b/test/model/bug/getbugs.php @@ -13,12 +13,12 @@ pid=1 查询正常产品 没有分支 查看全部 没有模块的全部bug的标题拼接1 >> BUG3,BUG2,BUG1 查询正常产品 不存在的分支主干 查看全部 没有模块的全部bug的标题拼接 >> BUG3,BUG2,BUG1 查询正常产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接 >> BUG3,BUG2,BUG1 -查询正常产品 没有分支 查看全部 模块1821的全部bug的标题拼接 >> 0 +查询正常产品 没有分支 查看全部 模块1821的全部bug的标题拼接 >> BUG1 查询正常产品 没有分支 查看全部 模块不存在的全部bug的标题拼接 >> BUG3,BUG2,BUG1 -查询多分支产品 没有分支 查看全部 没有模块的全部bug的标题拼接59 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*'":.<>。?/();175 -查询多分支产品 主干 查看全部 没有模块的全部bug的标题拼接 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*'":.<>。?/();175 +查询多分支产品 没有分支 查看全部 没有模块的全部bug的标题拼接59 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175 +查询多分支产品 主干 查看全部 没有模块的全部bug的标题拼接 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175 查询多分支产品 分支37 查看全部 没有模块的全部bug的标题拼接 >> 0 -查询多分支产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*'":.<>。?/();175 +查询多分支产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175 查询多分支产品 没有分支 查看全部 模块2053的全部bug的标题拼接 >> 0 查询不存在的产品的全部bug的标题拼接 >> 0 @@ -34,13 +34,11 @@ $bug=new bugTest(); r($bug->getBugsTest($productIDList[0], $branchList[0], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG3,BUG2,BUG1'); // 查询正常产品 没有分支 查看全部 没有模块的全部bug的标题拼接1 r($bug->getBugsTest($productIDList[0], $branchList[1], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG3,BUG2,BUG1'); // 查询正常产品 不存在的分支主干 查看全部 没有模块的全部bug的标题拼接 r($bug->getBugsTest($productIDList[0], $branchList[0], $browseTypeList[1], $moduleIDList[0])) && p('title') && e('BUG3,BUG2,BUG1'); // 查询正常产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接 -r($bug->getBugsTest($productIDList[0], $branchList[0], $browseTypeList[0], $moduleIDList[1])) && p('title') && e('0'); // 查询正常产品 没有分支 查看全部 模块1821的全部bug的标题拼接 +r($bug->getBugsTest($productIDList[0], $branchList[0], $browseTypeList[0], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询正常产品 没有分支 查看全部 模块1821的全部bug的标题拼接 r($bug->getBugsTest($productIDList[0], $branchList[0], $browseTypeList[0], $moduleIDList[3])) && p('title') && e('BUG3,BUG2,BUG1'); // 查询正常产品 没有分支 查看全部 模块不存在的全部bug的标题拼接 -r($bug->getBugsTest($productIDList[1], $branchList[0], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*\'":.<>。?/();175'); // 查询多分支产品 没有分支 查看全部 没有模块的全部bug的标题拼接59 -r($bug->getBugsTest($productIDList[1], $branchList[1], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*\'":.<>。?/();175'); // 查询多分支产品 主干 查看全部 没有模块的全部bug的标题拼接 +r($bug->getBugsTest($productIDList[1], $branchList[0], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175'); // 查询多分支产品 没有分支 查看全部 没有模块的全部bug的标题拼接59 +r($bug->getBugsTest($productIDList[1], $branchList[1], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175'); // 查询多分支产品 主干 查看全部 没有模块的全部bug的标题拼接 r($bug->getBugsTest($productIDList[1], $branchList[2], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('0'); // 查询多分支产品 分支37 查看全部 没有模块的全部bug的标题拼接 -r($bug->getBugsTest($productIDList[1], $branchList[0], $browseTypeList[1], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*\'":.<>。?/();175'); // 查询多分支产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接 +r($bug->getBugsTest($productIDList[1], $branchList[0], $browseTypeList[1], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175'); // 查询多分支产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接 r($bug->getBugsTest($productIDList[1], $branchList[0], $browseTypeList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询多分支产品 没有分支 查看全部 模块2053的全部bug的标题拼接 r($bug->getBugsTest($productIDList[2], $branchList[0], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品的全部bug的标题拼接 - -system("./ztest init"); diff --git a/test/model/bug/getbyassigntome.php b/test/model/bug/getbyassigntome.php new file mode 100755 index 0000000000..b726006ef7 --- /dev/null +++ b/test/model/bug/getbyassigntome.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php +getByAssigntome(); +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->getByAssigntomeTest($productIDList[0], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下指派给我的bug +r($bug->getByAssigntomeTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下指派给我的bug +r($bug->getByAssigntomeTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下指派给我的bug +r($bug->getByAssigntomeTest($productIDList[1], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1'); // 查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下指派给我的bug +r($bug->getByAssigntomeTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下指派给我的bug +r($bug->getByAssigntomeTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下指派给我的bug +r($bug->getByAssigntomeTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下指派给我的bug +r($bug->getByAssigntomeTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下指派给我的bug +r($bug->getByAssigntomeTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下指派给我的bug diff --git a/test/model/bug/getbyassigntonull.php b/test/model/bug/getbyassigntonull.php new file mode 100755 index 0000000000..53b5bee530 --- /dev/null +++ b/test/model/bug/getbyassigntonull.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +getByAssigntonull(); +cid=1 +pid=1 + +查询产品1 581 58 不存在的产品10001下由我创建的bug >> BUG174,BUG173,BUG172,BUG93,BUG92,BUG91 +查询产品1 58下由我创建的bug >> BUG174,BUG173,BUG172 +查询不存在的产品10001下由我创建的bug >> 0 + +*/ + +$productIDList = array('1,31,58,1000001', '1,58', '1000001'); + +$bug=new bugTest(); + +r($bug->getByAssigntonullTest($productIDList[0])) && p('title') && e('BUG174,BUG173,BUG172,BUG93,BUG92,BUG91'); // 查询产品1 581 58 不存在的产品10001下由我创建的bug +r($bug->getByAssigntonullTest($productIDList[1])) && p('title') && e('BUG174,BUG173,BUG172'); // 查询产品1 58下由我创建的bug +r($bug->getByAssigntonullTest($productIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001下由我创建的bug diff --git a/test/model/bug/getbylonglifebugs.php b/test/model/bug/getbylonglifebugs.php new file mode 100755 index 0000000000..669f9be4e6 --- /dev/null +++ b/test/model/bug/getbylonglifebugs.php @@ -0,0 +1,44 @@ +#!/usr/bin/env php +getByLonglifebugs(); +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->getByLonglifebugsTest($productIDList[0], $moduleIDList[0])) && p('title') && e('bug8,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[0], $moduleIDList[3])) && p('title') && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG2,BUG1'); // 查询产品1 2 3 不存在的产品10001下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[1], $moduleIDList[0])) && p('title') && e('bug8,BUG1'); // 查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[1], $moduleIDList[3])) && p('title') && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG2,BUG1'); // 查询产品13 不存在的产品10001下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下长时间未关闭的bug +r($bug->getByLonglifebugsTest($productIDList[2], $moduleIDList[3])) && p('title') && e('0'); // 查询不存在的产品10001下长时间未关闭的bug diff --git a/test/model/bug/getbyopenedbyme.php b/test/model/bug/getbyopenedbyme.php new file mode 100755 index 0000000000..cb03a78624 --- /dev/null +++ b/test/model/bug/getbyopenedbyme.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php +getByOpenedbyme(); +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->getByOpenedbymeTest($productIDList[0], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下由我创建的bug +r($bug->getByOpenedbymeTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下由我创建的bug +r($bug->getByOpenedbymeTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下由我创建的bug +r($bug->getByOpenedbymeTest($productIDList[1], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1'); // 查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下由我创建的bug +r($bug->getByOpenedbymeTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下由我创建的bug +r($bug->getByOpenedbymeTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下由我创建的bug +r($bug->getByOpenedbymeTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下由我创建的bug +r($bug->getByOpenedbymeTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下由我创建的bug +r($bug->getByOpenedbymeTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下由我创建的bug diff --git a/test/model/bug/getbypostponedbugs.php b/test/model/bug/getbypostponedbugs.php new file mode 100755 index 0000000000..60bcb2a2ea --- /dev/null +++ b/test/model/bug/getbypostponedbugs.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +getByPostponedbugs(); +cid=1 +pid=1 + +查询产品25 32 48 100001下被延期的bug >> BUG94,BUG75,BUG74,BUG73 +查询产品25下被延期的bug >> BUG75,BUG74,BUG73 +查询产品32下被延期的bug >> BUG94 +查询产品1下被延期的bug >> 0 +查询不存在的产品10001下被延期的bug >> 0 + +*/ + +$productIDList = array('25,32,48,1000001', '25' , '32', '1', '1000001'); + +$bug=new bugTest(); + +r($bug->getByPostponedBugsTest($productIDList[0])) && p('title') && e('BUG94,BUG75,BUG74,BUG73'); // 查询产品25 32 48 100001下被延期的bug +r($bug->getByPostponedBugsTest($productIDList[1])) && p('title') && e('BUG75,BUG74,BUG73'); // 查询产品25下被延期的bug +r($bug->getByPostponedBugsTest($productIDList[2])) && p('title') && e('BUG94'); // 查询产品32下被延期的bug +r($bug->getByPostponedBugsTest($productIDList[3])) && p('title') && e('0'); // 查询产品1下被延期的bug +r($bug->getByPostponedBugsTest($productIDList[4])) && p('title') && e('0'); // 查询不存在的产品10001下被延期的bug diff --git a/test/model/bug/getbyresolvedbyme.php b/test/model/bug/getbyresolvedbyme.php new file mode 100755 index 0000000000..222c1c237d --- /dev/null +++ b/test/model/bug/getbyresolvedbyme.php @@ -0,0 +1,27 @@ +#!/usr/bin/env php +getByResolvedbyme(); +cid=1 +pid=1 + +查询产品1 29 98 不存在的产品10001 下由我解决的bug >> BUG294,BUG293,BUG292,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();87,BUG86,BUG85 +查询产品1 98下由我解决的bug >> BUG294,BUG293,BUG292 +查询产品29下由我解决的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();87,BUG86,BUG85 +查询不存在的产品10001 下由我解决的bug >> 0 + +*/ + +$productIDList = array('1,29,98,1000001', '1,98', '29', '1000001'); + +$bug=new bugTest(); + +r($bug->getByResolvedbymeTest($productIDList[0])) && p('title') && e('BUG294,BUG293,BUG292,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();87,BUG86,BUG85'); // 查询产品1 29 98 不存在的产品10001 下由我解决的bug +r($bug->getByResolvedbymeTest($productIDList[1])) && p('title') && e('BUG294,BUG293,BUG292'); // 查询产品1 98下由我解决的bug +r($bug->getByResolvedbymeTest($productIDList[2])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();87,BUG86,BUG85'); // 查询产品29下由我解决的bug +r($bug->getByResolvedbymeTest($productIDList[3])) && p('title') && e('0'); // 查询不存在的产品10001 下由我解决的bug diff --git a/test/model/bug/getbystatus.php b/test/model/bug/getbystatus.php new file mode 100755 index 0000000000..0073e2aa57 --- /dev/null +++ b/test/model/bug/getbystatus.php @@ -0,0 +1,75 @@ +#!/usr/bin/env php +getByStatus(); +cid=1 +pid=1 + +查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug >> bug8,BUG1 +查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug >> bug8,BUG1 +查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug >> 0 +查询产品1 3 不存在的产品10001 与模块1821状态为unclosed下未确认的bug >> BUG1 +查询产品1 3 不存在的产品10001 与模块1821状态为unresolved下未确认的bug >> BUG1 +查询产品1 3 不存在的产品10001 与模块1821状态为toclosed下未确认的bug >> 0 +查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为unclosed下未确认的bug >> 0 +查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为unresolved下未确认的bug >> 0 +查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为toclosed下未确认的bug >> 0 +查询产品1 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug >> BUG1 +查询产品1 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug >> BUG1 +查询产品1 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug >> 0 +查询产品1 与模块1821状态为unclosed下未确认的bug >> BUG1 +查询产品1 与模块1821状态为unresolved下未确认的bug >> BUG1 +查询产品1 与模块1821状态为toclosed下未确认的bug >> 0 +查询产品1 与不存在的模块1000001 状态为unclosed下未确认的bug >> 0 +查询产品1 与不存在的模块1000001 状态为unresolved下未确认的bug >> 0 +查询产品1 与不存在的模块1000001 状态为toclosed下未确认的bug >> 0 +查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug >> 0 +查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug >> 0 +查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug >> 0 +查询不存在的产品10001 与模块1821状态为unclosed下未确认的bug >> 0 +查询不存在的产品10001 与模块1821状态为unresolved下未确认的bug >> 0 +查询不存在的产品10001 与模块1821状态为toclosed下未确认的bug >> 0 +查询不存在的产品10001 与不存在的模块1000001 状态为unclosed下未确认的bug >> 0 +查询不存在的产品10001 与不存在的模块1000001 状态为unresolved下未确认的bug >> 0 +查询不存在的产品10001 与不存在的模块1000001 状态为toclosed下未确认的bug >> 0 + +*/ + +$productIDList = array('1,3,1000001', '1', '1000001'); +$moduleIDList = array('1821,1832,1000001', '1821', '1000001', '0'); +$statusList = array('unclosed', 'unresolved', 'toclosed'); + +$bug=new bugTest(); + +r($bug->getByStatusTest($productIDList[0], $moduleIDList[0], $statusList[0])) && p('title') && e('bug8,BUG1'); // 查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug +r($bug->getByStatusTest($productIDList[0], $moduleIDList[0], $statusList[1])) && p('title') && e('bug8,BUG1'); // 查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug +r($bug->getByStatusTest($productIDList[0], $moduleIDList[0], $statusList[2])) && p('title') && e('0'); // 查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug +r($bug->getByStatusTest($productIDList[0], $moduleIDList[1], $statusList[0])) && p('title') && e('BUG1'); // 查询产品1 3 不存在的产品10001 与模块1821状态为unclosed下未确认的bug +r($bug->getByStatusTest($productIDList[0], $moduleIDList[1], $statusList[1])) && p('title') && e('BUG1'); // 查询产品1 3 不存在的产品10001 与模块1821状态为unresolved下未确认的bug +r($bug->getByStatusTest($productIDList[0], $moduleIDList[1], $statusList[2])) && p('title') && e('0'); // 查询产品1 3 不存在的产品10001 与模块1821状态为toclosed下未确认的bug +r($bug->getByStatusTest($productIDList[0], $moduleIDList[2], $statusList[0])) && p('title') && e('0'); // 查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为unclosed下未确认的bug +r($bug->getByStatusTest($productIDList[0], $moduleIDList[2], $statusList[1])) && p('title') && e('0'); // 查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为unresolved下未确认的bug +r($bug->getByStatusTest($productIDList[0], $moduleIDList[2], $statusList[2])) && p('title') && e('0'); // 查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为toclosed下未确认的bug +r($bug->getByStatusTest($productIDList[1], $moduleIDList[0], $statusList[0])) && p('title') && e('BUG1'); // 查询产品1 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug +r($bug->getByStatusTest($productIDList[1], $moduleIDList[0], $statusList[1])) && p('title') && e('BUG1'); // 查询产品1 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug +r($bug->getByStatusTest($productIDList[1], $moduleIDList[0], $statusList[2])) && p('title') && e('0'); // 查询产品1 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug +r($bug->getByStatusTest($productIDList[1], $moduleIDList[1], $statusList[0])) && p('title') && e('BUG1'); // 查询产品1 与模块1821状态为unclosed下未确认的bug +r($bug->getByStatusTest($productIDList[1], $moduleIDList[1], $statusList[1])) && p('title') && e('BUG1'); // 查询产品1 与模块1821状态为unresolved下未确认的bug +r($bug->getByStatusTest($productIDList[1], $moduleIDList[1], $statusList[2])) && p('title') && e('0'); // 查询产品1 与模块1821状态为toclosed下未确认的bug +r($bug->getByStatusTest($productIDList[1], $moduleIDList[2], $statusList[0])) && p('title') && e('0'); // 查询产品1 与不存在的模块1000001 状态为unclosed下未确认的bug +r($bug->getByStatusTest($productIDList[1], $moduleIDList[2], $statusList[1])) && p('title') && e('0'); // 查询产品1 与不存在的模块1000001 状态为unresolved下未确认的bug +r($bug->getByStatusTest($productIDList[1], $moduleIDList[2], $statusList[2])) && p('title') && e('0'); // 查询产品1 与不存在的模块1000001 状态为toclosed下未确认的bug +r($bug->getByStatusTest($productIDList[2], $moduleIDList[0], $statusList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug +r($bug->getByStatusTest($productIDList[2], $moduleIDList[0], $statusList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug +r($bug->getByStatusTest($productIDList[2], $moduleIDList[0], $statusList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug +r($bug->getByStatusTest($productIDList[2], $moduleIDList[1], $statusList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821状态为unclosed下未确认的bug +r($bug->getByStatusTest($productIDList[2], $moduleIDList[1], $statusList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821状态为unresolved下未确认的bug +r($bug->getByStatusTest($productIDList[2], $moduleIDList[1], $statusList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821状态为toclosed下未确认的bug +r($bug->getByStatusTest($productIDList[2], $moduleIDList[2], $statusList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001 状态为unclosed下未确认的bug +r($bug->getByStatusTest($productIDList[2], $moduleIDList[2], $statusList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001 状态为unresolved下未确认的bug +r($bug->getByStatusTest($productIDList[2], $moduleIDList[2], $statusList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001 状态为toclosed下未确认的bug diff --git a/test/model/bug/getmodulebugs.php b/test/model/bug/getmodulebugs.php new file mode 100755 index 0000000000..7d4b537d4d --- /dev/null +++ b/test/model/bug/getmodulebugs.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php +getModuleBugs(); +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->getModuleBugsTest($productIDList[0], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug +r($bug->getModuleBugsTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下的bug +r($bug->getModuleBugsTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下的bug +r($bug->getModuleBugsTest($productIDList[1], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1'); // 查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下的bug +r($bug->getModuleBugsTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下的bug +r($bug->getModuleBugsTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下的bug +r($bug->getModuleBugsTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug +r($bug->getModuleBugsTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下的bug +r($bug->getModuleBugsTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下的bug diff --git a/test/model/bug/getoverduebugs.php b/test/model/bug/getoverduebugs.php new file mode 100755 index 0000000000..e8aaf13ba4 --- /dev/null +++ b/test/model/bug/getoverduebugs.php @@ -0,0 +1,44 @@ +#!/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 diff --git a/test/model/bug/getunconfirmed.php b/test/model/bug/getunconfirmed.php new file mode 100755 index 0000000000..ce0d9fae1f --- /dev/null +++ b/test/model/bug/getunconfirmed.php @@ -0,0 +1,44 @@ +#!/usr/bin/env php +getUnconfirmed(); +cid=1 +pid=1 + +查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug >> BUG1 +查询产品1 2 3 不存在的产品10001 与模块1821, 1825下未确认的bug >> BUG1 +查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下未确认的bug >> 0 +查询产品1 2 3 不存在的产品10001下未确认的bug >> BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG5,BUG3,BUG1 +查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug >> BUG1 +查询产品1 3与模块1821, 1825下未确认的bug >> BUG1 +查询产品1 3与模块不存在的模块1000001下未确认的bug >> 0 +查询产品13 不存在的产品10001下未确认的bug >> BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,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->getUnconfirmedTest($productIDList[0], $moduleIDList[0])) && p('title') && e('BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug +r($bug->getUnconfirmedTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下未确认的bug +r($bug->getUnconfirmedTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下未确认的bug +r($bug->getUnconfirmedTest($productIDList[0], $moduleIDList[3])) && p('title') && e('BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG5,BUG3,BUG1'); // 查询产品1 2 3 不存在的产品10001下未确认的bug +r($bug->getUnconfirmedTest($productIDList[1], $moduleIDList[0])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug +r($bug->getUnconfirmedTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下未确认的bug +r($bug->getUnconfirmedTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下未确认的bug +r($bug->getUnconfirmedTest($productIDList[1], $moduleIDList[3])) && p('title') && e('BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG1'); // 查询产品13 不存在的产品10001下未确认的bug +r($bug->getUnconfirmedTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug +r($bug->getUnconfirmedTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下未确认的bug +r($bug->getUnconfirmedTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下未确认的bug +r($bug->getUnconfirmedTest($productIDList[2], $moduleIDList[3])) && p('title') && e('0'); // 查询不存在的产品10001下未确认的bug diff --git a/test/model/execution/getburndataflot.php b/test/model/execution/getburndataflot.php index 0a6f22deed..61b02ca1b6 100755 --- a/test/model/execution/getburndataflot.php +++ b/test/model/execution/getburndataflot.php @@ -10,9 +10,9 @@ title=测试executionModel->getBurnDataFlotTest(); cid=1 pid=1 -敏捷执行查询统计 >> 2 -瀑布执行查询统计 >> 2 -看板执行查询统计 >> 1 +敏捷执行查询统计 >> 3 +瀑布执行查询统计 >> 3 +看板执行查询统计 >> 3 */ @@ -20,6 +20,6 @@ $executionIDList = array('101', '131', '161'); $count = array('0','1'); $execution = new executionTest(); -r($execution->getBurnDataFlotTest($executionIDList[0], $count[1])) && p() && e('2'); // 敏捷执行查询统计 -r($execution->getBurnDataFlotTest($executionIDList[1], $count[1])) && p() && e('2'); // 瀑布执行查询统计 -r($execution->getBurnDataFlotTest($executionIDList[2], $count[1])) && p() && e('1'); // 看板执行查询统计 +r($execution->getBurnDataFlotTest($executionIDList[0], $count[1])) && p() && e('3'); // 敏捷执行查询统计 +r($execution->getBurnDataFlotTest($executionIDList[1], $count[1])) && p() && e('3'); // 瀑布执行查询统计 +r($execution->getBurnDataFlotTest($executionIDList[2], $count[1])) && p() && e('3'); // 看板执行查询统计 \ No newline at end of file diff --git a/test/model/execution/getkanbangroupdata.php b/test/model/execution/getkanbangroupdata.php deleted file mode 100755 index 4d4a731e06..0000000000 --- a/test/model/execution/getkanbangroupdata.php +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env php -getKanbanGroupDataTest(); -cid=1 -pid=1 - -敏捷执行查询 >> 子任务6,101 -瀑布执行查询 >> 更多任务93,131 -看板执行查询 >> 开发任务71,161 -敏捷执行查询统计 >> 11 -瀑布执行查询统计 >> 4 -看板执行查询统计 >> 4 - -*/ - -$executionIDList = array('101', '131', '161'); -$count = array('0', '1'); - -$execution = new executionTest(); -var_dump($execution->getKanbanGroupDataTest($executionIDList[0], $count[0]));die; -r($execution->getKanbanGroupDataTest($executionIDList[0], $count[0])) && p('906:name,execution') && e('子任务6,101'); // 敏捷执行查询 -r($execution->getKanbanGroupDataTest($executionIDList[1], $count[0])) && p('693:name,execution') && e('更多任务93,131'); // 瀑布执行查询 -r($execution->getKanbanGroupDataTest($executionIDList[2], $count[0])) && p('61:name,execution') && e('开发任务71,161'); // 看板执行查询 -r($execution->getKanbanGroupDataTest($executionIDList[0], $count[1])) && p() && e('11'); // 敏捷执行查询统计 -r($execution->getKanbanGroupDataTest($executionIDList[1], $count[1])) && p() && e('4'); // 瀑布执行查询统计 -r($execution->getKanbanGroupDataTest($executionIDList[2], $count[1])) && p() && e('4'); // 看板执行查询统计 \ No newline at end of file diff --git a/test/model/execution/getplans.php b/test/model/execution/getplans.php index 342f09fb40..1617f1397c 100755 --- a/test/model/execution/getplans.php +++ b/test/model/execution/getplans.php @@ -11,7 +11,7 @@ cid=1 pid=1 全部执行计划查询 >> 长名称 -执行计划查询 >> 1.1 [2021-05-23 ~ 2021-09-23] +执行计划查询 >> 1.1 全部执行计划查询 >> 2 */ @@ -21,6 +21,6 @@ $executionIDList = array('0','101'); $count = array('0','1'); $execution = new executionTest(); -r($execution->getPlansTest($productIDList, $executionIDList[0], $count[0])) && p('1:3') && e('长名称'); // 全部执行计划查询 -r($execution->getPlansTest($productIDList, $executionIDList[1], $count[0])) && p('1:2') && e('1.1 [2021-05-23 ~ 2021-09-23]'); // 执行计划查询 -r($execution->getPlansTest($productIDList, $executionIDList[0], $count[1])) && p() && e('2'); // 全部执行计划查询 \ No newline at end of file +r($execution->getPlansTest($productIDList, $executionIDList[0], $count[0])) && p('1:3') && e('长名称'); // 全部执行计划查询 +r($execution->getPlansTest($productIDList, $executionIDList[1], $count[0])) && p('1:2') && e('1.1'); // 执行计划查询 +r($execution->getPlansTest($productIDList, $executionIDList[0], $count[1])) && p() && e('2'); // 全部执行计划查询 \ No newline at end of file diff --git a/test/model/execution/gettasks.php b/test/model/execution/gettasks.php index 1a5241854b..b50a9f4f2e 100755 --- a/test/model/execution/gettasks.php +++ b/test/model/execution/gettasks.php @@ -34,7 +34,7 @@ doing任务查询统计 >> 1 undone任务查询统计 >> 3 done任务查询统计 >> 1 根据查询条件查询任务统计 >> 1 -根据模块查询任务统计 >> 2 +根据模块查询任务统计 >> 8 name_asc,id_asc排序查询统计 >> 4 id_asc排序查询统计 >> 4 pri_desc,id_desc排序查询统计 >> 4 @@ -74,7 +74,7 @@ r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[3], r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[4],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('3'); // undone任务查询统计 r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[5],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // done任务查询统计 r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[7],$queryID[1],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // 根据查询条件查询任务统计 -r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[1])) && p() && e('2'); // 根据模块查询任务统计 +r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[1])) && p() && e('8'); // 根据模块查询任务统计 r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[1],$count[1])) && p() && e('4'); // name_asc,id_asc排序查询统计 r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[2],$count[1])) && p() && e('4'); // id_asc排序查询统计 r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[3],$count[1])) && p() && e('4'); // pri_desc,id_desc排序查询统计 \ No newline at end of file diff --git a/test/model/execution/getteamskip.php b/test/model/execution/getteamskip.php index 94ffb3ce8e..68daeb456a 100755 --- a/test/model/execution/getteamskip.php +++ b/test/model/execution/getteamskip.php @@ -10,17 +10,17 @@ title=测试executionModel->getTeamSkipTest(); cid=1 pid=1 -正常跳过 >> 901,admin,研发 +正常跳过 >> 901,user92,研发 begin与end一致 >> 无跳转数据 end与begin一致 >> 无跳转数据 */ $taskID = 901; -$begin = 'admin'; -$end = 'user92'; +$begin = 'user92'; +$end = 'user93'; $execution = new executionTest(); -r($execution->getTeamSkipTest($taskID, $begin, $end)) && p('admin:root,account,role') && e('901,admin,研发'); // 正常跳过 -r($execution->getTeamSkipTest($taskID, $begin, $begin)) && p() && e('无跳转数据'); // begin与end一致 -r($execution->getTeamSkipTest($taskID, $end, $end)) && p() && e('无跳转数据'); // end与begin一致 \ No newline at end of file +r($execution->getTeamSkipTest($taskID, $begin, $end)) && p('user92:root,account,role') && e('901,user92,研发'); // 正常跳过 +r($execution->getTeamSkipTest($taskID, $begin, $begin)) && p() && e('无跳转数据'); // begin与end一致 +r($execution->getTeamSkipTest($taskID, $end, $end)) && p() && e('无跳转数据'); // end与begin一致 \ No newline at end of file diff --git a/test/model/execution/processburndata.php b/test/model/execution/processburndata.php index a19398ef6d..7d380b72c0 100755 --- a/test/model/execution/processburndata.php +++ b/test/model/execution/processburndata.php @@ -11,8 +11,8 @@ cid=1 pid=1 敏捷执行查询统计 >> 29 -瀑布执行查询统计 >> 60 -看板执行查询统计 >> 60 +瀑布执行查询统计 >> 59 +看板执行查询统计 >> 62 错误时间查询统计 >> 0 */ @@ -25,6 +25,6 @@ $count = array('0','1'); $execution = new executionTest(); r($execution->processBurnDataTest($executionIDList[0], $itemCounts[0], $begin[0], $end[0], $count[1])) && p() && e('29'); // 敏捷执行查询统计 -r($execution->processBurnDataTest($executionIDList[1], $itemCounts[1], $begin[0], $end[0], $count[1])) && p() && e('60'); // 瀑布执行查询统计 -r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[0], $end[0], $count[1])) && p() && e('60'); // 看板执行查询统计 +r($execution->processBurnDataTest($executionIDList[1], $itemCounts[1], $begin[0], $end[0], $count[1])) && p() && e('59'); // 瀑布执行查询统计 +r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[0], $end[0], $count[1])) && p() && e('62'); // 看板执行查询统计 r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[1], $end[1], $count[1])) && p() && e('0'); // 错误时间查询统计 \ No newline at end of file diff --git a/test/model/execution/statrelateddata.php b/test/model/execution/statrelateddata.php index 0a39dc3c63..11093910c6 100755 --- a/test/model/execution/statrelateddata.php +++ b/test/model/execution/statrelateddata.php @@ -10,7 +10,7 @@ title=测试executionModel->statRelatedDataTest(); cid=1 pid=1 -敏捷执行数据统计 >> 3 +敏捷执行数据统计 >> 2 瀑布执行数据统计 >> 4 看板执行数据统计 >> 3 @@ -19,6 +19,6 @@ pid=1 $executionIDList = array('101', '131', '161'); $execution = new executionTest(); -r($execution->statRelatedDataTest($executionIDList[0])) && p('storyCount') && e('3'); // 敏捷执行数据统计 +r($execution->statRelatedDataTest($executionIDList[0])) && p('storyCount') && e('2'); // 敏捷执行数据统计 r($execution->statRelatedDataTest($executionIDList[1])) && p('taskCount') && e('4'); // 瀑布执行数据统计 r($execution->statRelatedDataTest($executionIDList[2])) && p('bugCount') && e('3'); // 看板执行数据统计 \ No newline at end of file diff --git a/test/model/execution/update.php b/test/model/execution/update.php index e37e101a40..7ce1bae9ee 100755 --- a/test/model/execution/update.php +++ b/test/model/execution/update.php @@ -11,7 +11,7 @@ cid=1 pid=1 测试重复迭代code >> 『迭代代号』已经有『project1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 -测试修改迭代名称 >> name,迭代1,任务名修改 +测试修改迭代名称 >> name,迭代1,迭代名修改 测试修改迭代项目为瀑布项目 >> project,11,41 测试修改迭代项目为看板项目 >> project,41,71 测试修改迭代code >> code,project31,code修改 @@ -44,7 +44,7 @@ $repeatcode = array('name' => '迭代名修改1'); $execution = new executionTest(); r($execution->updateObject($executionIDList[0], $repeatcode)) && p('code:0') && e('『迭代代号』已经有『project1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试重复迭代code -r($execution->updateObject($executionIDList[0], $changeName)) && p('0:field,old,new') && e('name,迭代1,任务名修改'); // 测试修改迭代名称 +r($execution->updateObject($executionIDList[0], $changeName)) && p('0:field,old,new') && e('name,迭代1,迭代名修改'); // 测试修改迭代名称 r($execution->updateObject($executionIDList[0], $changeStage)) && p('0:field,old,new') && e('project,11,41'); // 测试修改迭代项目为瀑布项目 r($execution->updateObject($executionIDList[0], $changeKanban)) && p('0:field,old,new') && e('project,41,71'); // 测试修改迭代项目为看板项目 r($execution->updateObject($executionIDList[1], $changeCode)) && p('0:field,old,new') && e('code,project31,code修改'); // 测试修改迭代code diff --git a/test/model/product/move.sh b/test/model/product/move.sh deleted file mode 100644 index 83d843101e..0000000000 --- a/test/model/product/move.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -#This script is use to rename files -for file in * ; -do mv $file `echo $file | tr 'A-Z' 'a-z'`; -done diff --git a/test/model/product_bak/create.php b/test/model/product_bak/create.php deleted file mode 100755 index 87abb462a7..0000000000 --- a/test/model/product_bak/create.php +++ /dev/null @@ -1,66 +0,0 @@ -#!/usr/bin/env php -create(); -cid=1 -pid=1 - -测试正常的创建 >> case1 -测试不填产品代号的情况 >> 『code』不能为空。 -测试创建重复的产品 >> 『code』已经有『testcase1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 -测试不填产品名称的情况 >> 『name』不能为空。 -测试传入name和code >> case3,testcase3 -测试传入program、name、code >> 3,case4,testcase4 -测试传入program、name、code、type、status >> 4,branch,closed - -*/ - -$config = new stdClass(); -$config->createFields->product = array('program' => '', 'name' => '', 'code' => '', 'PO' => '', 'QD' => '', 'RD' => '', 'type' => 'normal', 'status' => 'normal', 'desc' => '', 'acl' => 'private'); -/* -function createObject($module = '', $param = array()) -{ - global $config; - foreach($config->createFields->$module as $field => $defaultValue) $_POST[$field] = $defaultValue; - - foreach($param as $key => $value) $_POST[$key] = $value; - - global $tester; - $objectModel = $tester->loadModel($module); - $objectID = $objectModel->create(); - unset($_POST); - - if(dao::isError()) - { - return dao::getError(); - } - else - { - $object = $objectModel->getByID($objectID); - return $object; - } -}*/ -$createObject = new Product('admin'); - -$create1 = array('name' => 'case1', 'code' => 'testcase1'); -$create2 = array('name' => 'case2'); -$create3 = array('name' => 'case1', 'code' => 'testcase1'); -$create4 = array('code' => 'testcase1'); -$create5 = array('name' => 'case3', 'code' => 'testcase3'); -$create6 = array('program' => '3', 'name' => 'case4', 'code' => 'testcase4'); -$create7 = array('program' => '4', 'name' => 'case5', 'code' => 'testcase5', 'type' => 'branch', 'status' => 'closed'); - -r($createObject->createObject('product', $create1)) && p('name') && e('case1'); // 测试正常的创建 -r($createObject->createObject('product', $create2)) && p('code:0') && e('『code』不能为空。'); // 测试不填产品代号的情况 -r($createObject->createObject('product', $create3)) && p('code:0') && e('『code』已经有『testcase1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试创建重复的产品 -r($createObject->createObject('product', $create4)) && p('name:0') && e('『name』不能为空。'); // 测试不填产品名称的情况 -r($createObject->createObject('product', $create5)) && p('name,code') && e('case3,testcase3'); // 测试传入name和code -r($createObject->createObject('product', $create6)) && p('program,name,code') && e('3,case4,testcase4'); // 测试传入program、name、code -r($createObject->createObject('product', $create7)) && p('program,type,status') && e('4,branch,closed'); // 测试传入program、name、code、type、status -system("./ztest init"); \ No newline at end of file diff --git a/test/model/product_bak/getLatestProject.php b/test/model/product_bak/getLatestProject.php deleted file mode 100755 index 3b6f42f1dc..0000000000 --- a/test/model/product_bak/getLatestProject.php +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env php -getLatestProject(); -cid=1 -pid=1 - -测试产品25关联的最后一个未关闭的项目,按begin字段排序 >> 315 -测试产品38关联的最后一个未关闭的项目,按begin字段排序 >> 阶段588 -传入不存在的产品 >> 没有数据 - -*/ - -$project = new Product('admin'); - -#var_dump($z->testGetLatestProject(38));die; -r($project->testGetLatestProject(25)) && p('id') && e('315'); // 测试产品25关联的最后一个未关闭的项目,按begin字段排序 -r($project->testGetLatestProject(38)) && p('name') && e('阶段588'); // 测试产品38关联的最后一个未关闭的项目,按begin字段排序 -r($project->testGetLatestProject(101)) && p() && e('没有数据'); // 传入不存在的产品 \ No newline at end of file diff --git a/test/model/product_bak/getList.php b/test/model/product_bak/getList.php deleted file mode 100755 index 9843c25e3a..0000000000 --- a/test/model/product_bak/getList.php +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env php -getList(); -cid=1 -pid=1 - -返回项目集1下的产品数量 >> 9 -测试传入programID=0的情况 >> 100 -传入不存在的项目集 >> 0 -返回项目集1下的未关闭的产品数量 >> 5 -获取所有的未关闭的产品数量 >> 60 -返回项目集1下的关闭了的产品数量 >> 4 -返回所有的未关闭的产品数量 >> 40 -返回项目集1下的与当前用户有关系的产品数量 >> 0 -返回项目集1下产品线1的产品数量 >> 9 -返回项目集1下产品线2的产品数量 >> 0 - -*/ - -class Tester -{ - public function __construct($user) - { - global $tester; - su($user); - $this->product = $tester->loadModel('product'); - } - public function getAllProducts($programID) - { - return $this->product->getList($programID); - } - public function getAllProductsCount($programID) - { - return count($this->getAllProducts($programID)); - } - - public function getNoclosedProducts($programID) - { - return $this->product->getList($programID, 'noclosed'); - } - public function getNoclosedProductsCount($programID) - { - return count($this->getNoclosedProducts($programID)); - } - - public function getClosedProducts($programID) - { - return $this->product->getList($programID, 'closed'); - } - public function getClosedProductsCount($programID) - { - return count($this->getClosedProducts($programID)); - } - - public function getInvolvedProducts($programID) - { - return $this->product->getList($programID, 'involved'); - } - public function getInvolvedProductsCount($programID) - { - return count($this->getInvolvedProducts($programID)); - } - - public function getProductsByLine($programID, $line = 0) - { - return $this->product->getList($programID, 'all', 0, $line); - } - public function countProductsByLine($programID, $line = 0) - { - return count($this->getProductsByLine($programID, $line)); - } - - public function getProductList($programID, $status = 'all', $line = 0) - { - return $this->product->getList($programID, $status, 0, $line); - } - public function getProductCount($programID, $status = 'all', $line = 0) - { - return count($this->getProductList($programID, $status, $line)); - } -} - -$adminTester = new Tester('admin'); - -r($adminTester->getAllProductsCount(1)) && p() && e('9'); // 返回项目集1下的产品数量 -r($adminTester->getAllProductsCount(0)) && p() && e('100'); // 测试传入programID=0的情况 -r($adminTester->getAllProductsCount(11)) && p() && e('0'); // 传入不存在的项目集 - -r($adminTester->getNoclosedProductsCount(1)) && p() && e('5'); // 返回项目集1下的未关闭的产品数量 -r($adminTester->getNoclosedProductsCount(0)) && p() && e('60'); // 获取所有的未关闭的产品数量 - -r($adminTester->getClosedProductsCount(1)) && p() && e('4'); // 返回项目集1下的关闭了的产品数量 -r($adminTester->getClosedProductsCount(0)) && p() && e('40'); // 返回所有的未关闭的产品数量 - -r($adminTester->getInvolvedProductsCount(1)) && p() && e('0'); // 返回项目集1下的与当前用户有关系的产品数量 - -r($adminTester->countProductsByLine(1, 1)) && p() && e('9'); // 返回项目集1下产品线1的产品数量 -r($adminTester->countProductsByLine(1, 2)) && p() && e('0'); // 返回项目集1下产品线2的产品数量 \ No newline at end of file diff --git a/test/model/product_bak/getPairs.php b/test/model/product_bak/getPairs.php deleted file mode 100755 index 88967403cf..0000000000 --- a/test/model/product_bak/getPairs.php +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env php -getPairs(); -cid=1 -pid=1 - -测试项目集10下的11号产品 >> 正常产品11 -测试项目集10下的55号产品 >> 多分支产品55 -测试项目集10下的99号产品 >> 多平台产品99 -测试不存在的项目集 >> 没有数据 -返回所有产品的数量 >> 100 -返回项目集10下的所有产品 >> 9 -测试项目集10下的未关闭产品5 >> 正常产品6 -返回项目集10下的未关闭产品的数量 >> 5 -测试顺序program_desc >> 1 -测试顺序program_asc >> 1 -测试顺序type_desc >> 1 - -*/ - -$tester = new productBox('admin'); -var_dump($tester->getProductPairsByOrder(10, '', 'program_desc'));die; -r($tester->getProductPairs(10)) && p('11') && e('正常产品11'); // 测试项目集10下的11号产品 -r($tester->getProductPairs(10)) && p('55') && e('多分支产品55'); // 测试项目集10下的55号产品 -r($tester->getProductPairs(10)) && p('99') && e('多平台产品99'); // 测试项目集10下的99号产品 -r($tester->getProductPairs(11)) && p() && e('没有数据'); // 测试不存在的项目集 - -r($tester->getProductPairsCount(0)) && p() && e('100'); // 返回所有产品的数量 -r($tester->getProductPairsCount(10)) && p() && e('9'); // 返回项目集10下的所有产品 -r($tester->getNoclosedPairs(5)) && p('6') && e('正常产品6'); // 测试项目集10下的未关闭产品5 -r($tester->getNoclosedPairsCount(10)) && p() && e('5'); // 返回项目集10下的未关闭产品的数量 - -r($tester->getProductPairsByOrder(10, '', 'program_desc')) && p() && e('1'); // 测试顺序program_desc -r($tester->getProductPairsByOrder(11, '', 'program_asc')) && p() && e('1'); // 测试顺序program_asc -r($tester->getProductPairsByOrder(11, '', 'type_desc')) && p() && e('1'); // 测试顺序type_desc \ No newline at end of file diff --git a/test/model/product_bak/getPairscopy.php b/test/model/product_bak/getPairscopy.php deleted file mode 100755 index a0bbf5f244..0000000000 --- a/test/model/product_bak/getPairscopy.php +++ /dev/null @@ -1,95 +0,0 @@ -#!/usr/bin/env php -getPairs(); -cid=1 -pid=1 - -测试项目集10下的11号产品 >> 正常产品11 -测试项目集10下的55号产品 >> 多分支产品55 -测试项目集10下的99号产品 >> 多平台产品99 -测试不存在的项目集 >> 没有数据 -返回所有产品的数量 >> 100 -返回项目集10下的所有产品 >> 9 -测试项目集10下的未关闭产品5 >> 正常产品6 -返回项目集10下的未关闭产品的数量 >> 5 -测试顺序program_desc >> 1 -测试顺序program_asc >> 1 -测试顺序type_desc >> 1 - -*/ - -class Tester -{ - public function __construct($user, $orderBy = 'id_desc') - { - global $tester; - su($user); - $this->product = $tester->loadModel('product'); - $this->config = new stdclass(); - $this->config->product->orderBy = $orderBy; - } - - public function getProductPairs($programID) - { - $pairs = $this->product->getPairs('', $programID); - if($pairs == array()) return '没有数据'; - return $pairs; - } - public function getProductPairsCount($programID) - { - $pairsCount = count($this->getProductPairs($programID)); - if($pairsCount == '没有数据') return '0'; - return $pairsCount; - } - - public function getAllPairs($programID) - { - $pairs = $this->product->getPairs('all', $programID); - if($pairs == array()) return '没有数据'; - return $pairs; - } - public function getAllPairsCount($programID) - { - $pairsCount = count($this->getAllPairs($programID)); - if($pairsCount == '没有数据') return '0'; - return $pairsCount; - } - - public function getNoclosedPairs($programID) - { - $pairs = $this->product->getPairs('noclosed', $programID); - if($pairs == array()) return '没有数据'; - return $pairs; - } - public function getNoclosedPairsCount($programID) - { - $pairsCount = count($this->getNoclosedPairs($programID)); - if($pairsCount == '没有数据') return '0'; - return $pairsCount; - } - - public function getProductPairsByOrder($programID, $mode = '', $orderBy = 'id_desc') - { - $this->config->product->orderBy = $orderBy; - $pairs = $this->product->getPairs($mode, $programID); - return checkOrder($pairs, $orderBy); - } -} - -$tester = new Tester('admin'); - -r($tester->getProductPairs(10)) && p('11' && e('正常产品11'); // 测试项目集10下的11号产品 -r($tester->getProductPairs(10)) && p('55') && e('多分支产品55'); // 测试项目集10下的55号产品 -r($tester->getProductPairs(10)) && p('99') && e('多平台产品99'); // 测试项目集10下的99号产品 -r($tester->getProductPairs(11)) && p() && e('没有数据'); // 测试不存在的项目集 -r($tester->getProductPairsCount(0)) && p() && e('100'); // 返回所有产品的数量 -r($tester->getProductPairsCount(10)) && p() && e('9'); // 返回项目集10下的所有产品 -r($tester->getNoclosedPairs(5)) && p('6') && e('正常产品6'); // 测试项目集10下的未关闭产品5 -r($tester->getNoclosedPairsCount(10)) && p() && e('5'); // 返回项目集10下的未关闭产品的数量 -r($tester->getProductPairsByOrder(10, '', 'program_desc')) && p() && e('1'); // 测试顺序program_desc -r($tester->getProductPairsByOrder(11, '', 'program_asc')) && p() && e('1'); // 测试顺序program_asc -r($tester->getProductPairsByOrder(11, '', 'type_desc')) && p() && e('1'); // 测试顺序type_desc \ No newline at end of file diff --git a/test/model/product_bak/getProjectListByProduct.php b/test/model/product_bak/getProjectListByProduct.php deleted file mode 100755 index 70d7480131..0000000000 --- a/test/model/product_bak/getProjectListByProduct.php +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env php -getProjectListByProduct(); -cid=1 -pid=1 - -返回产品1关联的项目11名字 >> 项目11 -返回产品1关联的项目21名字 >> 项目1 -传入不存在的产品 >> 没有数据 - -*/ - -class Tester -{ - public function __construct($user) - { - global $tester; - su($user); - $this->product = $tester->loadModel('product'); - } - - public function getAllProjectsByProduct($productID) - { - $projects = $this->product->getProjectListByProduct($productID, 'all'); - if($projects == array()) return '没有数据'; - return $projects; - } - - public function getProjectsByStatus($productID, $status) - { - $projects = $this->product->getProjectListByProduct($productID, $browseType); - if($projects == array()) return '没有数据'; - return $projects; - } -} - -$tester = new Tester('admin'); -r($tester->getAllProjectsByProduct(1)) && p('21:name') && e('项目11'); // 返回产品1关联的项目11名字 -r($tester->getAllProjectsByProduct(1)) && p('11:name') && e('项目1'); // 返回产品1关联的项目21名字 -r($tester->getAllProjectsByProduct(101)) && p() && e('没有数据'); // 传入不存在的产品 \ No newline at end of file diff --git a/test/model/product_bak/getProjectPairsByProduct.php b/test/model/product_bak/getProjectPairsByProduct.php deleted file mode 100755 index db4b5a7565..0000000000 --- a/test/model/product_bak/getProjectPairsByProduct.php +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env php -getProjectPairsByProduct(); -cid=1 -pid=1 - -返回产品1关联的项目11名字 >> 项目1 -返回产品1关联的项目21名字 >> 项目11 -传入不存在的产品 >> 没有数据 -返回id为15的项目名 >> 项目5 -传入不存在的项目id >> 没有数据 - -*/ - -$tester = new productBox('admin'); - -r($tester->getProjectPairsByProductID(1)) && p('11') && e('项目1'); // 返回产品1关联的项目11名字 -r($tester->getProjectPairsByProductID(1)) && p('21') && e('项目11'); // 返回产品1关联的项目21名字 -r($tester->getProjectPairsByProductID(101)) && p() && e('没有数据'); // 传入不存在的产品 - -r($tester->getAppendProject(15)) && p('15') && e('项目5'); // 返回id为15的项目名 -r($tester->getAppendProject(701)) && p() && e('没有数据'); // 传入不存在的项目id \ No newline at end of file diff --git a/test/model/product_bak/isClickable.php b/test/model/product_bak/isClickable.php deleted file mode 100755 index 2555e3b077..0000000000 --- a/test/model/product_bak/isClickable.php +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env php -isClickable(); -cid=1 -pid=1 - -status为normal,action为close >> true -status为close,action为close >> false -status为normal,action为start >> true -status为close,action为start >> true - -*/ - -$adminTester = new productBox('admin'); - -r($adminTester->testIsClickable(2, 'close')) && p() && e('true'); // status为normal,action为close -r($adminTester->testIsClickable(75, 'close')) && p() && e('false'); // status为close,action为close -r($adminTester->testIsClickable(2, 'start')) && p() && e('true'); // status为normal,action为start -r($adminTester->testIsClickable(75, 'start')) && p() && e('true'); // status为close,action为start \ No newline at end of file diff --git a/test/model/product_bak/update.php b/test/model/product_bak/update.php deleted file mode 100755 index 5dc937d9fc..0000000000 --- a/test/model/product_bak/update.php +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env php -update(); -cid=1 -pid=1 - -测试更新产品名称 >> name,正常产品2,john -测试更新产品代号 >> code,code2,newcode1 -测试更新产品名称和代号 >> name,john,jack;code,newcode1,newcode2 -测试不更改产品名称 >> 没有数据更新 -测试不更改产品代号 >> 没有数据更新 -测试同一项目集下产品名称不能重复 >> 『产品名称』已经有『jack』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 -测试同一项目集下产品代号不能重复 >> 『产品代号』已经有『newcode2』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。 - -*/ - -function updateObject($module, $objectID, $param = array()) -{ - global $tester; - $objectModel = $tester->loadModel($module); - - $object = $objectModel->getById($objectID); - foreach($object as $field => $value) - { - if(in_array($field, array_keys($param))) - { - $_POST[$field] = $param[$field]; - } - else - { - $_POST[$field] = $value; - } - } - - $change = $objectModel->update($objectID); - if($change == array()) $change = '没有数据更新'; - unset($_POST); - - if(dao::isError()) - { - return dao::getError(); - } - else - { - return $change; - } -} - -$case1 = array('name' => 'john'); -$case2 = array('code' => 'newcode1'); -$case3 = array('name' => 'jack', 'code' => 'newcode2'); -$case4 = array('name' => 'jack'); -$case5 = array('code' => 'newcode2'); -$case6 = array('name' => 'jack'); -$case7 = array('code' => 'newcode2'); - -r(updateObject('product', 2, $case1)) && p('0:field,old,new') && e('name,正常产品2,john'); // 测试更新产品名称 -r(updateObject('product', 2, $case2)) && p('0:field,old,new') && e('code,code2,newcode1'); // 测试更新产品代号 -r(updateObject('product', 2, $case3)) && p('0:field,old,new;1:field,old,new') && e('name,john,jack;code,newcode1,newcode2'); // 测试更新产品名称和代号 -r(updateObject('product', 2, $case4)) && p() && e('没有数据更新'); // 测试不更改产品名称 -r(updateObject('product', 2, $case5)) && p() && e('没有数据更新'); // 测试不更改产品代号 -r(updateObject('product', 13, $case6)) && p('name:0') && e('『产品名称』已经有『jack』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试同一项目集下产品名称不能重复 -r(updateObject('product', 13, $case7)) && p('code:0') && e('『产品代号』已经有『newcode2』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试同一项目集下产品代号不能重复 - -system("./ztest init"); \ No newline at end of file diff --git a/test/model/program/a.txt b/test/model/program/a.txt deleted file mode 100644 index 4b762b4d81..0000000000 --- a/test/model/program/a.txt +++ /dev/null @@ -1,2441 +0,0 @@ -