From 9eab95bff8e2ad9b1141b4a93af3a4e8a57bd568 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 11 Aug 2022 11:01:21 +0800 Subject: [PATCH 01/10] testcase init --- test/class/my.class.php | 76 +++++++ test/class/user.class.php | 246 ++++++++++++---------- test/model/my/getrequirementsbysearch.php | 0 test/model/my/getrisksbysearch.php | 0 test/model/my/getstoriesbysearch.php | 0 test/model/my/gettasksbysearch.php | 0 test/model/my/gettestcasesbysearch.php | 0 test/model/user/processaccountsort.php | 0 8 files changed, 205 insertions(+), 117 deletions(-) create mode 100755 test/model/my/getrequirementsbysearch.php create mode 100755 test/model/my/getrisksbysearch.php create mode 100755 test/model/my/getstoriesbysearch.php create mode 100755 test/model/my/gettasksbysearch.php create mode 100755 test/model/my/gettestcasesbysearch.php create mode 100644 test/model/user/processaccountsort.php diff --git a/test/class/my.class.php b/test/class/my.class.php index 6055b70091..6ad6054d93 100644 --- a/test/class/my.class.php +++ b/test/class/my.class.php @@ -114,4 +114,80 @@ class myTest return count($objects); } + /** + * Get testcases by search. + * + * @param int $queryID + * @param string $type + * @param string $orderBy + * @param int $pager + * @access public + * @return array + */ + public function getTestcasesBySearchTest($queryID, $type, $orderBy, $pager) + { + + } + + /** + * Get tasks by search. + * + * @param string $account + * @param int $limit + * @param object $pager + * @param string $orderBy + * @param int $queryID + * @access public + * @return array + */ + public function getTasksBySearchTest($account, $limit = 0, $pager = null, $orderBy = 'id_desc', $queryID = 0) + { + + } + + /** + * Get risks by search. + * + * @param int $queryID + * @param string $type + * @param string $orderBy + * @param int $pager + * @access public + * @return array + */ + public function getRisksBySearchTest($queryID, $type, $orderBy, $pager) + { + + } + + /** + * Get stories by search. + * + * @param int $queryID + * @param string $type + * @param string $orderBy + * @param int $pager + * @access public + * @return array + */ + public function getStoriesBySearchTest($queryID, $type, $orderBy, $pager) + { + + } + + /** + * Get requirements by search. + * + * @param int $queryID + * @param string $type + * @param string $orderBy + * @param int $pager + * @access public + * @return array + */ + public function getRequirementsBySearchTest($queryID, $type, $orderBy, $pager) + { + + } + } diff --git a/test/class/user.class.php b/test/class/user.class.php index 92abbd2b55..1c2afe92e9 100755 --- a/test/class/user.class.php +++ b/test/class/user.class.php @@ -9,8 +9,8 @@ class userTest /** * Test get user list. - * - * @param bool $count + * + * @param bool $count * @access public * @return void */ @@ -29,10 +29,10 @@ class userTest } /** - * Test get user information by accounts. - * - * @param array $accounts - * @param bool $count + * Test get user information by accounts. + * + * @param array $accounts + * @param bool $count * @access public * @return void */ @@ -52,11 +52,11 @@ class userTest /** * Test user get pairs. - * - * @param string $params - * @param string $usersToAppended - * @param int $maxCount - * @param array $accounts + * + * @param string $params + * @param string $usersToAppended + * @param int $maxCount + * @param array $accounts * @access public * @return void */ @@ -76,7 +76,7 @@ class userTest /** * Test get avatar pairs. - * + * * @access public * @return void */ @@ -96,7 +96,7 @@ class userTest /** * Test get user commiters. - * + * * @access public * @return void */ @@ -116,8 +116,8 @@ class userTest /** * Test get user realname and emails. - * - * @param array $accounts + * + * @param array $accounts * @access public * @return void */ @@ -137,9 +137,9 @@ class userTest /** * Test get user roles. - * - * @param array $accounts - * @param bool $needRole + * + * @param array $accounts + * @param bool $needRole * @access public * @return void */ @@ -158,11 +158,11 @@ class userTest } /** - * Test get user display infos. - * - * @param int $accounts - * @param int $deptID - * @param string $type + * Test get user display infos. + * + * @param int $accounts + * @param int $deptID + * @param string $type * @access public * @return void */ @@ -182,9 +182,9 @@ class userTest /** * Test get user by id. - * - * @param int|string $userID - * @param string $field + * + * @param int|string $userID + * @param string $field * @access public * @return void */ @@ -204,10 +204,10 @@ class userTest /** * Test get user by query. - * - * @param string $browseType - * @param string $query - * @param string $orderBy + * + * @param string $browseType + * @param string $query + * @param string $orderBy * @access public * @return void */ @@ -227,8 +227,8 @@ class userTest /** * Test create a user. - * - * @param array $params + * + * @param array $params * @access public * @return void */ @@ -252,7 +252,7 @@ class userTest /** * Test batch create users. - * + * * @access public * @return void */ @@ -279,9 +279,9 @@ class userTest /** * Test edit a user. - * + * * @param int $userID - * @param array $params + * @param array $params * @access public * @return void */ @@ -305,8 +305,8 @@ class userTest /** * Test batch edit users. - * - * @param array $params + * + * @param array $params * @access public * @return void */ @@ -326,7 +326,7 @@ class userTest { $users = array(); $userIDList = array_keys($params['account']); - foreach($userIDList as $userID) + foreach($userIDList as $userID) { $user = $this->objectModel->getByID($userID, 'id'); $users[$user->id] = $user; @@ -338,9 +338,9 @@ class userTest /** * Test edit a user password. - * + * * @param int $userID - * @param array $params + * @param array $params * @access public * @return void */ @@ -363,8 +363,8 @@ class userTest /** * Reset user password. - * - * @param array $params + * + * @param array $params * @access public * @return void */ @@ -388,8 +388,8 @@ class userTest /** * Check user password. - * - * @param array $params + * + * @param array $params * @access public * @return void */ @@ -412,7 +412,7 @@ class userTest /** * Identify user. - * + * * @param string $account * @param string $password * @access public @@ -430,7 +430,7 @@ class userTest /** * Test authorize user. - * + * * @param string $account * @access public * @return void @@ -444,7 +444,7 @@ class userTest /** * Test login user. - * + * * @param object $user * @access public * @return void @@ -465,7 +465,7 @@ class userTest /** * Test get groups by user. - * + * * @param string $account * @param string $password * @access public @@ -487,8 +487,8 @@ class userTest /** * Test get groups by visions. - * - * @param string $visions + * + * @param string $visions * @access public * @return void */ @@ -508,11 +508,11 @@ class userTest /** * Test get my objects. - * - * @param string $account - * @param string $type - * @param string $status - * @param string $orderBy + * + * @param string $account + * @param string $type + * @param string $status + * @param string $orderBy * @access public * @return void */ @@ -526,8 +526,8 @@ class userTest /** * Test get contact list. - * - * @param string $account + * + * @param string $account * @param string $params * @access public * @return void @@ -542,8 +542,8 @@ class userTest /** * Test get list by account method. - * - * @param string $account + * + * @param string $account * @access public * @return void */ @@ -554,8 +554,8 @@ class userTest /** * Test get parent stage authed users. - * - * @param int $stageID + * + * @param int $stageID * @access public * @return void */ @@ -566,8 +566,8 @@ class userTest /** * Test get contact list by id. - * - * @param int $listID + * + * @param int $listID * @access public * @return void */ @@ -578,8 +578,8 @@ class userTest /** * Test get contact user pairs. - * - * @param array $accountList + * + * @param array $accountList * @access public * @return void */ @@ -590,15 +590,15 @@ class userTest /** * Test create contact list. - * - * @param string $listName - * @param array $userList + * + * @param string $listName + * @param array $userList * @access public * @return void */ public function createContactListTest($listName = '', $userList = array()) { - $listID = $this->objectModel->createContactList($listName, $userList); + $listID = $this->objectModel->createContactList($listName, $userList); if(dao::isError()) return dao::getError(); return $this->objectModel->getContactListByID($listID); @@ -606,10 +606,10 @@ class userTest /** * Test update contact list. - * - * @param int $listID - * @param string $listName - * @param array $userList + * + * @param int $listID + * @param string $listName + * @param array $userList * @access public * @return void */ @@ -623,8 +623,8 @@ class userTest /** * Test delete a contact list. - * - * @param int $listID + * + * @param int $listID * @access public * @return void */ @@ -638,7 +638,7 @@ class userTest /** * Test delete a contact list. - * + * * @param object $user * @access public * @return void @@ -652,8 +652,8 @@ class userTest } /** - * Test get weak users. - * + * Test get weak users. + * * @access public * @return void */ @@ -666,8 +666,8 @@ class userTest } /** - * Test compute password strength. - * + * Test compute password strength. + * * @access public * @return void */ @@ -681,9 +681,9 @@ class userTest /** * Test compute user view. - * - * @param string $account - * @param bool $force + * + * @param string $account + * @param bool $force * @access public * @return void */ @@ -697,9 +697,9 @@ class userTest /** * Test get product members. - * - * @param string $account - * @param bool $force + * + * @param string $account + * @param bool $force * @access public * @return void */ @@ -713,9 +713,9 @@ class userTest /** * Test get product members. - * - * @param string $account - * @param bool $force + * + * @param string $account + * @param bool $force * @access public * @return void */ @@ -729,9 +729,9 @@ class userTest /** * Test update program view. - * - * @param array $programIdList - * @param array $users + * + * @param array $programIdList + * @param array $users * @access public * @return void */ @@ -745,7 +745,7 @@ class userTest /** * Test check program priv. - * + * * @param object $program * @param string $account * @param array $stakeholders @@ -760,7 +760,7 @@ class userTest /** * Test check project priv. - * + * * @param object $project * @param string $account * @param array $stakeholders @@ -775,7 +775,7 @@ class userTest } /** * Test check sprint priv. - * + * * @param object $sprint * @param string $account * @param array $stakeholders @@ -790,7 +790,7 @@ class userTest } /** * Test check product priv. - * + * * @param object $program * @param string $account * @param array $groups @@ -807,11 +807,11 @@ class userTest /** * Test get project authed users. - * - * @param int $projectID - * @param array $stakeholders - * @param array $teams - * @param array $whiteList + * + * @param int $projectID + * @param array $stakeholders + * @param array $teams + * @param array $whiteList * @access public * @return void */ @@ -824,10 +824,10 @@ class userTest /** * Test get program authed users. - * - * @param int $projectID - * @param array $stakeholders - * @param array $whiteList + * + * @param int $projectID + * @param array $stakeholders + * @param array $whiteList * @access public * @return void */ @@ -840,11 +840,11 @@ class userTest /** * Test get product view list users. - * - * @param int $productID - * @param array $teams - * @param array $stakeholders - * @param array $whiteList + * + * @param int $productID + * @param array $teams + * @param array $stakeholders + * @param array $whiteList * @access public * @return void */ @@ -857,8 +857,8 @@ class userTest /** * Test get product view list users. - * - * @param int $productID + * + * @param int $productID * @param string $type * @param string $params * @param array $usersToAppended @@ -872,7 +872,7 @@ class userTest /** * Test save user template. - * + * * @param string $type * @access public * @return void @@ -888,7 +888,7 @@ class userTest /** * Test get user templates. - * + * * @param string $type * @access public * @return void @@ -900,7 +900,7 @@ class userTest /** * Test get person data. - * + * * @param string $account * @access public * @return void @@ -912,7 +912,7 @@ class userTest /** * Test get user details for api. - * + * * @param array $userList * @access public * @return void @@ -924,7 +924,7 @@ class userTest /** * Test get vision list. - * + * * @access public * @return void */ @@ -943,4 +943,16 @@ class userTest { return $this->objectModel->getCanCreateStoryUsers(); } + + /** + * Put the current user first. + * + * @param array $users + * @access public + * @return array + */ + public function processAccountSortTest($users = array()) + { + return $this->objectModel->processAccountSort($users); + } } diff --git a/test/model/my/getrequirementsbysearch.php b/test/model/my/getrequirementsbysearch.php new file mode 100755 index 0000000000..e69de29bb2 diff --git a/test/model/my/getrisksbysearch.php b/test/model/my/getrisksbysearch.php new file mode 100755 index 0000000000..e69de29bb2 diff --git a/test/model/my/getstoriesbysearch.php b/test/model/my/getstoriesbysearch.php new file mode 100755 index 0000000000..e69de29bb2 diff --git a/test/model/my/gettasksbysearch.php b/test/model/my/gettasksbysearch.php new file mode 100755 index 0000000000..e69de29bb2 diff --git a/test/model/my/gettestcasesbysearch.php b/test/model/my/gettestcasesbysearch.php new file mode 100755 index 0000000000..e69de29bb2 diff --git a/test/model/user/processaccountsort.php b/test/model/user/processaccountsort.php new file mode 100644 index 0000000000..e69de29bb2 From 22e9e73dd8718e366bed65e9e5dcdc0d2c4a684f Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Thu, 11 Aug 2022 14:34:35 +0800 Subject: [PATCH 02/10] * gettestcasesbysearch --- test/class/my.class.php | 28 +++++++++++++++++++++++--- test/model/my/gettestcasesbysearch.php | 24 ++++++++++++++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/test/class/my.class.php b/test/class/my.class.php index 6ad6054d93..b9ff6a11d4 100644 --- a/test/class/my.class.php +++ b/test/class/my.class.php @@ -117,16 +117,38 @@ class myTest /** * Get testcases by search. * - * @param int $queryID * @param string $type * @param string $orderBy - * @param int $pager * @access public * @return array */ - public function getTestcasesBySearchTest($queryID, $type, $orderBy, $pager) + public function getTestcasesBySearchTest($type, $orderBy) { + global $tester; + $recTotal = 0; + $recPerPage = 20; + $pageID = 0; + $tester->app->loadClass('pager', $static = true); + $pager = new pager($recTotal, $recPerPage, $pageID); + if($type == 'contribute') + { + $cases = $this->dao->select('*')->from(TABLE_CASE)->alias('t1') + ->where($myTestcaseQuery) + ->andWhere('t1.openedBy')->eq($this->app->user->account) + ->andWhere('t1.deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll('id'); + } + else + { + $cases = $this->dao->select('t1.*')->from(TABLE_CASE)->alias('t1') + ->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.id = t2.case') + ->where($myTestcaseQuery) + ->andWhere('t2.assignedTo')->eq($this->app->user->account) + ->andWhere('t1.deleted')->eq(0) + ->orderBy($orderBy)->page($pager)->fetchAll('id'); + } + return $cases; } /** diff --git a/test/model/my/gettestcasesbysearch.php b/test/model/my/gettestcasesbysearch.php index e69de29bb2..31a0cad711 100755 --- a/test/model/my/gettestcasesbysearch.php +++ b/test/model/my/gettestcasesbysearch.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +getTestcasesBySearch(); +cid=1 +pid=1 + +当插入一条action为admin指派了task的动态时,查询结果为1条数据 >> 1 +当插入一条action为admin指派了bug的动态时,查询结果为1条数据 >> 1 + +*/ + +$my = new myTest(); +$type = array('contribute', 'openedbyme'); +$order = 'id_desc'; +a(1111);exit; +r($my->getTestcasesBySearchTest($type[0], $order)) && p() && e('1'); // +r($my->getTestcasesBySearchTest($type[1], $order)) && p() && e('1'); // + From 2574204fe910b302940cb1f498b2051b9433fe22 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Sun, 14 Aug 2022 15:08:20 +0800 Subject: [PATCH 03/10] add my testcase --- test/class/my.class.php | 39 +++++++++++--------------- test/model/my/gettasksbysearch.php | 23 +++++++++++++++ test/model/my/gettestcasesbysearch.php | 16 +++++++---- 3 files changed, 51 insertions(+), 27 deletions(-) diff --git a/test/class/my.class.php b/test/class/my.class.php index b9ff6a11d4..f1422a0540 100644 --- a/test/class/my.class.php +++ b/test/class/my.class.php @@ -131,24 +131,11 @@ class myTest $tester->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); - if($type == 'contribute') - { - $cases = $this->dao->select('*')->from(TABLE_CASE)->alias('t1') - ->where($myTestcaseQuery) - ->andWhere('t1.openedBy')->eq($this->app->user->account) - ->andWhere('t1.deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll('id'); - } - else - { - $cases = $this->dao->select('t1.*')->from(TABLE_CASE)->alias('t1') - ->leftJoin(TABLE_TESTRUN)->alias('t2')->on('t1.id = t2.case') - ->where($myTestcaseQuery) - ->andWhere('t2.assignedTo')->eq($this->app->user->account) - ->andWhere('t1.deleted')->eq(0) - ->orderBy($orderBy)->page($pager)->fetchAll('id'); - } - return $cases; + $objects = $this->objectModel->getTestcasesBySearch(0, $type, $orderBy, $pager); + + if(dao::isError()) return dao::getError(); + + return $objects; } /** @@ -156,15 +143,23 @@ class myTest * * @param string $account * @param int $limit - * @param object $pager - * @param string $orderBy - * @param int $queryID * @access public * @return array */ - public function getTasksBySearchTest($account, $limit = 0, $pager = null, $orderBy = 'id_desc', $queryID = 0) + public function getTasksBySearchTest($account, $limit = 0) { + global $tester; + $recTotal = 0; + $recPerPage = 20; + $pageID = 0; + $tester->app->loadClass('pager', $static = true); + $pager = new pager($recTotal, $recPerPage, $pageID); + $objects = $this->objectModel->getTasksBySearch($account, $limit, $pager); + + if(dao::isError()) return dao::getError(); + + return $objects; } /** diff --git a/test/model/my/gettasksbysearch.php b/test/model/my/gettasksbysearch.php index e69de29bb2..9c859261f0 100755 --- a/test/model/my/gettasksbysearch.php +++ b/test/model/my/gettasksbysearch.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +getTasksBySearch(); +cid=1 +pid=1 + +获取task状态的项目 >> 批量任务三,wait + +*/ + +$my = new myTest(); +$account = 'admin'; +$limit = 1; + +$task = $my->getTasksBySearchTest($account[0], $limit); + +r($task) && p('913:name,status') && e('批量任务三,wait');//获取task状态的项目 diff --git a/test/model/my/gettestcasesbysearch.php b/test/model/my/gettestcasesbysearch.php index 31a0cad711..5fecac67b9 100755 --- a/test/model/my/gettestcasesbysearch.php +++ b/test/model/my/gettestcasesbysearch.php @@ -10,15 +10,21 @@ title=测试 myModel->getTestcasesBySearch(); cid=1 pid=1 -当插入一条action为admin指派了task的动态时,查询结果为1条数据 >> 1 -当插入一条action为admin指派了bug的动态时,查询结果为1条数据 >> 1 +获取testcase状态的项目 >> com.ngtesting.autotest.test.TestLogin账号过期,normal +获取testcase的统计 >> 20 +获取testcase状态的项目 >> com.ngtesting.autotest.test.TestLogin密码错误,normal +获取testcase的统计 >> 18 */ $my = new myTest(); $type = array('contribute', 'openedbyme'); $order = 'id_desc'; -a(1111);exit; -r($my->getTestcasesBySearchTest($type[0], $order)) && p() && e('1'); // -r($my->getTestcasesBySearchTest($type[1], $order)) && p() && e('1'); // +$cases1 = $my->getTestcasesBySearchTest($type[0], $order); +$cases2 = $my->getTestcasesBySearchTest($type[1], $order); + +r($cases1) && p('560:title,status') && e('com.ngtesting.autotest.test.TestLogin账号过期,normal');//获取testcase状态的项目 +r(count($cases1)) && p() && e('20'); //获取testcase的统计 +r($cases2) && p('439:title,status') && e('com.ngtesting.autotest.test.TestLogin密码错误,normal');//获取testcase状态的项目 +r(count($cases2)) && p() && e('18'); //获取testcase的统计 From c0c981a1f650073268bf84c7c1546d9d2d253e98 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 19 Aug 2022 15:16:09 +0800 Subject: [PATCH 04/10] * module my testcase --- module/my/model.php | 1 - test/class/my.class.php | 43 +++++++++++++---------- test/model/my/getrequirementsbysearch.php | 25 +++++++++++++ test/model/my/getrisksbysearch.php | 0 test/model/my/getstoriesbysearch.php | 26 ++++++++++++++ test/model/my/gettasksbysearch.php | 2 +- test/model/my/gettestcasesbysearch.php | 8 ++--- 7 files changed, 80 insertions(+), 25 deletions(-) delete mode 100755 test/model/my/getrisksbysearch.php diff --git a/module/my/model.php b/module/my/model.php index 6f359b99f1..80a9cf47ce 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -726,7 +726,6 @@ class myModel extends model if($type == 'contribute') { $assignedByMe = $this->getAssignedByMe($this->app->user->account, '', '', $orderBy, 'risk'); - $risks = $this->dao->select('*')->from(TABLE_RISK) ->where($riskQuery) ->andWhere('deleted')->eq('0') diff --git a/test/class/my.class.php b/test/class/my.class.php index f1422a0540..666d2be88c 100644 --- a/test/class/my.class.php +++ b/test/class/my.class.php @@ -162,34 +162,29 @@ class myTest return $objects; } - /** - * Get risks by search. - * - * @param int $queryID - * @param string $type - * @param string $orderBy - * @param int $pager - * @access public - * @return array - */ - public function getRisksBySearchTest($queryID, $type, $orderBy, $pager) - { - - } - /** * Get stories by search. * * @param int $queryID * @param string $type * @param string $orderBy - * @param int $pager * @access public * @return array */ - public function getStoriesBySearchTest($queryID, $type, $orderBy, $pager) + public function getStoriesBySearchTest($queryID, $type, $orderBy) { + global $tester; + $recTotal = 0; + $recPerPage = 1; + $pageID = 0; + $tester->app->loadClass('pager', $static = true); + $pager = new pager($recTotal, $recPerPage, $pageID); + $objects = $this->objectModel->getStoriesBySearch($queryID, $type, $orderBy, $pager); + + if(dao::isError()) return dao::getError(); + + return $objects; } /** @@ -198,13 +193,23 @@ class myTest * @param int $queryID * @param string $type * @param string $orderBy - * @param int $pager * @access public * @return array */ - public function getRequirementsBySearchTest($queryID, $type, $orderBy, $pager) + public function getRequirementsBySearchTest($queryID, $type, $orderBy) { + global $tester; + $recTotal = 0; + $recPerPage = 1; + $pageID = 0; + $tester->app->loadClass('pager', $static = true); + $pager = new pager($recTotal, $recPerPage, $pageID); + $objects = $this->objectModel->getRequirementsBySearch($queryID, $type, $orderBy, $pager); + + if(dao::isError()) return dao::getError(); + + return $objects; } } diff --git a/test/model/my/getrequirementsbysearch.php b/test/model/my/getrequirementsbysearch.php index e69de29bb2..4f90ac7edf 100755 --- a/test/model/my/getrequirementsbysearch.php +++ b/test/model/my/getrequirementsbysearch.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +getRequirementsBySearch(); +cid=1 +pid=1 + +获取requirement状态的项目 >> 用户需求397,draft +获取requirement状态的项目 >> 用户需求1,active + +*/ + +$my = new myTest(); +$typeList = array('contribute', 'other'); +$orderBy = array('id_desc', 'id_asc'); + +$requirement1 = $my->getRequirementsBySearchTest(0, $typeList[0], $orderBy[0]); +$requirement2 = $my->getRequirementsBySearchTest(0, $typeList[1], $orderBy[1]); +r($requirement1) && p('397:title,status') && e('用户需求397,draft');//获取requirement状态的项目 +r($requirement2) && p('1:title,status') && e('用户需求1,active'); //获取requirement状态的项目 \ No newline at end of file diff --git a/test/model/my/getrisksbysearch.php b/test/model/my/getrisksbysearch.php deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/test/model/my/getstoriesbysearch.php b/test/model/my/getstoriesbysearch.php index e69de29bb2..4cc7a3b925 100755 --- a/test/model/my/getstoriesbysearch.php +++ b/test/model/my/getstoriesbysearch.php @@ -0,0 +1,26 @@ +#!/usr/bin/env php +getStoriesBySearch(); +cid=1 +pid=1 + +获取story状态的项目 >> 软件需求350,draft +获取story状态的项目 >> 软件需求302,draft + +*/ + +$my = new myTest(); +$typeList = array('contribute', 'other'); +$orderBy = array('id_desc', 'id_asc'); + +$story1 = $my->getStoriesBySearchTest(0, $typeList[0], $orderBy[0]); +$story2 = $my->getStoriesBySearchTest(0, $typeList[1], $orderBy[1]); + +r($story1) && p('350:title,status') && e('软件需求350,draft');//获取story状态的项目 +r($story2) && p('302:title,status') && e('软件需求302,draft');//获取story状态的项目 \ No newline at end of file diff --git a/test/model/my/gettasksbysearch.php b/test/model/my/gettasksbysearch.php index 9c859261f0..0848f3a89c 100755 --- a/test/model/my/gettasksbysearch.php +++ b/test/model/my/gettasksbysearch.php @@ -20,4 +20,4 @@ $limit = 1; $task = $my->getTasksBySearchTest($account[0], $limit); -r($task) && p('913:name,status') && e('批量任务三,wait');//获取task状态的项目 +r($task) && p('913:name,status') && e('批量任务三,wait');//获取task状态的项目 \ No newline at end of file diff --git a/test/model/my/gettestcasesbysearch.php b/test/model/my/gettestcasesbysearch.php index 5fecac67b9..6e944dbc51 100755 --- a/test/model/my/gettestcasesbysearch.php +++ b/test/model/my/gettestcasesbysearch.php @@ -24,7 +24,7 @@ $order = 'id_desc'; $cases1 = $my->getTestcasesBySearchTest($type[0], $order); $cases2 = $my->getTestcasesBySearchTest($type[1], $order); -r($cases1) && p('560:title,status') && e('com.ngtesting.autotest.test.TestLogin账号过期,normal');//获取testcase状态的项目 -r(count($cases1)) && p() && e('20'); //获取testcase的统计 -r($cases2) && p('439:title,status') && e('com.ngtesting.autotest.test.TestLogin密码错误,normal');//获取testcase状态的项目 -r(count($cases2)) && p() && e('18'); //获取testcase的统计 +r($cases1) && p('560:title,status') && e('com.ngtesting.autotest.test.TestLogin账号过期,normal');//获取testcase状态的项目 +r(count($cases1)) && p() && e('20'); //获取testcase的统计 +r($cases2) && p('439:title,status') && e('com.ngtesting.autotest.test.TestLogin密码错误,normal');//获取testcase状态的项目 +r(count($cases2)) && p() && e('18'); //获取testcase的统计 \ No newline at end of file From b0943b567d95642c0d385e5cc1aaf58dfd750c63 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 19 Aug 2022 15:27:43 +0800 Subject: [PATCH 05/10] * module my testcase --- module/my/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/my/model.php b/module/my/model.php index 80a9cf47ce..c7039e5b3b 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -726,6 +726,7 @@ class myModel extends model if($type == 'contribute') { $assignedByMe = $this->getAssignedByMe($this->app->user->account, '', '', $orderBy, 'risk'); + $risks = $this->dao->select('*')->from(TABLE_RISK) ->where($riskQuery) ->andWhere('deleted')->eq('0') From 1148c6fdf63c22cad8b65bb2acf77a225a450590 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 19 Aug 2022 15:28:41 +0800 Subject: [PATCH 06/10] * module my testcase --- module/my/model.php | 1 - 1 file changed, 1 deletion(-) diff --git a/module/my/model.php b/module/my/model.php index c7039e5b3b..80a9cf47ce 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -726,7 +726,6 @@ class myModel extends model if($type == 'contribute') { $assignedByMe = $this->getAssignedByMe($this->app->user->account, '', '', $orderBy, 'risk'); - $risks = $this->dao->select('*')->from(TABLE_RISK) ->where($riskQuery) ->andWhere('deleted')->eq('0') From 34bdbdaf79b03221f1d2ac4346488caa987ba954 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 19 Aug 2022 15:30:53 +0800 Subject: [PATCH 07/10] * module my testcase --- test/class/my.class.php | 5 +++-- test/model/my/gettestcasesbysearch.php | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/class/my.class.php b/test/class/my.class.php index 666d2be88c..67dd16d68c 100644 --- a/test/class/my.class.php +++ b/test/class/my.class.php @@ -117,12 +117,13 @@ class myTest /** * Get testcases by search. * + * @param int $query * @param string $type * @param string $orderBy * @access public * @return array */ - public function getTestcasesBySearchTest($type, $orderBy) + public function getTestcasesBySearchTest($queryID, $type, $orderBy) { global $tester; $recTotal = 0; @@ -131,7 +132,7 @@ class myTest $tester->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); - $objects = $this->objectModel->getTestcasesBySearch(0, $type, $orderBy, $pager); + $objects = $this->objectModel->getTestcasesBySearch($query, $type, $orderBy, $pager); if(dao::isError()) return dao::getError(); diff --git a/test/model/my/gettestcasesbysearch.php b/test/model/my/gettestcasesbysearch.php index 6e944dbc51..efff7bfb71 100755 --- a/test/model/my/gettestcasesbysearch.php +++ b/test/model/my/gettestcasesbysearch.php @@ -21,10 +21,10 @@ $my = new myTest(); $type = array('contribute', 'openedbyme'); $order = 'id_desc'; -$cases1 = $my->getTestcasesBySearchTest($type[0], $order); -$cases2 = $my->getTestcasesBySearchTest($type[1], $order); +$cases1 = $my->getTestcasesBySearchTest(0, $type[0], $order); +$cases2 = $my->getTestcasesBySearchTest(0, $type[1], $order); r($cases1) && p('560:title,status') && e('com.ngtesting.autotest.test.TestLogin账号过期,normal');//获取testcase状态的项目 r(count($cases1)) && p() && e('20'); //获取testcase的统计 r($cases2) && p('439:title,status') && e('com.ngtesting.autotest.test.TestLogin密码错误,normal');//获取testcase状态的项目 -r(count($cases2)) && p() && e('18'); //获取testcase的统计 \ No newline at end of file +r(count($cases2)) && p() && e('18'); //获取testcase的统计 From 7bed3e82f73065a40857c08d164fbb82441716f9 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 19 Aug 2022 15:31:49 +0800 Subject: [PATCH 08/10] * module my testcase --- test/class/my.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/class/my.class.php b/test/class/my.class.php index 67dd16d68c..5444bdea47 100644 --- a/test/class/my.class.php +++ b/test/class/my.class.php @@ -117,7 +117,7 @@ class myTest /** * Get testcases by search. * - * @param int $query + * @param int $queryID * @param string $type * @param string $orderBy * @access public From 32dc102be8bdbc05e7daf6cabe629afcb9e8a13b Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 19 Aug 2022 15:42:33 +0800 Subject: [PATCH 09/10] * module user testcase --- test/model/user/processaccountsort.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/model/user/processaccountsort.php b/test/model/user/processaccountsort.php index e69de29bb2..bd06572e5e 100644 --- a/test/model/user/processaccountsort.php +++ b/test/model/user/processaccountsort.php @@ -0,0 +1,24 @@ +#!/usr/bin/env php +processAccountSort(); +cid=1 +pid=1 + +获取当前用户信息 >> admin,qa + +*/ + +$user = new userTest(); +$admin = array( + 'account' => 'admin', + 'role' => 'qa', + 'realname' => 'admin' +); +a($user->processAccountSortTest(array('admin'=>$admin)));exit; +r($user->processAccountSortTest(array('admin'=>$admin))) && p('admin:account,role') && e('admin,qa'); //获取当前用户信息 \ No newline at end of file From 74513c5612d8d41d1a168555bd585ab9ba68ae13 Mon Sep 17 00:00:00 2001 From: lanzongjun Date: Fri, 19 Aug 2022 15:43:52 +0800 Subject: [PATCH 10/10] * module user testcase --- test/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/class/user.class.php b/test/class/user.class.php index 1c2afe92e9..dcf7725a2f 100755 --- a/test/class/user.class.php +++ b/test/class/user.class.php @@ -945,7 +945,7 @@ class userTest } /** - * Put the current user first. + * Put the current user first * * @param array $users * @access public