diff --git a/test/class/execution.class.php b/test/class/execution.class.php index 835f679a7f..5b9c4944bb 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -721,12 +721,20 @@ class executionTest } } - public function unlinkStoryTest($executionID, $count) + public function unlinkStoryTest($executionID, $count, $storyID, $param = array()) { global $tester; + $stories = array(); + $products = array(); + $createFields = array('stories' => $stories, 'products' => $products); + + foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue; + foreach($param as $key => $value) $_POST[$key] = $value; $tester->dbh->query("delete from zt_projectstory where project = $executionID"); - $this->objectModel->unlinkStory($executionID); + $this->objectModel->linkStory($executionID); + unset($_POST); + $this->objectModel->unlinkStory($executionID, $storyID); if(dao::isError()) { $error = dao::getError(); @@ -740,6 +748,88 @@ class executionTest else { $object = $tester->dbh->query("select * from zt_projectstory where project = $executionID")->fetchAll(); + if(isset($object)) + { + return $object; + } + else + { + return "全部需求已解除"; + } + } + } + + public function unlinkCasesTest($executionID, $productID, $storyID) + { + global $tester; + $tester->dbh->query("delete from zt_projectcase where project = $executionID"); + + $this->objectModel->linkCases($executionID, $productID, $storyID); + $this->objectModel->unlinkCases($executionID, $storyID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + else + { + $object = $tester->dbh->query("select * from zt_projectcase where project = $executionID")->fetchAll(); + return $object; + } + } + + public function getTeamMembersTest($executionID, $count) + { + $object = $this->objectModel->getTeamMembers($executionID); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getMembersByIdListTest($executionIdList, $count) + { + $object = $this->objectModel->getMembersByIdList($executionIdList); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { + return $object; + } + } + + public function getTeamSkipTest($taskID, $begin, $end, $count) + { + 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); + if(dao::isError()) + { + $error = dao::getError(); + return $error; + } + elseif($count == "1") + { + return count($object); + } + else + { return $object; } } diff --git a/test/data/user.yaml b/test/data/user.yaml index e1b4df56c1..ea3b28fe51 100644 --- a/test/data/user.yaml +++ b/test/data/user.yaml @@ -135,6 +135,13 @@ fields: postfix: "" loop: 0 format: "" + - field: visions + note: "版本" + range: rnd + prefix: "" + postfix: ",lite" + loop: 0 + format: "" - field: ip note: "最后IP" format: "" diff --git a/test/model/execution/getMembersByIdList.php b/test/model/execution/getMembersByIdList.php new file mode 100755 index 0000000000..3498a00cb4 --- /dev/null +++ b/test/model/execution/getMembersByIdList.php @@ -0,0 +1,29 @@ +#!/usr/bin/env php +getMembersByIdListTest(); +cid=1 +pid=1 + +敏捷执行关联用例 >> 101,1,1 +瀑布执行关联用例 >> 131,43,169 +看板执行关联用例 >> 161,68,269 +敏捷执行关联用例统计 >> 4 +瀑布执行关联用例统计 >> 4 +看板执行关联用例统计 >> 4 + +*/ + +$executionIDList = array('101', '131', '161'); +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->getMembersByIdListTest($executionIDList, $count[0])[$executionIDList[0]]) && p('0:root,account,realname') && e('101,po82,研发主管82');// 批量查询敏捷执行team +r($execution->getMembersByIdListTest($executionIDList, $count[0])[$executionIDList[1]]) && p('0:root,account,realname') && e('131,test22,开发22'); // 批量查询瀑布执行team +r($execution->getMembersByIdListTest($executionIDList, $count[0])[$executionIDList[2]]) && p('0:root,account,realname') && e('161,test52,开发52'); // 批量查询看板执行team +r($execution->getMembersByIdListTest($executionIDList, $count[1])) && p() && e('3'); // 批量查询执行team统计 diff --git a/test/model/execution/getTeamMembers.php b/test/model/execution/getTeamMembers.php new file mode 100755 index 0000000000..e5ccdb78f5 --- /dev/null +++ b/test/model/execution/getTeamMembers.php @@ -0,0 +1,31 @@ +#!/usr/bin/env php +getTeamMembersTest(); +cid=1 +pid=1 + +敏捷执行关联用例 >> 101,1,1 +瀑布执行关联用例 >> 131,43,169 +看板执行关联用例 >> 161,68,269 +敏捷执行关联用例统计 >> 4 +瀑布执行关联用例统计 >> 4 +看板执行关联用例统计 >> 4 + +*/ + +$executionIDList = array('101', '131', '161'); +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->getTeamMembersTest($executionIDList[0], $count[0])) && p('po82:root,type,userID') && e('101,execution,482'); // 敏捷执行查看team +r($execution->getTeamMembersTest($executionIDList[1], $count[0])) && p('test22:root,type,realname') && e('131,execution,开发22'); // 瀑布执行查看team +r($execution->getTeamMembersTest($executionIDList[2], $count[0])) && p('test52:root,type,realname') && e('161,execution,开发52'); // 看板执行查看team +r($execution->getTeamMembersTest($executionIDList[0], $count[1])) && p() && e('2'); // 敏捷执行team统计 +r($execution->getTeamMembersTest($executionIDList[1], $count[1])) && p() && e('1'); // 瀑布执行team统计 +r($execution->getTeamMembersTest($executionIDList[2], $count[1])) && p() && e('1'); // 看板执行team统计 diff --git a/test/model/execution/getTeamSkip.php b/test/model/execution/getTeamSkip.php new file mode 100755 index 0000000000..2b89192da2 --- /dev/null +++ b/test/model/execution/getTeamSkip.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +getTeamSkipTest(); +cid=1 +pid=1 + +敏捷执行关联用例 >> 101,1,1 +瀑布执行关联用例 >> 131,43,169 +看板执行关联用例 >> 161,68,269 +敏捷执行关联用例统计 >> 4 +瀑布执行关联用例统计 >> 4 +看板执行关联用例统计 >> 4 + +*/ + +$teamList = array('test2', 'test12', 'test15'); +$begin = 'test2'; +$end = 'test17'; +$count = array('0','1'); + +$execution = new executionTest(); +var_dump($execution->getTeamSkipTest($teamList, $teamList[0], $end, $count[0]));die; +r($execution->getTeamSkipTest($teamList, $begin, $end, $count[0])) && p('0:root,account,realname') && e('101,po82,研发主管82');// 批量查询敏捷执行team +r($execution->getTeamSkipTest($executionIDList, $count[0])[$executionIDList[1]]) && p('0:root,account,realname') && e('131,test22,开发22'); // 批量查询瀑布执行team +r($execution->getTeamSkipTest($executionIDList, $count[0])[$executionIDList[2]]) && p('0:root,account,realname') && e('161,test52,开发52'); // 批量查询看板执行team +r($execution->getTeamSkipTest($executionIDList, $count[1])) && p() && e('3'); // 批量查询执行team统计 diff --git a/test/model/execution/linkStory.php b/test/model/execution/linkStory.php index 23d4f5f5ca..e20e6d2b2b 100755 --- a/test/model/execution/linkStory.php +++ b/test/model/execution/linkStory.php @@ -34,4 +34,4 @@ r($execution->linkStoryTest($executionIDList[0], $count[1], $story)) && p() r($execution->linkStoryTest($executionIDList[1], $count[1], $story)) && p() && e('3'); // 瀑布执行关联需求统计 r($execution->linkStoryTest($executionIDList[2], $count[1], $story)) && p() && e('3'); // 看板执行关联需求统计 -system("./ztest init"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/execution/unlinkCases.php b/test/model/execution/unlinkCases.php new file mode 100755 index 0000000000..2388b35d9a --- /dev/null +++ b/test/model/execution/unlinkCases.php @@ -0,0 +1,32 @@ +#!/usr/bin/env php +unlinkCasesTest(); +cid=1 +pid=1 + +敏捷执行关联用例 >> 101,1,1 +瀑布执行关联用例 >> 131,43,169 +看板执行关联用例 >> 161,68,269 +敏捷执行关联用例统计 >> 4 +瀑布执行关联用例统计 >> 4 +看板执行关联用例统计 >> 4 + +*/ + +$executionIDList = array('101', '131', '161'); +$products = array('1', '43', '68'); +$stories = array('2', '170', '270'); +$count = array('0','1'); + +$execution = new executionTest(); +r($execution->unlinkCasesTest($executionIDList[0], $products[0], $stories[0])) && p() && e('0'); // 敏捷执行解除关联用例 +r($execution->unlinkCasesTest($executionIDList[1], $products[1], $stories[1])) && p() && e('0'); // 瀑布执行解除关联用例 +r($execution->unlinkCasesTest($executionIDList[2], $products[2], $stories[2])) && p() && e('0'); // 看板执行解除关联用例 + +system("./ztest init"); diff --git a/test/model/execution/unlinkStory.php b/test/model/execution/unlinkStory.php new file mode 100755 index 0000000000..28b27ed2c3 --- /dev/null +++ b/test/model/execution/unlinkStory.php @@ -0,0 +1,37 @@ +#!/usr/bin/env php +unlinkStoryTest(); +cid=1 +pid=1 + +敏捷执行关联需求 >> 101,1,4 +瀑布执行关联需求 >> 131,1,4 +看板执行关联需求 >> 161,1,4 +敏捷执行关联需求统计 >> 3 +瀑布执行关联需求统计 >> 3 +看板执行关联需求统计 >> 3 + +*/ + +$executionIDList = array('101', '131', '161'); +$stories = array('4', '324', '364'); +$products = array('4' => '1', '324' => '81', '364' => '91'); +$count = array('0', '1'); + +$story = array('stories' => $stories, 'products' => $products); + +$execution = new executionTest(); +r($execution->unlinkStoryTest($executionIDList[0], $count[0], $stories[0], $story)) && p('0:project,product,story') && e('101,81,324'); // 敏捷执行解除关联需求 +r($execution->unlinkStoryTest($executionIDList[1], $count[0], $stories[1], $story)) && p('0:project,product,story') && e('131,1,4'); // 瀑布执行解除关联需求 +r($execution->unlinkStoryTest($executionIDList[2], $count[0], $stories[2], $story)) && p('0:project,product,story') && e('161,1,4'); // 看板执行解除关联需求 +r($execution->unlinkStoryTest($executionIDList[0], $count[1], $stories[0], $story)) && p() && e('2'); // 敏捷执行关联需求统计 +r($execution->unlinkStoryTest($executionIDList[1], $count[1], $stories[1], $story)) && p() && e('2'); // 瀑布执行关联需求统计 +r($execution->unlinkStoryTest($executionIDList[2], $count[1], $stories[2], $story)) && p() && e('2'); // 看板执行关联需求统计 + +system("./ztest init");