diff --git a/api/v1/entries/product.php b/api/v1/entries/product.php index d387d95f6d..36ef598f11 100644 --- a/api/v1/entries/product.php +++ b/api/v1/entries/product.php @@ -55,7 +55,7 @@ class productEntry extends Entry $product->execution = $this->loadModel('product')->getExecutionPairsByProduct($productID); break; case 'moduleoptionmenu': - $product->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($productID, 'bug', 0, 'all'); + $product->moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($productID, 'story', 0, 'all'); break; case 'builds': $product->builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,noterminate,nodone,withbranch', $this->param('object', 0), $this->param('objectType', 'execution')); diff --git a/module/dev/view/header.html.php b/module/dev/view/header.html.php index 090073ba79..9efce6496b 100644 --- a/module/dev/view/header.html.php +++ b/module/dev/view/header.html.php @@ -1,4 +1,4 @@ - +getModuleRoot() . 'common/view/header.html.php';?> diff --git a/test/class/report.class.php b/test/class/report.class.php index 7f197be0eb..1bdf2caa4e 100644 --- a/test/class/report.class.php +++ b/test/class/report.class.php @@ -5,6 +5,7 @@ class reportTest { global $tester; $this->objectModel = $tester->loadModel('report'); + $tester->dao->delete()->from(TABLE_ACTION)->where('id')->gt(100)->exec(); } /** @@ -75,10 +76,16 @@ class reportTest */ public function getExecutionsTest($begin = 0, $end = 0) { + global $tester; + $tester->dao->update(TABLE_EXECUTION)->set('`status`')->eq('closed')->where('`id`')->in('101,102,103,107,111,121,151,183')->exec(); + $begin = $begin != 0 ? date('Y-m-d', strtotime(date('Y-m-d') . $begin)) : 0; $end = $end != 0 ? date('Y-m-d', strtotime(date('Y-m-d') . $end)) : 0; $objects = $this->objectModel->getExecutions($begin, $end); + $tester->dao->update(TABLE_EXECUTION)->set('`status`')->eq('wait')->where('`id`')->in('101,103,107,111,121,151,183')->exec(); + $tester->dao->update(TABLE_EXECUTION)->set('`status`')->eq('doing')->where('`id`')->in('102')->exec(); + if(dao::isError()) return dao::getError(); $executions = ''; @@ -135,13 +142,31 @@ class reportTest return $count; } + /** + * Test get workload. + * + * @param int $dept + * @param string $assign + * @access public + * @return string + */ public function getWorkloadTest($dept = 0, $assign = 'assign') { - $objects = $this->objectModel->getWorkload($dept = 0, $assign = 'assign'); + $objects = $this->objectModel->getWorkload($dept, $assign); if(dao::isError()) return dao::getError(); - return $objects; + $workload = ''; + foreach($objects as $user => $work) + { + if(strlen($workload) > 40) break; + + $workload .= "$user:"; + foreach($work['total'] as $key => $value) $workload .= "$key:$value,"; + $workload = trim($workload, ','); + $workload .= ';'; + } + return $workload; } /** @@ -161,53 +186,88 @@ class reportTest return $count; } - public function getSysURLTest() - { - $objects = $this->objectModel->getSysURL(); - - if(dao::isError()) return dao::getError(); - - return $objects; - } - + /** + * Test get user bugs. + * + * @access public + * @return string + */ public function getUserBugsTest() { $objects = $this->objectModel->getUserBugs(); if(dao::isError()) return dao::getError(); - return $objects; + $counts = ''; + foreach($objects as $user => $bugs) $counts .= "$user:" . count($bugs) . ';'; + return $counts; } + /** + * Test get user tasks. + * + * @access public + * @return string + */ public function getUserTasksTest() { $objects = $this->objectModel->getUserTasks(); if(dao::isError()) return dao::getError(); - return $objects; + $counts = ''; + foreach($objects as $user => $tasks) $counts .= "$user:" . count($tasks) . ';'; + return $counts; } - public function getUserTodosTest() + /** + * Test get user todos. + * + * @access public + * @return string + */ + public function getUserTodosTest($userType) { $objects = $this->objectModel->getUserTodos(); if(dao::isError()) return dao::getError(); - return $objects; + $counts = ''; + foreach($objects as $user => $todos) + { + if(strpos($user, $userType) !== false and str_replace($userType, '', $user) < 11) $counts .= "$user:" . count($todos) . ';'; + } + return $counts; } + /** + * Test get user test tasks. + * + * @access public + * @return string + */ public function getUserTestTasksTest() { $objects = $this->objectModel->getUserTestTasks(); if(dao::isError()) return dao::getError(); - return $objects; + $counts = ''; + foreach($objects as $user => $testtasks) $counts .= "$user:" . count($testtasks) . ';'; + return $counts; } - public function getUserYearLoginsTest($accounts, $year) + /** + * Test get user login count in this year. + * + * @param string $accounts + * @access public + * @return int + */ + public function getUserYearLoginsTest($accounts) { + $year = date('Y'); + $objects = $this->objectModel->getUserYearLogins($accounts, $year); if(dao::isError()) return dao::getError(); @@ -215,8 +275,17 @@ class reportTest return $objects; } - public function getUserYearActionsTest($accounts, $year) + /** + * Test get user action count in this year. + * + * @param array $accounts + * @access public + * @return void + */ + public function getUserYearActionsTest($accounts) { + $year = date('Y'); + $objects = $this->objectModel->getUserYearActions($accounts, $year); if(dao::isError()) return dao::getError(); @@ -224,49 +293,102 @@ class reportTest return $objects; } - public function getUserYearContributionsTest($accounts, $year) + /** + * Test get user contributions in this year. + * + * @param array $accounts + * @access public + * @return string + */ + public function getUserYearContributionsTest($accounts) { + $year = date('Y'); + $objects = $this->objectModel->getUserYearContributions($accounts, $year); if(dao::isError()) return dao::getError(); - return $objects; + $contributions = ''; + foreach($objects as $type => $contributionTypes) + { + $contributions .= "$type:"; + foreach($contributionTypes as $contributionType => $count) $contributions .= "$contributionType:$count,"; + $contributions = trim($contributions, ',') . ';'; + } + return $contributions; } - public function getUserYearTodosTest($accounts, $year) + /** + * Test get user todo stat in this year. + * + * @param array $accounts + * @access public + * @return string + */ + public function getUserYearTodosTest($accounts) { + $year = date('Y'); $objects = $this->objectModel->getUserYearTodos($accounts, $year); if(dao::isError()) return dao::getError(); - return $objects; + $count = ''; + foreach($objects as $type => $value) $count .= "$type:$value;"; + return $count; } - public function getUserYearEffortsTest($accounts, $year) + /** + * Test get user effort stat in this error. + * + * @param string $accounts + * @access public + * @return object + */ + public function getUserYearEffortsTest($accounts) { - $objects = $this->objectModel->getUserYearEfforts($accounts, $year); + $year = date('Y'); + + $object = $this->objectModel->getUserYearEfforts($accounts, $year); if(dao::isError()) return dao::getError(); - return $objects; + return $object; } - public function getUserYearProductsTest($accounts, $year) + /** + * Test get count of created story,plan and closed story by accounts every product in this year. + * + * @param mixed $accounts + * @access public + * @return void + */ + public function getUserYearProductsTest($accounts) { + $year = date('Y'); + $objects = $this->objectModel->getUserYearProducts($accounts, $year); if(dao::isError()) return dao::getError(); - return $objects; + return implode(',', array_keys($objects)); } - public function getUserYearExecutionsTest($accounts, $year) + /** + * Test get count of finished task, story and resolved bug by accounts every executions in this years. + * + * @param string $accounts + * @access public + * @return string + */ + public function getUserYearExecutionsTest($accounts) { + $year = date('Y'); + $objects = $this->objectModel->getUserYearExecutions($accounts, $year); if(dao::isError()) return dao::getError(); - return $objects; + return implode(',', array_keys($objects)); } /** @@ -290,49 +412,96 @@ class reportTest return $types; } - public function getYearObjectStatTest($accounts, $year, $objectType) + /** + * Test get year object stat, include status and action stat. + * + * @param string $accounts + * @param string $objectType + * @access public + * @return string + */ + public function getYearObjectStatTest($accounts, $objectType) { + $year = date('Y'); + $objects = $this->objectModel->getYearObjectStat($accounts, $year, $objectType); if(dao::isError()) return dao::getError(); - return $objects; + $stats = ''; + foreach($objects['statusStat'] as $stat => $count) $stats .= "$stat:$count;"; + return $stats; } - public function getYearCaseStatTest($accounts, $year) + /** + * Test get year case stat, include result and action stat. + * + * @param string $accounts + * @access public + * @return string + */ + public function getYearCaseStatTest($accounts) { + $year = date('Y'); + $objects = $this->objectModel->getYearCaseStat($accounts, $year); if(dao::isError()) return dao::getError(); - return $objects; + $result = ''; + foreach($objects['resultStat'] as $type => $value) $result .= "$type:$value;"; + return $result; } + /** + * Test get year months. + * + * @param string $year + * @access public + * @return string + */ public function getYearMonthsTest($year) { $objects = $this->objectModel->getYearMonths($year); if(dao::isError()) return dao::getError(); - return $objects; + return implode(',', $objects); } + /** + * Test get status overview. + * + * @param string $objectType + * @param array $statusStat + * @access public + * @return string + */ public function getStatusOverviewTest($objectType, $statusStat) { - $objects = $this->objectModel->getStatusOverview($objectType, $statusStat); + $object = $this->objectModel->getStatusOverview($objectType, $statusStat); if(dao::isError()) return dao::getError(); - return $objects; + return $object; } + /** + * Test get project status overview. + * + * @param array $accounts + * @access public + * @return string + */ public function getProjectStatusOverviewTest($accounts = array()) { - $objects = $this->objectModel->getProjectStatusOverview($accounts = array()); + $objects = $this->objectModel->getProjectStatusOverview($accounts); if(dao::isError()) return dao::getError(); - return $objects; + $counts = ''; + foreach($objects as $type => $count) $counts .= "$type:$count;"; + return $counts; } /** @@ -343,8 +512,9 @@ class reportTest * @access public * @return string */ - public function getOutput4APITest($accounts, $year) + public function getOutput4APITest($accounts) { + $year = date('Y'); $objects = $this->objectModel->getOutput4API($accounts, $year); if(dao::isError()) return dao::getError(); @@ -354,12 +524,19 @@ class reportTest return $output; } - public function getProjectExecutionsTest() + /** + * Test get project and execution name. + * + * @param bool $count + * @access public + * @return int|array + */ + public function getProjectExecutionsTest($count = false) { $objects = $this->objectModel->getProjectExecutions(); if(dao::isError()) return dao::getError(); - return $objects; + return $count ? count($objects) : $objects; } } diff --git a/test/model/bug/confirm.php b/test/model/bug/confirm.php index a90a1e2043..311839d258 100755 --- a/test/model/bug/confirm.php +++ b/test/model/bug/confirm.php @@ -30,6 +30,6 @@ $bug = new bugTest(); r($bug->confirmTest($bugIDlist[0],$bug1)) && p('0:field,old,new;1:field,old,new') && e('assignedTo,admin,user92;confirmed,0,1'); // 确认指派人变化的bug r($bug->confirmTest($bugIDlist[1],$bug3)) && p('0:field,old,new;1:field,old,new') && e('type,install,codeerror;confirmed,0,1'); // 确认类型变化的bug r($bug->confirmTest($bugIDlist[2],$bug4)) && p('0:field,old,new') && e('assignedTo,admin,user95'); // 确认已确认的bug -r($bug->confirmTest($bugIDlist[3],$bug5)) && p('0:field,old,new;1:field,old,new') && e('status,resolved,active;;pri,3,2'); // 确认优先级变化的bug +r($bug->confirmTest($bugIDlist[3],$bug5)) && p('0:field,old,new;1:field,old,new') && e('status,resolved,active;pri,3,2'); // 确认优先级变化的bug r($bug->confirmTest($bugIDlist[4],$bug8)) && p('0:field,old,new') && e('status,closed,active'); // 确认bug system("./ztest init"); diff --git a/test/model/bug/createbugfromgitlabissue.php b/test/model/bug/createbugfromgitlabissue.php index 4643b3ea58..c481435603 100755 --- a/test/model/bug/createbugfromgitlabissue.php +++ b/test/model/bug/createbugfromgitlabissue.php @@ -44,7 +44,7 @@ $bug5->execution = $executionID; $bug=new bugTest(); 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($bug2, $executionID)) && p('execution') && e('101'); // 测试正常的创建来源于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 diff --git a/test/model/bug/getdataofbugsperassignedto.php b/test/model/bug/getdataofbugsperassignedto.php index be5d2d698a..cc6269e823 100755 --- a/test/model/bug/getdataofbugsperassignedto.php +++ b/test/model/bug/getdataofbugsperassignedto.php @@ -18,7 +18,7 @@ pid=1 $bug=new bugTest(); -r($bug->getDataOfBugsPerAssignedToTest()) && p('admin:name,value') && e('admin,80'); // 获取用户admin数据 +r($bug->getDataOfBugsPerAssignedToTest()) && p('admin:name,value') && e('admin,85'); // 获取用户admin数据 r($bug->getDataOfBugsPerAssignedToTest()) && p('dev1:name,value') && e('开发1,85'); // 获取用户dev1数据 r($bug->getDataOfBugsPerAssignedToTest()) && p('test1:name,value') && e('测试1,85'); // 获取用户test1数据 r($bug->getDataOfBugsPerAssignedToTest()) && p('closed:name,value') && e('Closed,20'); // 获取用户closed数据 diff --git a/test/model/bug/getdataofopenedbugsperday.php b/test/model/bug/getdataofopenedbugsperday.php index f1c700da29..3530616d0f 100755 --- a/test/model/bug/getdataofopenedbugsperday.php +++ b/test/model/bug/getdataofopenedbugsperday.php @@ -9,10 +9,10 @@ title=bugModel->getDataOfOpenedBugsPerDay(); cid=1 pid=1 -获取创建的数据 >> 315 +获取创建的数据 >> 23 */ $bug=new bugTest(); -r($bug->getDataOfOpenedBugsPerDayTest()) && p('0:value') && e('315'); // 获取创建的数据 +r($bug->getDataOfOpenedBugsPerDayTest()) && p('0:value') && e('23'); // 获取创建的数据 diff --git a/test/model/bug/getuserbugs.php b/test/model/bug/getuserbugs.php index a80e06f3ef..167d6a14ea 100755 --- a/test/model/bug/getuserbugs.php +++ b/test/model/bug/getuserbugs.php @@ -22,7 +22,7 @@ $accountIDList = array('admin', 'test1', 'test2', 'dev1', 'po1'); $bug=new bugTest(); r($bug->getUserBugsTest($accountIDList[0])) && p() && e('85'); // 测试获取用户admin的bug -r($bug->getUserBugsTest($accountIDList[1])) && p() && e('55'); // 测试获取用户test1的bug +r($bug->getUserBugsTest($accountIDList[1])) && p() && e('85'); // 测试获取用户test1的bug r($bug->getUserBugsTest($accountIDList[2])) && p() && e('0'); // 测试获取用户test2的bug r($bug->getUserBugsTest($accountIDList[3])) && p() && e('55'); // 测试获取用户dev1的bug r($bug->getUserBugsTest($accountIDList[4])) && p() && e('0'); // 测试获取用户po1的bug diff --git a/test/model/bug/update.php b/test/model/bug/update.php index 7d3899c674..05908734c5 100755 --- a/test/model/bug/update.php +++ b/test/model/bug/update.php @@ -28,7 +28,7 @@ $t_untitle = array('title' => 'jack'); $t_untype = array('type' => 'install'); $bug=new bugTest(); -r($bug->updateObject($projectIdList[0], $t_uptitle)) && p('0:field,old,new') && e('title,正常bug2,john'); // 测试更新bug名称 +r($bug->updateObject($projectIdList[0], $t_uptitle)) && p('0:field,old,new') && e('title,BUG1,john'); // 测试更新bug名称 r($bug->updateObject($projectIdList[0], $t_uptype)) && p('0:field,old,new') && e('type,codeerror,config'); // 测试更新bug类型 r($bug->updateObject($projectIdList[0], $t_typetitle)) && p('0:field,old,new;1:field,old,new') && e('title,john,jack;type,config,install'); // 测试更新bug名称和类型 r($bug->updateObject($projectIdList[0], $t_untitle)) && p() && e('没有数据更新'); // 测试不更改bug名称 diff --git a/test/model/report/createsinglejson.php b/test/model/report/createsinglejson.php index 4091dae87a..75777567e3 100755 --- a/test/model/report/createsinglejson.php +++ b/test/model/report/createsinglejson.php @@ -10,11 +10,11 @@ title=测试 reportModel->createSingleJSON(); cid=1 pid=1 -测试获取执行 101 的json数据 >> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] -测试获取执行 102 的json数据 >> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] -测试获取执行 103 的json数据 >> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] +测试获取执行 101 的json数据 >> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36] +测试获取执行 102 的json数据 >> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4] +测试获取执行 103 的json数据 >> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23] 测试获取执行 104 的json数据 >> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12] -测试获取执行 105 的json数据 >> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] +测试获取执行 105 的json数据 >> [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6] */ @@ -22,8 +22,8 @@ $report = new reportTest(); $executionID = array(101, 102, 103, 104, 105); -r($report->createSingleJSONTest($executionID[0])) && p() && e('[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]'); // 测试获取执行 101 的json数据 -r($report->createSingleJSONTest($executionID[1])) && p() && e('[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]'); // 测试获取执行 102 的json数据 -r($report->createSingleJSONTest($executionID[2])) && p() && e('[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]'); // 测试获取执行 103 的json数据 -r($report->createSingleJSONTest($executionID[3])) && p() && e('[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12]'); // 测试获取执行 104 的json数据 -r($report->createSingleJSONTest($executionID[4])) && p() && e('[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]'); // 测试获取执行 105 的json数据 \ No newline at end of file +r($report->createSingleJSONTest($executionID[0])) && p() && e('[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36]'); // 测试获取执行 101 的json数据 +r($report->createSingleJSONTest($executionID[1])) && p() && e('[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4]'); // 测试获取执行 102 的json数据 +r($report->createSingleJSONTest($executionID[2])) && p() && e('[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23]'); // 测试获取执行 103 的json数据 +r($report->createSingleJSONTest($executionID[3])) && p() && e('[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12]'); // 测试获取执行 104 的json数据 +r($report->createSingleJSONTest($executionID[4])) && p() && e('[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6]'); // 测试获取执行 105 的json数据 \ No newline at end of file diff --git a/test/model/report/getexecutions.php b/test/model/report/getexecutions.php index 2d60bad624..9f8b4ff667 100755 --- a/test/model/report/getexecutions.php +++ b/test/model/report/getexecutions.php @@ -24,14 +24,9 @@ $end = array('0', ' +10 day', ' +15 day', ' +20 day', ' +25 day', ' +30 day'); $report = new reportTest(); -global $tester; -$tester->dao->update(TABLE_EXECUTION)->set('`status`')->eq('closed')->where('id')->in('101,102,103,107,111,121,151,183')->exec(); - r($report->getExecutionsTest($begin[0], $end[0])) && p() && e('151:30,15,项目51;183:15,30,项目83;121:27,15,项目21;111:27,12,项目11;107:30,35,项目7;103:23,35,项目3;102:9,18,项目2;101:3,15,项目1;'); // 测试查询 开始时间 0 结束时间 0 的执行 r($report->getExecutionsTest($begin[1], $end[1])) && p() && e('103:23,35,项目3;102:9,18,项目2;101:3,15,项目1;'); // 测试查询 开始时间大于 -40 day 结束时间小于 -10 day 的执行 r($report->getExecutionsTest($begin[2], $end[2])) && p() && e('107:30,35,项目7;103:23,35,项目3;102:9,18,项目2;101:3,15,项目1;'); // 测试查询 开始时间大于 -28 day 结束时间小于 +5 day 的执行 r($report->getExecutionsTest($begin[3], $end[3])) && p() && e('111:27,12,项目11;107:30,35,项目7;'); // 测试查询 开始时间大于 -24 day 结束时间小于 +10 day 的执行 r($report->getExecutionsTest($begin[4], $end[4])) && p() && e('111:27,12,项目11;'); // 测试查询 开始时间大于 -20 day 结束时间小于 +15 day 的执行 -r($report->getExecutionsTest($begin[5], $end[5])) && p() && e('121:27,15,项目21;'); // 测试查询 开始时间大于 -20 day 结束时间小于 +20 day 的执行 -$tester->dao->update(TABLE_EXECUTION)->set('`status`')->eq('wait')->where('id')->in('101,103,107,111,121,151,183')->exec(); -$tester->dao->update(TABLE_EXECUTION)->set('`status`')->eq('doing')->where('id')->in('102')->exec(); +r($report->getExecutionsTest($begin[5], $end[5])) && p() && e('121:27,15,项目21;'); // 测试查询 开始时间大于 -20 day 结束时间小于 +20 day 的执行 \ No newline at end of file diff --git a/test/model/report/getproducts.php b/test/model/report/getproducts.php index 5d92b90846..02dec70a33 100755 --- a/test/model/report/getproducts.php +++ b/test/model/report/getproducts.php @@ -10,7 +10,12 @@ title=测试 reportModel->getProducts(); cid=1 pid=1 - +测试获取 story 产品 >> product:80;plan:39 +测试获取 story closedProduct 产品 >> product:120;plan:44 +测试获取 story overduePlan 产品 >> product:80;plan:93 +测试获取 requirement 产品 >> product:80;plan:39 +测试获取 requirement closedProduct 产品 >> product:120;plan:44 +测试获取 requirement overduePlan 产品 >> product:80;plan:93 */ $conditions = array('', 'closedProduct', 'overduePlan'); @@ -18,9 +23,9 @@ $storyType = 'requirement'; $report = new reportTest(); -r($report->getProductsTest($conditions[0])) && p() && e(''); // 测试获取 story 产品 -r($report->getProductsTest($conditions[1])) && p() && e(''); // 测试获取 story closedProduct 产品 -r($report->getProductsTest($conditions[2])) && p() && e(''); // 测试获取 story overduePlan 产品 -r($report->getProductsTest($conditions[0], $storyType)) && p() && e(''); // 测试获取 requirement 产品 -r($report->getProductsTest($conditions[1], $storyType)) && p() && e(''); // 测试获取 requirement closedProduct 产品 -r($report->getProductsTest($conditions[2], $storyType)) && p() && e(''); // 测试获取 requirement overduePlan 产品 \ No newline at end of file +r($report->getProductsTest($conditions[0])) && p() && e('product:80;plan:39'); // 测试获取 story 产品 +r($report->getProductsTest($conditions[1])) && p() && e('product:120;plan:44'); // 测试获取 story closedProduct 产品 +r($report->getProductsTest($conditions[2])) && p() && e('product:80;plan:93'); // 测试获取 story overduePlan 产品 +r($report->getProductsTest($conditions[0], $storyType)) && p() && e('product:80;plan:39'); // 测试获取 requirement 产品 +r($report->getProductsTest($conditions[1], $storyType)) && p() && e('product:120;plan:44'); // 测试获取 requirement closedProduct 产品 +r($report->getProductsTest($conditions[2], $storyType)) && p() && e('product:80;plan:93'); // 测试获取 requirement overduePlan 产品 \ No newline at end of file diff --git a/test/model/report/getprojectexecutions.php b/test/model/report/getprojectexecutions.php new file mode 100755 index 0000000000..edb77c12e7 --- /dev/null +++ b/test/model/report/getprojectexecutions.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +getProjectExecutions(); +cid=1 +pid=1 + +获取项目执行对 101 >> 项目1/迭代1 +获取项目执行对 102 >> 项目2/迭代2 +获取项目执行对 201 >> 项目11/迭代101 +获取项目执行对 301 >> 项目21/迭代201 +获取项目执行对 401 >> 项目31/阶段301 +获取项目执行个数 >> 450 + +*/ + +$count = true; + +$executionID = array(101, 102, 201, 301, 401); + +$report = new reportTest(); + +r($report->getProjectExecutionsTest()) && p('101') && e('项目1/迭代1'); // 获取项目执行对 101 +r($report->getProjectExecutionsTest()) && p('102') && e('项目2/迭代2'); // 获取项目执行对 102 +r($report->getProjectExecutionsTest()) && p('201') && e('项目11/迭代101'); // 获取项目执行对 201 +r($report->getProjectExecutionsTest()) && p('301') && e('项目21/迭代201'); // 获取项目执行对 301 +r($report->getProjectExecutionsTest()) && p('401') && e('项目31/阶段301'); // 获取项目执行对 401 +r($report->getProjectExecutionsTest($count)) && p() && e('450'); // 获取项目执行个数 \ No newline at end of file diff --git a/test/model/report/getprojectstatusoverview.php b/test/model/report/getprojectstatusoverview.php new file mode 100755 index 0000000000..f6c54b720e --- /dev/null +++ b/test/model/report/getprojectstatusoverview.php @@ -0,0 +1,30 @@ +#!/usr/bin/env php +getProjectStatusOverview(); +cid=1 +pid=1 + +获取项目状态 >> wait:24;doing:44;suspended:11;closed:11; +获取 admin pm92 pm1 为团队成员的项目状态 >> wait:1; +获取 user1 user10 为团队成员的项目状态 >> wait:1; +获取 pm92 po2 为团队成员的项目状态 >> wait:1;doing:1; +获取 user20 user21 为团队成员的项目状态 >> doing:2; +获取 pm92 po10 为团队成员的项目状态 >> wait:1;doing:1; + +*/ +$account = array('admin,pm92,pm1', 'user1,user10', ' pm92,po2', 'user20,user21', 'pm92,po10'); + +$report = new reportTest(); + +r($report->getProjectStatusOverviewTest()) && p() && e('wait:24;doing:44;suspended:11;closed:11;'); // 获取项目状态 +r($report->getProjectStatusOverviewTest($account[0])) && p() && e('wait:1;'); // 获取 admin pm92 pm1 为团队成员的项目状态 +r($report->getProjectStatusOverviewTest($account[1])) && p() && e('wait:1;'); // 获取 user1 user10 为团队成员的项目状态 +r($report->getProjectStatusOverviewTest($account[2])) && p() && e('wait:1;doing:1;'); // 获取 pm92 po2 为团队成员的项目状态 +r($report->getProjectStatusOverviewTest($account[3])) && p() && e('doing:2;'); // 获取 user20 user21 为团队成员的项目状态 +r($report->getProjectStatusOverviewTest($account[4])) && p() && e('wait:1;doing:1;'); // 获取 pm92 po10 为团队成员的项目状态 \ No newline at end of file diff --git a/test/model/report/getstatusoverview.php b/test/model/report/getstatusoverview.php new file mode 100755 index 0000000000..42cdaed8d3 --- /dev/null +++ b/test/model/report/getstatusoverview.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +getStatusOverview(); +cid=1 +pid=1 + +测试获取 story 状态数量 >> 总需求   21
未完成   16 +测试获取 task 状态数量 >> 总任务   21
未完成   6 +测试获取 bug 状态数量 >> 总Bug   21
未解决   1 + +*/ +$objectType = array('story', 'task', 'bug'); +$statusStat = array('active' => 1, 'wait' => 2, 'doing' => 3, 'done' => 4, 'closed' => 5, 'cancel' => 6); + +$report = new reportTest(); + +r($report->getStatusOverviewTest($objectType[0], $statusStat)) && p() && e('总需求   21
未完成   16'); // 测试获取 story 状态数量 +r($report->getStatusOverviewTest($objectType[1], $statusStat)) && p() && e('总任务   21
未完成   6'); // 测试获取 task 状态数量 +r($report->getStatusOverviewTest($objectType[2], $statusStat)) && p() && e('总Bug   21
未解决   1'); // 测试获取 bug 状态数量 \ No newline at end of file diff --git a/test/model/report/getuserbugs.php b/test/model/report/getuserbugs.php new file mode 100755 index 0000000000..2fd8811da4 --- /dev/null +++ b/test/model/report/getuserbugs.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getUserBugs(); +cid=1 +pid=1 + +获取人员bug数 >> admin:79;dev1:52;test1:77 + +*/ + +$report = new reportTest(); + +r($report->getUserBugsTest()) && p() && e('admin:79;dev1:52;test1:77'); // 获取人员bug数 \ No newline at end of file diff --git a/test/model/report/getusertasks.php b/test/model/report/getusertasks.php new file mode 100755 index 0000000000..3355dfbba1 --- /dev/null +++ b/test/model/report/getusertasks.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getUserTasks(); +cid=1 +pid=1 + +获取人员任务数 >> po82:2;user92:2; + +*/ + +$report = new reportTest(); + +r($report->getUserTasksTest()) && p() && e('po82:2;user92:2;'); // 获取人员任务数 \ No newline at end of file diff --git a/test/model/report/getusertesttasks.php b/test/model/report/getusertesttasks.php new file mode 100755 index 0000000000..8d328f0f60 --- /dev/null +++ b/test/model/report/getusertesttasks.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getUserTestTasks(); +cid=1 +pid=1 + +测试获取测试任务数 >> user3:9;user4:9;user7:8;user8:8;user11:8;user12:8; + +*/ + +$report = new reportTest(); + +r($report->getUserTestTasksTest()) && p() && e('user3:9;user4:9;user7:8;user8:8;user11:8;user12:8;'); // 测试获取测试任务数 \ No newline at end of file diff --git a/test/model/report/getusertodos.php b/test/model/report/getusertodos.php new file mode 100755 index 0000000000..c5b0dff672 --- /dev/null +++ b/test/model/report/getusertodos.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +getUserTodos(); +cid=1 +pid=1 + +测试获取用户待办数 >> admin:2; +测试获取用户待办数 >> dev1:2;dev2:2;dev5:2;dev6:2;dev9:2;dev10:2; +测试获取用户待办数 >> test1:2;test2:2;test5:2;test6:2;test9:2;test10:2; +测试获取用户待办数 >> user4:2;user5:2;user8:2;user9:2; +测试获取用户待办数 >> pm1:2;pm2:2;pm5:2;pm6:2;pm9:2;pm10:2; +测试获取用户待办数 >> po1:2;po2:2;po5:2;po6:2;po9:2;po10:2; + +*/ + +$userType = array('admin', 'dev', 'test', 'user', 'pm', 'po'); + +$report = new reportTest(); + +r($report->getUserTodosTest($userType[0])) && p() && e('admin:2;'); // 测试获取用户待办数 +r($report->getUserTodosTest($userType[1])) && p() && e('dev1:2;dev2:2;dev5:2;dev6:2;dev9:2;dev10:2; '); // 测试获取用户待办数 +r($report->getUserTodosTest($userType[2])) && p() && e('test1:2;test2:2;test5:2;test6:2;test9:2;test10:2;'); // 测试获取用户待办数 +r($report->getUserTodosTest($userType[3])) && p() && e('user4:2;user5:2;user8:2;user9:2;'); // 测试获取用户待办数 +r($report->getUserTodosTest($userType[4])) && p() && e('pm1:2;pm2:2;pm5:2;pm6:2;pm9:2;pm10:2;'); // 测试获取用户待办数 +r($report->getUserTodosTest($userType[5])) && p() && e('po1:2;po2:2;po5:2;po6:2;po9:2;po10:2;'); // 测试获取用户待办数 \ No newline at end of file diff --git a/test/model/report/getuseryearactions.php b/test/model/report/getuseryearactions.php new file mode 100755 index 0000000000..88a5bbcfca --- /dev/null +++ b/test/model/report/getuseryearactions.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getUserYearActions(); +cid=1 +pid=1 + +测试获取本年度 admin 的操作数 >> 34 +测试获取本年度 dev17 的操作数 >> 33 +测试获取本年度 test18 的操作数 >> 33 +测试获取本年度 admin dev17 的操作数 >> 67 +测试获取本年度 admin test18 的操作数 >> 67 + +*/ +$accounts = array('admin', 'dev17', 'test18', 'admin,dev17', 'admin,test18'); + +$report = new reportTest(); + +r($report->getUserYearActionsTest($accounts[0])) && p() && e('34'); // 测试获取本年度 admin 的操作数 +r($report->getUserYearActionsTest($accounts[1])) && p() && e('33'); // 测试获取本年度 dev17 的操作数 +r($report->getUserYearActionsTest($accounts[2])) && p() && e('33'); // 测试获取本年度 test18 的操作数 +r($report->getUserYearActionsTest($accounts[3])) && p() && e('67'); // 测试获取本年度 admin dev17 的操作数 +r($report->getUserYearActionsTest($accounts[4])) && p() && e('67'); // 测试获取本年度 admin test18 的操作数 \ No newline at end of file diff --git a/test/model/report/getuseryearcontributions.php b/test/model/report/getuseryearcontributions.php new file mode 100755 index 0000000000..65cad484d9 --- /dev/null +++ b/test/model/report/getuseryearcontributions.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getUserYearContributions(); +cid=1 +pid=1 + +测试获取本年度 admin 的贡献数 >> repo:svnCommit:1;doc:create:1;case:run:70; +测试获取本年度 dev17 的贡献数 >> bug:close:1;product:close:1;repo:gitCommit:1;case:run:0; +测试获取本年度 test18 的贡献数 >> productplan:create:1;case:run:0; +测试获取本年度 admin dev17 的贡献数 >> bug:close:1;repo:svnCommit:1,gitCommit:1;doc:create:1;product:close:1;case:run:70; +测试获取本年度 admin test18 的贡献数 >> repo:svnCommit:1;doc:create:1;productplan:create:1;case:run:70; + +*/ +$account = array('admin', 'dev17', 'test18', 'admin,dev17', 'admin,test18'); + +$report = new reportTest(); + +r($report->getUserYearContributionsTest($account[0])) && p() && e('repo:svnCommit:1;doc:create:1;case:run:70;'); // 测试获取本年度 admin 的贡献数 +r($report->getUserYearContributionsTest($account[1])) && p() && e('bug:close:1;product:close:1;repo:gitCommit:1;case:run:0;'); // 测试获取本年度 dev17 的贡献数 +r($report->getUserYearContributionsTest($account[2])) && p() && e('productplan:create:1;case:run:0;'); // 测试获取本年度 test18 的贡献数 +r($report->getUserYearContributionsTest($account[3])) && p() && e('bug:close:1;repo:svnCommit:1,gitCommit:1;doc:create:1;product:close:1;case:run:70;'); // 测试获取本年度 admin dev17 的贡献数 +r($report->getUserYearContributionsTest($account[4])) && p() && e('repo:svnCommit:1;doc:create:1;productplan:create:1;case:run:70;'); // 测试获取本年度 admin test18 的贡献数 \ No newline at end of file diff --git a/test/model/report/getuseryearefforts.php b/test/model/report/getuseryearefforts.php new file mode 100755 index 0000000000..12d8e116f0 --- /dev/null +++ b/test/model/report/getuseryearefforts.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getUserYearEfforts(); +cid=1 +pid=1 + +获取本年度 admin 任务数 >> 599,4188 +获取本年度 po82 任务数 >> 1,3 +获取本年度 user92 任务数 >> 0,0 +获取本年度 admin po82 任务数 >> 600,4191 +获取本年度 admin user92 任务数 >> 599,4188 + +*/ +$account = array('admin', 'po82', 'user92', 'admin,po82', 'admin,user92'); + +$report = new reportTest(); + +r($report->getUserYearEffortsTest($account[0])) && p('count,consumed') && e('599,4188'); // 获取本年度 admin 任务数 +r($report->getUserYearEffortsTest($account[1])) && p('count,consumed') && e('1,3'); // 获取本年度 po82 任务数 +r($report->getUserYearEffortsTest($account[2])) && p('count,consumed') && e('0,0'); // 获取本年度 user92 任务数 +r($report->getUserYearEffortsTest($account[3])) && p('count,consumed') && e('600,4191'); // 获取本年度 admin po82 任务数 +r($report->getUserYearEffortsTest($account[4])) && p('count,consumed') && e('599,4188'); // 获取本年度 admin user92 任务数 \ No newline at end of file diff --git a/test/model/report/getuseryearexecutions.php b/test/model/report/getuseryearexecutions.php new file mode 100755 index 0000000000..8038993812 --- /dev/null +++ b/test/model/report/getuseryearexecutions.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getUserYearExecutions(); +cid=1 +pid=1 + +测试获取本年度 admin 的执行id >> 120 +测试获取本年度 dev17 的执行id >> 0 +测试获取本年度 test18 的执行id >> 127 +测试获取本年度 admin dev17 的执行id >> 120 +测试获取本年度 admin test18 的执行id >> 127,120 + +*/ +$account = array('admin', 'dev17', 'test18', 'admin,dev17', 'admin,test18'); + +$report = new reportTest(); + +r($report->getUserYearExecutionsTest($account[0])) && p() && e('120'); // 测试获取本年度 admin 的执行id +r($report->getUserYearExecutionsTest($account[1])) && p() && e('0'); // 测试获取本年度 dev17 的执行id +r($report->getUserYearExecutionsTest($account[2])) && p() && e('127'); // 测试获取本年度 test18 的执行id +r($report->getUserYearExecutionsTest($account[3])) && p() && e('120'); // 测试获取本年度 admin dev17 的执行id +r($report->getUserYearExecutionsTest($account[4])) && p() && e('127,120'); // 测试获取本年度 admin test18 的执行id \ No newline at end of file diff --git a/test/model/report/getuseryearlogins.php b/test/model/report/getuseryearlogins.php new file mode 100755 index 0000000000..789a895e82 --- /dev/null +++ b/test/model/report/getuseryearlogins.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getUserYearLogins(); +cid=1 +pid=1 + +测试获取本年度 admin 的登录次数 >> 0 +测试获取本年度 dev17 的登录次数 >> 0 +测试获取本年度 test18 的登录次数 >> 0 +测试获取本年度 admin dev17 的登录次数 >> 0 +测试获取本年度 admin test18 的登录次数 >> 0 + +*/ +$account = array('admin', 'dev17', 'test18', 'admin,dev17', 'admin,test18'); + +$report = new reportTest(); + +r($report->getUserYearLoginsTest($account[0])) && p() && e('0');// 测试获取本年度 admin 的登录次数 +r($report->getUserYearLoginsTest($account[1])) && p() && e('0');// 测试获取本年度 dev17 的登录次数 +r($report->getUserYearLoginsTest($account[2])) && p() && e('0');// 测试获取本年度 test18 的登录次数 +r($report->getUserYearLoginsTest($account[3])) && p() && e('0');// 测试获取本年度 admin dev17 的登录次数 +r($report->getUserYearLoginsTest($account[4])) && p() && e('0');// 测试获取本年度 admin test18 的登录次数 \ No newline at end of file diff --git a/test/model/report/getuseryearproducts.php b/test/model/report/getuseryearproducts.php new file mode 100755 index 0000000000..88c51a39a5 --- /dev/null +++ b/test/model/report/getuseryearproducts.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getUserYearProducts(); +cid=1 +pid=1 + +测试获取本年度 po1 的产品数 >> 1,11,21,31,41,51,61,71,81,91,101,111 +测试获取本年度 dev17 的产品数 >> 17,117 +测试获取本年度 test18 的产品数 >> 18,118 +测试获取本年度 po1 dev17 的产品数 >> 1,11,17,21,31,41,51,61,71,81,91,101,111,117 +测试获取本年度 po1 test18 的产品数 >> 1,11,18,21,31,41,51,61,71,81,91,101,111,118 + +*/ +$account = array('po1', 'dev17', 'test18', 'po1,dev17', 'po1,test18'); + +$report = new reportTest(); + +r($report->getUserYearProductsTest($account[0])) && p() && e('1,11,21,31,41,51,61,71,81,91,101,111'); // 测试获取本年度 po1 的产品数 +r($report->getUserYearProductsTest($account[1])) && p() && e('17,117'); // 测试获取本年度 dev17 的产品数 +r($report->getUserYearProductsTest($account[2])) && p() && e('18,118'); // 测试获取本年度 test18 的产品数 +r($report->getUserYearProductsTest($account[3])) && p() && e('1,11,17,21,31,41,51,61,71,81,91,101,111,117'); // 测试获取本年度 po1 dev17 的产品数 +r($report->getUserYearProductsTest($account[4])) && p() && e('1,11,18,21,31,41,51,61,71,81,91,101,111,118'); // 测试获取本年度 po1 test18 的产品数 \ No newline at end of file diff --git a/test/model/report/getuseryeartodos.php b/test/model/report/getuseryeartodos.php new file mode 100755 index 0000000000..3702b14049 --- /dev/null +++ b/test/model/report/getuseryeartodos.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getUserYearTodos(); +cid=1 +pid=1 + +测试获取本年度 admin 的产品数 >> count:3;undone:3;done:0; +测试获取本年度 dev17 的产品数 >> count:2;undone:2;done:0; +测试获取本年度 dev20 的产品数 >> count:2;undone:2;done:0; +测试获取本年度 admin dev17 的产品数 >> count:5;undone:5;done:0; +测试获取本年度 admin dev20 的产品数 >> count:5;undone:5;done:0; + +*/ +$account = array('admin', 'dev17', 'dev20', 'admin,dev17', 'admin,dev20'); + +$report = new reportTest(); + +r($report->getUserYearTodosTest($account[0])) && p() && e('count:3;undone:3;done:0;'); // 测试获取本年度 admin 的产品数 +r($report->getUserYearTodosTest($account[1])) && p() && e('count:2;undone:2;done:0;'); // 测试获取本年度 dev17 的产品数 +r($report->getUserYearTodosTest($account[2])) && p() && e('count:2;undone:2;done:0;'); // 测试获取本年度 dev20 的产品数 +r($report->getUserYearTodosTest($account[3])) && p() && e('count:5;undone:5;done:0;'); // 测试获取本年度 admin dev17 的产品数 +r($report->getUserYearTodosTest($account[4])) && p() && e('count:5;undone:5;done:0;'); // 测试获取本年度 admin dev20 的产品数 \ No newline at end of file diff --git a/test/model/report/getworkload.php b/test/model/report/getworkload.php new file mode 100755 index 0000000000..8d49a13b00 --- /dev/null +++ b/test/model/report/getworkload.php @@ -0,0 +1,27 @@ +#!/usr/bin/env php +getWorkload(); +cid=1 +pid=1 + +测试获取dept 10 的工作量 >> user92:count:7,manhour:23; +测试获取dept 49 的工作量 >> po82:count:6,manhour:12; +测试获取dept 10 非指派人 的工作量 >> user93:count:0,manhour:0;user94:count:0,manhour:0; +测试获取dept 49 非指派人 的工作量 >> po83:count:0,manhour:0;po84:count:0,manhour:0; + +*/ +$dept = array(10, 49); +$assign = 'noassign'; + +$report = new reportTest(); + +r($report->getWorkloadTest($dept[0])) && p() && e('user92:count:7,manhour:23;'); // 测试获取dept 10 的工作量 +r($report->getWorkloadTest($dept[1])) && p() && e('po82:count:6,manhour:12;'); // 测试获取dept 49 的工作量 +r($report->getWorkloadTest($dept[0], $assign)) && p() && e('user93:count:0,manhour:0;user94:count:0,manhour:0;'); // 测试获取dept 10 非指派人 的工作量 +r($report->getWorkloadTest($dept[1], $assign)) && p() && e('po83:count:0,manhour:0;po84:count:0,manhour:0;'); // 测试获取dept 49 非指派人 的工作量 \ No newline at end of file diff --git a/test/model/report/getyearcasestat.php b/test/model/report/getyearcasestat.php new file mode 100755 index 0000000000..cc3f5893ba --- /dev/null +++ b/test/model/report/getyearcasestat.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getYearCaseStat(); +cid=1 +pid=1 + +测试获取本年度 admin 的用例数 >> pass:40;fail:30; +测试获取本年度 dev17 的用例数 >> 0 +测试获取本年度 test18 的用例数 >> 0 +测试获取本年度 admin dev17 的用例数 >> pass:40;fail:30; +测试获取本年度 admin test18 的用例数 >> pass:40;fail:30; + +*/ +$account = array('admin', 'dev17', 'test18', 'admin,dev17', 'admin,test18'); + +$report = new reportTest(); + +r($report->getYearCaseStatTest($account[0])) && p() && e('pass:40;fail:30;'); // 测试获取本年度 admin 的用例数 +r($report->getYearCaseStatTest($account[1])) && p() && e('0'); // 测试获取本年度 dev17 的用例数 +r($report->getYearCaseStatTest($account[2])) && p() && e('0'); // 测试获取本年度 test18 的用例数 +r($report->getYearCaseStatTest($account[3])) && p() && e('pass:40;fail:30;'); // 测试获取本年度 admin dev17 的用例数 +r($report->getYearCaseStatTest($account[4])) && p() && e('pass:40;fail:30;'); // 测试获取本年度 admin test18 的用例数 \ No newline at end of file diff --git a/test/model/report/getyearmonths.php b/test/model/report/getyearmonths.php new file mode 100755 index 0000000000..768df406f1 --- /dev/null +++ b/test/model/report/getyearmonths.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +getYearMonths(); +cid=1 +pid=1 + +测试获取 2020 的月份 >> 2020-01,2020-02,2020-03,2020-04,2020-05,2020-06,2020-07,2020-08,2020-09,2020-10,2020-11,2020-12 +测试获取 2021 的月份 >> 2021-01,2021-02,2021-03,2021-04,2021-05,2021-06,2021-07,2021-08,2021-09,2021-10,2021-11,2021-12 +测试获取 2022 的月份 >> 2022-01,2022-02,2022-03,2022-04,2022-05,2022-06,2022-07,2022-08,2022-09,2022-10,2022-11,2022-12 +测试获取 2023 的月份 >> 2023-01,2023-02,2023-03,2023-04,2023-05,2023-06,2023-07,2023-08,2023-09,2023-10,2023-11,2023-12 +测试获取 2024 的月份 >> 2024-01,2024-02,2024-03,2024-04,2024-05,2024-06,2024-07,2024-08,2024-09,2024-10,2024-11,2024-12 + +*/ +$year = array(2020, 2021, 2022, 2023, 2024); + +$report = new reportTest(); + +r($report->getYearMonthsTest($year[0])) && p() && e('2020-01,2020-02,2020-03,2020-04,2020-05,2020-06,2020-07,2020-08,2020-09,2020-10,2020-11,2020-12'); // 测试获取 2020 的月份 +r($report->getYearMonthsTest($year[1])) && p() && e('2021-01,2021-02,2021-03,2021-04,2021-05,2021-06,2021-07,2021-08,2021-09,2021-10,2021-11,2021-12'); // 测试获取 2021 的月份 +r($report->getYearMonthsTest($year[2])) && p() && e('2022-01,2022-02,2022-03,2022-04,2022-05,2022-06,2022-07,2022-08,2022-09,2022-10,2022-11,2022-12'); // 测试获取 2022 的月份 +r($report->getYearMonthsTest($year[3])) && p() && e('2023-01,2023-02,2023-03,2023-04,2023-05,2023-06,2023-07,2023-08,2023-09,2023-10,2023-11,2023-12'); // 测试获取 2023 的月份 +r($report->getYearMonthsTest($year[4])) && p() && e('2024-01,2024-02,2024-03,2024-04,2024-05,2024-06,2024-07,2024-08,2024-09,2024-10,2024-11,2024-12'); // 测试获取 2024 的月份 \ No newline at end of file diff --git a/test/model/report/getyearobjectstat.php b/test/model/report/getyearobjectstat.php new file mode 100755 index 0000000000..f33981b0f4 --- /dev/null +++ b/test/model/report/getyearobjectstat.php @@ -0,0 +1,49 @@ +#!/usr/bin/env php +getYearObjectStat(); +cid=1 +pid=1 + +测试获取 admin story >> active:1; +测试获取 admin task >> 0 +测试获取 admin bug >> 0 +测试获取 dev17 story >> 0 +测试获取 dev17 task >> 0 +测试获取 dev17 bug >> active:1; +测试获取 test18 story >> 0 +测试获取 test18 task >> 0 +测试获取 test18 bug >> 0 +测试获取 admin dev17 story >> active:1; +测试获取 admin dev17 task >> 0 +测试获取 admin dev17 bug >> active:1; +测试获取 admin test18 story >> active:1; +测试获取 admin test18 task >> 0 +测试获取 admin test18 bug >> 0 + +*/ +$accounts = array('admin', 'dev17', 'test18', 'admin,dev17', 'admin,test18'); +$objectType = array('story', 'task', 'bug'); + +$report = new reportTest(); + +r($report->getYearObjectStatTest($accounts[0], $objectType[0])) && p() && e('active:1;'); // 测试获取 admin story +r($report->getYearObjectStatTest($accounts[0], $objectType[1])) && p() && e('0'); // 测试获取 admin task +r($report->getYearObjectStatTest($accounts[0], $objectType[2])) && p() && e('0'); // 测试获取 admin bug +r($report->getYearObjectStatTest($accounts[1], $objectType[0])) && p() && e('0'); // 测试获取 dev17 story +r($report->getYearObjectStatTest($accounts[1], $objectType[1])) && p() && e('0'); // 测试获取 dev17 task +r($report->getYearObjectStatTest($accounts[1], $objectType[2])) && p() && e('active:1;'); // 测试获取 dev17 bug +r($report->getYearObjectStatTest($accounts[2], $objectType[0])) && p() && e('0'); // 测试获取 test18 story +r($report->getYearObjectStatTest($accounts[2], $objectType[1])) && p() && e('0'); // 测试获取 test18 task +r($report->getYearObjectStatTest($accounts[2], $objectType[2])) && p() && e('0'); // 测试获取 test18 bug +r($report->getYearObjectStatTest($accounts[3], $objectType[0])) && p() && e('active:1;'); // 测试获取 admin dev17 story +r($report->getYearObjectStatTest($accounts[3], $objectType[1])) && p() && e('0'); // 测试获取 admin dev17 task +r($report->getYearObjectStatTest($accounts[3], $objectType[2])) && p() && e('active:1;'); // 测试获取 admin dev17 bug +r($report->getYearObjectStatTest($accounts[4], $objectType[0])) && p() && e('active:1;'); // 测试获取 admin test18 story +r($report->getYearObjectStatTest($accounts[4], $objectType[1])) && p() && e('0'); // 测试获取 admin test18 task +r($report->getYearObjectStatTest($accounts[4], $objectType[2])) && p() && e('0'); // 测试获取 admin test18 bug \ No newline at end of file