Add execution test
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: ""
|
||||
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->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统计
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->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统计
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->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统计
|
||||
@@ -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");
|
||||
system("./ztest init");
|
||||
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->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");
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->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");
|
||||
Reference in New Issue
Block a user