diff --git a/extension/lite/group/ext/lang/en/lite.php b/extension/lite/group/ext/lang/en/lite.php
index 58d3cdaab8..b25ad3c432 100644
--- a/extension/lite/group/ext/lang/en/lite.php
+++ b/extension/lite/group/ext/lang/en/lite.php
@@ -8,4 +8,8 @@ if($this->config->edition != 'open')
$lang->resource->company->allTodo = 'allTodo';
$lang->resource->company->effort = 'companyEffort';
$lang->resource->company->alleffort = 'allEffort';
+ $lang->resource->sms = new stdclass();
+ $lang->resource->sms->index = 'index';
+ $lang->resource->sms->test = 'test';
+ $lang->resource->sms->reset = 'reset';
}
\ No newline at end of file
diff --git a/extension/lite/group/ext/lang/zh-cn/lite.php b/extension/lite/group/ext/lang/zh-cn/lite.php
index 58d3cdaab8..b25ad3c432 100644
--- a/extension/lite/group/ext/lang/zh-cn/lite.php
+++ b/extension/lite/group/ext/lang/zh-cn/lite.php
@@ -8,4 +8,8 @@ if($this->config->edition != 'open')
$lang->resource->company->allTodo = 'allTodo';
$lang->resource->company->effort = 'companyEffort';
$lang->resource->company->alleffort = 'allEffort';
+ $lang->resource->sms = new stdclass();
+ $lang->resource->sms->index = 'index';
+ $lang->resource->sms->test = 'test';
+ $lang->resource->sms->reset = 'reset';
}
\ No newline at end of file
diff --git a/framework/control.class.php b/framework/control.class.php
index 76f24e658e..9d36e0bc4f 100644
--- a/framework/control.class.php
+++ b/framework/control.class.php
@@ -35,11 +35,7 @@ class control extends baseControl
$this->app->setOpenApp();
- if(defined('IN_USE') or (defined('RUN_MODE') and RUN_MODE != 'api'))
- {
- $this->setPreference();
- $this->forceUpgrade();
- }
+ if(defined('IN_USE') or (defined('RUN_MODE') and RUN_MODE != 'api')) $this->setPreference();
if(!isset($this->config->bizVersion)) return false;
@@ -127,39 +123,6 @@ class control extends baseControl
}
}
- /**
- * If change the edition, trigger the upgrade process.
- *
- * @access public
- * @return void
- */
- public function forceUpgrade()
- {
- $installedVersion = $this->loadModel('setting')->getVersion();
-
- /* Means open source upgrade to biz or max. */
- if(is_numeric($installedVersion[0]) and $this->config->edition != 'open')
- {
- $this->loadModel('setting')->setItem('system.common.global.version', $this->config->version);
- $this->loadModel('effort')->convertEstToEffort();
- $this->loadModel('upgrade')->importBuildinModules();
- $this->upgrade->addSubStatus();
- }
-
- /* Max only has new system mode. */
- if($installedVersion[0] != 'm' and $this->config->edition == 'max')
- {
- $this->loadModel('setting')->setItem('system.common.global.version', $this->config->version);
- if($this->config->systemMode == 'classic' and $this->app->getModuleName() != 'upgrade')
- {
- $this->loadModel('setting')->setItem('system.common.global.mode', 'new');
- $this->locate(helper::createLink('upgrade', 'mergeTips'));
- }
- }
-
- return true;
- }
-
/**
* 企业版部分功能是从然之合并过来的。然之代码中调用loadModel方法时传递了一个非空的appName,在禅道中会导致错误。
* 调用父类的loadModel方法来避免这个错误。
diff --git a/module/index/css/index.css b/module/index/css/index.css
index 79cc5c8256..6d2db1a098 100644
--- a/module/index/css/index.css
+++ b/module/index/css/index.css
@@ -72,7 +72,7 @@ body.menu-hide {padding-left: 0;}
#flodNav .dropdown-submenu:focus > a, #flodNav .dropdown-submenu:hover > a {background-color: rgba(0,0,0,.2);}
#poweredBy {width: 40%; position: absolute; top: 4px; right: 0; padding: 0;}
-#globalSearchDiv {width: 52%; float: right; margin-right: 4px;}
+#globalSearchDiv {width: 200px; float: right; margin-right: 4px;}
#globalSearchDiv .input-group {width: 194px; float: right; margin-top: 2px;}
#searchbox .dropdown-menu.show-quick-go.with-active {min-width: 270px;}
#searchbox .dropdown-menu.show-quick-go > li {padding: 0 5px;}
diff --git a/test/class/bug.class.php b/test/class/bug.class.php
new file mode 100644
index 0000000000..fb0bf4dc0f
--- /dev/null
+++ b/test/class/bug.class.php
@@ -0,0 +1,162 @@
+objectModel = $tester->loadModel('bug');
+ }
+
+ /**
+ * Test create a bug.
+ *
+ * @param array $param
+ * @access public
+ * @return object
+ */
+ public function createObject($param = array())
+ {
+ $createFields['title'] = '测试创建bug';
+ $createFields['type'] = 'codeerror';
+ $createFields['product'] = 1;
+ $createFields['execution'] = 101;
+ $createFields['openedBuild'] = 'trunk';
+ $createFields['pri'] = 3;
+ $createFields['severity'] = 3;
+ $createFields['status'] = 'active';
+ $createFields['deadline'] = '2021-03-19';
+ $createFields['openedBy'] = 'admin';
+ $createFields['openedDate'] = '2021-03-19';
+
+ foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
+
+ foreach($param as $key => $value) $_POST[$key] = $value;
+
+ $object = $this->objectModel->create();
+ $objectID = $object['id'];
+ unset($_POST);
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ $object = $this->objectModel->getByID($objectID);
+ return $object;
+ }
+ }
+
+ public function batchCreateObject($productID, $param = array())
+ {
+ $modules = array('0', '0', '0');
+ $executions = array('101', '101', '0');
+ $openedBuilds = array('', '', '');
+ $title = array('', '', '');
+ $deadlines = array('0000-00-00', '0000-00-00', '0000-00-00');
+ $stepses = array('', '', '');
+ $types = array('', '', '');
+ $severities = array(3, 3, 3);
+ $oses = array('', '', '');
+ $browsers = array('', '', '');
+ $pris = array(3, 3, 3);
+ $color = array('', '', '');
+ $keywords = array('', '', '');
+
+ $createFields['modules'] = $modules;
+ $createFields['executions'] = $executions;
+ $createFields['openedBuilds'] = $openedBuilds;
+ $createFields['title'] = $title;
+ $createFields['deadlines'] = $deadlines;
+ $createFields['stepses'] = $stepses;
+ $createFields['types'] = $types;
+ $createFields['severities'] = $severities;
+ $createFields['oses'] = $oses;
+ $createFields['browsers'] = $browsers;
+ $createFields['pris'] = $pris;
+ $createFields['color'] = $color;
+ $createFields['keywords'] = $keywords;
+
+ foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
+
+ foreach($param as $key => $value) $_POST[$key] = $value;
+
+ $object = $this->objectModel->batchCreate($productID);
+
+ $bug = array();
+ if(is_array($object))
+ {
+ foreach($object as $bugID => $actionID)
+ {
+ $bug[] = $this->objectModel->getByID($bugID);
+ }
+ }
+
+ unset($_POST);
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ return empty($bug) ? $object : $bug;
+ }
+ }
+
+ /**
+ * Test create bug from gitlab issue.
+ *
+ * @param array $bug
+ * @param int $executionID
+ * @access public
+ * @return int
+ */
+ public function createBugFromGitlabIssueTest($bug, $executionID)
+ {
+ $objectID = $this->objectModel->createBugFromGitlabIssue($bug, $executionID);
+
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ $object = $objectID ? $this->objectModel->getById($objectID) : 0;
+ return $object;
+ }
+ }
+
+ /**
+ * Test get bugs.
+ *
+ * @access public
+ * @return int
+ */
+ public function getBugsTest($product, $branch, $browseType, $module)
+ {
+ global $tester;
+
+ /* Load pager. */
+ $tester->app->loadClass('pager', $static = true);
+ $pager = new pager(0, 20 ,1);
+
+ $projectID = 0;
+ $sort = 'id_desc';
+ $queryID = 0;
+ $executions = $tester->loadModel('execution')->getPairs($projectID, 'all', 'empty|withdelete');
+
+ $bugs = $this->objectModel->getBugs($product, $executions, $branch, $browseType, $module, $queryID, $sort, $pager, $projectID);
+
+ $title = '';
+ foreach($bugs as $bug) $title .= ',' . $bug->title;
+ $title = trim($title, ',');
+
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ return $title;
+ }
+ }
+}
diff --git a/test/class/execution.class.php b/test/class/execution.class.php
index 5dfe58cbeb..ad0c193582 100644
--- a/test/class/execution.class.php
+++ b/test/class/execution.class.php
@@ -2,22 +2,50 @@
class executionTest
{
+ /**
+ * __construct loadModel execution
+ *
+ * @access public
+ */
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('execution');
}
+ /**
+ * get todate
+ *
+ * @access public
+ * @return string
+ */
public function getHour()
{
return date('Y-m-d');
}
+ /**
+ * get Reduce date
+ *
+ * @param string $dayNum
+ * @access public
+ * @return string
+ */
public function getReduceHour($dayNum)
{
return date('Y-m-d',strtotime("-$dayNum day"));
}
+ /**
+ * function create test by execution
+ *
+ * @param array $param
+ * @param string $project
+ * @param string $dayNum
+ * @param string $days
+ * @access public
+ * @return array
+ */
public function createObject($param = array(), $project, $dayNum, $days)
{
$products = array('');
@@ -26,17 +54,19 @@ class executionTest
$beginData = date('Y-m-d');
$endData = date('Y-m-d',strtotime("+$dayNum day"));
$delta = intval($dayNum) + 1;
+
$createFields = array('project' => $project, 'name' => '', 'code' => '', 'begin' => $beginData, 'end' => $endData,
'lifetime' => 'short', 'status' => 'wait', 'products' => $products, 'delta' => $delta, 'days' => $days,
'plans' => $plans, 'team' => '', 'teams' => '0', 'PO' => '', 'QD' => '', 'PM' => '', 'RD' => '', 'whitelist' => '',
'desc' => '', 'acl' => 'private');
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
-
foreach($param as $key => $value) $_POST[$key] = $value;
$objectID = $this->objectModel->create();
+
unset($_POST);
+
if(dao::isError())
{
return dao::getError();
@@ -48,19 +78,30 @@ class executionTest
}
}
+ /**
+ * function update test by execution
+ *
+ * @param string $objectID
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function updateObject($objectID, $param = array())
{
global $tester;
+
$products = array('1','81','91');
- $object = $tester->dbh->query("SELECT `project`,`name`,`code`,`begin`,`end`,`days`,`lifetime`,`team`,`status`,`PO`,`QD`,`PM`,
+ $object = $tester->dbh->query("SELECT `project`,`name`,`code`,`begin`,`end`,`days`,`lifetime`,`team`,`status`,`PO`,`QD`,`PM`,
`RD`,`desc`,`acl` FROM zt_project WHERE id = $objectID ")->fetch();
$object->products = $products;
- foreach($object as $field => $defaultValue) $_POST[$field] = $defaultValue;
+ foreach($object as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
$change = $this->objectModel->update($objectID);
+
if($change == array()) $change = '没有数据更新';
+
unset($_POST);
if(dao::isError())
@@ -73,6 +114,14 @@ class executionTest
}
}
+ /**
+ * function batchUpdate test by execution
+ *
+ * @param array $param
+ * @param string $executionID
+ * @access public
+ * @return array
+ */
public function batchUpdateObject($param = array(), $executionID = '')
{
$executionIDList = array($executionID => $executionID);
@@ -89,14 +138,16 @@ class executionTest
$descs = array($executionID => '');
$teams = array($executionID => '');
$dayses = array($executionID => '');
- $createFields = array('executionIDList' => $executionIDList, 'names' => $name, 'codes' => $codes, 'PMs' => $pms, 'lifetimes' => $lifetimes,
- 'begins' => $begins, 'ends' => $ends, 'descs' => $descs, 'statuses' => $statuses, 'teams'=>$teams, 'dayses' => $dayses,'POs' => $pos,
- 'QDs' => $qds, 'RDs' => $rds);
- foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
+ $createFields = array('executionIDList' => $executionIDList, 'names' => $name, 'codes' => $codes, 'PMs' => $pms, 'lifetimes' => $lifetimes,
+ 'begins' => $begins, 'ends' => $ends, 'descs' => $descs, 'statuses' => $statuses, 'teams' => $teams, 'dayses' => $dayses,'POs' => $pos,
+ 'QDs' => $qds, 'RDs' => $rds);
+
+ foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
$object = $this->objectModel->batchUpdate();
+
unset($_POST);
if(dao::isError())
@@ -110,14 +161,27 @@ class executionTest
}
}
+ /**
+ * function start test by execution
+ *
+ * @param string $executionID
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function startTest($executionID,$param = array())
{
$data = date('Y-m-d');
+
$createFields = array( 'comment' => '开始描述测试', 'realBegan' => $data);
+
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
+
$obj = $this->objectModel->start($executionID);
+
unset($_POST);
+
if(dao::isError())
{
$error = dao::getError();
@@ -136,15 +200,28 @@ class executionTest
}
}
+ /**
+ * function putoff test by execution
+ *
+ * @param string $executionID
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function putoffTest($executionID, $param = array())
{
$begin = date('Y-m-d');
$end = date('Y-m-d',strtotime("+5 day"));
+
$createFields = array('status' => 'wait', 'days' => '5', 'comment' => '延期描述测试', 'begin' => $begin, 'end' => $end);
+
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
+
$obj = $this->objectModel->putoff($executionID);
+
unset($_POST);
+
if(dao::isError())
{
$error = dao::getError();
@@ -156,13 +233,25 @@ class executionTest
}
}
+ /**
+ * function suspend test by execution
+ *
+ * @param string $executionID
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function suspendTest($executionID, $param = array())
{
$createFields = array('status' => 'suspended', 'comment' => '挂起描述测试');
+
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
+
$obj = $this->objectModel->suspend($executionID);
+
unset($_POST);
+
if(dao::isError())
{
$error = dao::getError();
@@ -174,16 +263,30 @@ class executionTest
}
}
+ /**
+ * function activate test by execution
+ *
+ * @param string $executionID
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function activateTest($executionID, $param = array())
{
self::suspendTest($executionID);
+
$begin = date('Y-m-d');
$end = date('Y-m-d',strtotime("+5 day"));
+
$createFields = array('status' => 'doing', 'comment' => '激活描述测试', 'begin' => $begin, 'end' => $end);
+
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
+
$obj = $this->objectModel->activate($executionID);
+
unset($_POST);
+
if(dao::isError())
{
$error = dao::getError();
@@ -195,14 +298,27 @@ class executionTest
}
}
+ /**
+ * function close test by execution
+ *
+ * @param string $executionID
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function closeTest($executionID, $param = array())
{
$todate = date('Y-m-d');
+
$createFields = array('status' => 'closed', 'comment' => '关闭描述测试', 'realEnd' => $todate);
+
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
+
$obj = $this->objectModel->close($executionID);
+
unset($_POST);
+
if(dao::isError())
{
$error = dao::getError();
@@ -214,9 +330,18 @@ class executionTest
}
}
+ /**
+ * function getPairs test by execution
+ *
+ * @param string $projectID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getPairsTest($projectID,$count)
{
$object = $this->objectModel->getPairs($projectID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -232,9 +357,17 @@ class executionTest
}
}
+ /**
+ * function getByID test by execution
+ *
+ * @param string $executionID
+ * @access public
+ * @return array
+ */
public function getByIDTest($executionID)
{
$object = $this->objectModel->getByID($executionID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -246,9 +379,17 @@ class executionTest
}
}
+ /**
+ * function getByIdList test by execution
+ *
+ * @param array $executionIdList
+ * @access public
+ * @return array
+ */
public function getByIdListTest($executionIdList)
{
$object = $this->objectModel->getByIdList($executionIdList);
+
if(dao::isError())
{
$error = dao::getError();
@@ -260,9 +401,22 @@ class executionTest
}
}
+ /**
+ * function getList test by execution
+ *
+ * @param string $projectID
+ * @param string $type
+ * @param array $status
+ * @param string $limit
+ * @param string $productID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getListTest($projectID, $type, $status, $limit, $productID, $count)
{
$object = $this->objectModel->getList($projectID, $type, $status, $limit, $productID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -278,9 +432,20 @@ class executionTest
}
}
+ /**
+ * fnction getInvolvedExecutionList test by execution
+ *
+ * @param string $projectID
+ * @param string $limit
+ * @param string $productID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getInvolvedExecutionListTest($projectID, $limit, $productID, $count)
{
$object = $this->objectModel->getInvolvedExecutionList($projectID,$status = 'involved',$limit, $productID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -296,9 +461,20 @@ class executionTest
}
}
+ /**
+ * function getByProject test by execution
+ *
+ * @param string $projectID
+ * @param array $status
+ * @param string $limit
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getByProjectTest($projectID, $status, $limit, $count)
{
$object = $this->objectModel->getByProject($projectID, $status, $limit);
+
if(dao::isError())
{
$error = dao::getError();
@@ -314,9 +490,19 @@ class executionTest
}
}
+ /**
+ * function getIdList test execution
+ *
+ * @param string $projectID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getIdListTest($projectID, $count)
{
$object = $this->objectModel->getIdList($projectID);
+
+
if(dao::isError())
{
$error = dao::getError();
@@ -332,9 +518,18 @@ class executionTest
}
}
+ /**
+ * function getBranches test execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getBranchesTest($executionID, $count)
{
$object = $this->objectModel->getBranches($executionID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -350,9 +545,18 @@ class executionTest
}
}
- public function getTreeTest_bak($executionID, $count)
+ /**
+ * function getTree test execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @access public
+ * @return array
+ */
+ public function getTreeTest($executionID, $count)
{
$object = $this->objectModel->getTree($executionID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -368,9 +572,18 @@ class executionTest
}
}
+ /**
+ * function getRelatedExecutions test execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getRelatedExecutionsTest($executionID, $count)
{
$object = $this->objectModel->getRelatedExecutions($executionID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -386,9 +599,18 @@ class executionTest
}
}
+ /**
+ * function getChildExecutions test execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getChildExecutionsTest($executionID, $count)
{
$object = $this->objectModel->getChildExecutions($executionID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -404,9 +626,17 @@ class executionTest
}
}
+ /**
+ * function getProductGroupList test execution
+ *
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getProductGroupListTest($count)
{
$object = $this->objectModel->getProductGroupList();
+
if(dao::isError())
{
$error = dao::getError();
@@ -422,13 +652,29 @@ class executionTest
}
}
+ /**
+ * function getTasks test by execution
+ *
+ * @param string $productID
+ * @param string $executionID
+ * @param string $browseType
+ * @param string $queryID
+ * @param string $moduleID
+ * @param string $sort
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getTasksTest($productID, $executionID, $browseType, $queryID, $moduleID, $sort, $count)
{
global $tester;
+
$execution = $tester->dbh->query("select * from zt_project where id = $executionID")->fetch();
$executions = array($executionID => $execution->name);
$page = 'NULL';
+
$object = $this->objectModel->getTasks($productID, $executionID, $executions, $browseType, $queryID, $moduleID, $sort, $page);
+
if(dao::isError())
{
$error = dao::getError();
@@ -444,9 +690,17 @@ class executionTest
}
}
+ /**
+ * function getDefaultManagers test by execution
+ *
+ * @param string $executionID
+ * @access public
+ * @return array
+ */
public function getDefaultManagersTest($executionID)
{
$object = $this->objectModel->getDefaultManagers($executionID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -458,9 +712,18 @@ class executionTest
}
}
+ /**
+ * function getBranchByProduct test by execution
+ *
+ * @param string $productID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getBranchByProductTest($productID, $count)
{
$object = $this->objectModel->getBranchByProduct($productID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -476,9 +739,19 @@ class executionTest
}
}
+ /**
+ * function getOrderedExecutions test exection
+ *
+ * @param string $projectID
+ * @param string $status
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getOrderedExecutionsTest($projectID, $status, $count)
{
$object = $this->objectModel->getOrderedExecutions($projectID,$status);
+
if(dao::isError())
{
$error = dao::getError();
@@ -494,9 +767,19 @@ class executionTest
}
}
+ /**
+ * function getToImport test execution
+ *
+ * @param string $executionIds
+ * @param string $type
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getToImportTest($executionIds, $type, $count)
{
$object = $this->objectModel->getToImport($executionIds, $type);
+
if(dao::isError())
{
$error = dao::getError();
@@ -512,16 +795,30 @@ class executionTest
}
}
+ /**
+ * function updateProducts test by execution
+ *
+ * @param string $executionID
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function updateProductsTest($executionID,$param = array())
{
global $tester;
+
$products = array();
$branch = array();
+
$createFields = array('products' => $products, 'branch' => $branch, 'post' => 'post');
+
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
+
$this->objectModel->updateProducts($executionID);
+
unset($_POST);
+
if(dao::isError())
{
$error = dao::getError();
@@ -535,11 +832,20 @@ class executionTest
}
}
+ /**
+ * function getTasks2Imported test by execution
+ *
+ * @param string $toExecution
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getTasks2ImportedTest($toExecution, $count)
{
$branches = $this->objectModel->getBranches($toExecution);
$object = $this->objectModel->getTasks2Imported($toExecution, $branches);
+
if(dao::isError())
{
$error = dao::getError();
@@ -555,9 +861,19 @@ class executionTest
}
}
+ /**
+ * function importTask test by execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function importTaskTest($executionID, $count, $param = array())
{
global $tester;
+
$tasks = array();
$createFields = array('tasks' => $tasks);
@@ -565,6 +881,9 @@ class executionTest
foreach($param as $key => $value) $_POST[$key] = $value;
$this->objectModel->importTask($executionID);
+
+ unset($_POST);
+
if(dao::isError())
{
$error = dao::getError();
@@ -582,9 +901,17 @@ class executionTest
}
}
+ /**
+ * function statRelatedData test by execution
+ *
+ * @param string $executionID
+ * @access public
+ * @return array
+ */
public function statRelatedDataTest($executionID)
{
$object = $this->objectModel->statRelatedData($executionID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -596,6 +923,15 @@ class executionTest
}
}
+ /**
+ * function importBug test by execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function importBugTest($executionID, $count, $param = array())
{
$import = array();
@@ -604,6 +940,7 @@ class executionTest
$assignedTo = array();
$estimate = array();
$deadline = array();
+
$createFields = array('import' => $import, 'id' => $id, 'pri' => $pri, 'assignedTo' => $assignedTo,
'estimate' => $estimate, 'deadline' => $deadline);
@@ -611,6 +948,9 @@ class executionTest
foreach($param as $key => $value) $_POST[$key] = $value;
$object = $this->objectModel->importBug($executionID);
+
+ unset($_POST);
+
if(dao::isError())
{
$error = dao::getError();
@@ -626,9 +966,19 @@ class executionTest
}
}
+ /**
+ * function updateChilds test by execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function updateChildsTest($executionID, $count, $param = array())
{
global $tester;
+
$childs = array();
$createFields = array('childs' => $childs);
@@ -636,6 +986,9 @@ class executionTest
foreach($param as $key => $value) $_POST[$key] = $value;
$object = $this->objectModel->updateChilds($executionID);
+
+ unset($_POST);
+
if(dao::isError())
{
$error = dao::getError();
@@ -653,10 +1006,22 @@ class executionTest
}
}
+ /**
+ * function changeProject test by execution
+ *
+ * @param string $newProject
+ * @param string $oldProject
+ * @param string $executionID
+ * @param array $syncStories
+ * @access public
+ * @return array
+ */
public function changeProjectTest($newProject, $oldProject, $executionID, $syncStories = 'no')
{
global $tester;
+
$this->objectModel->changeProject($newProject, $oldProject, $executionID, $syncStories);
+
if(dao::isError())
{
$error = dao::getError();
@@ -669,18 +1034,33 @@ class executionTest
}
}
+ /**
+ * function linkStory test by execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function linkStoryTest($executionID, $count, $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->linkStory($executionID);
+
+ unset($_POST);
+
if(dao::isError())
{
$error = dao::getError();
@@ -698,12 +1078,24 @@ class executionTest
}
}
+ /**
+ * function linkCases test by execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @param string $productID
+ * @param string $storyID
+ * @access public
+ * @return array
+ */
public function linkCasesTest($executionID, $count, $productID, $storyID)
{
global $tester;
+
$tester->dbh->query("delete from zt_projectcase where project = $executionID");
$this->objectModel->linkCases($executionID, $productID, $storyID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -721,20 +1113,36 @@ class executionTest
}
}
+ /**
+ * function unlinkStory test by execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @param string $storyID
+ * @param array $param
+ * @access public
+ * @return array
+ */
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->linkStory($executionID);
+
unset($_POST);
+
$this->objectModel->unlinkStory($executionID, $storyID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -759,13 +1167,24 @@ class executionTest
}
}
+ /**
+ * function unlinkCases test by execution
+ *
+ * @param string $executionID
+ * @param string $productID
+ * @param string $storyID
+ * @access public
+ * @return array
+ */
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();
@@ -778,9 +1197,18 @@ class executionTest
}
}
+ /**
+ * function getTeamMembers test by execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getTeamMembersTest($executionID, $count)
{
$object = $this->objectModel->getTeamMembers($executionID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -796,9 +1224,18 @@ class executionTest
}
}
+ /**
+ * function getMembersByIdList test by execution
+ *
+ * @param array $executionIdList
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getMembersByIdListTest($executionIdList, $count)
{
$object = $this->objectModel->getMembersByIdList($executionIdList);
+
if(dao::isError())
{
$error = dao::getError();
@@ -814,11 +1251,22 @@ class executionTest
}
}
+ /**
+ * function getTeamSkip test by execution
+ *
+ * @param string $taskID
+ * @param string $begin
+ * @param string $end
+ * @access public
+ * @return array
+ */
public function getTeamSkipTest($taskID, $begin, $end)
{
global $tester;
$teams = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($taskID)->andWhere('type')->eq('task')->orderBy('order')->fetchAll('account');
+
$object = $this->objectModel->getTeamSkip($teams, $begin, $end);
+
if(dao::isError())
{
$error = dao::getError();
@@ -837,9 +1285,19 @@ class executionTest
}
}
+ /**
+ * function getTeams2Import test by execution
+ *
+ * @param string $account
+ * @param string $currentExecution
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getTeams2ImportTest($account, $currentExecution, $count)
{
$object = $this->objectModel->getTeams2Import($account, $currentExecution);
+
if(dao::isError())
{
$error = dao::getError();
@@ -862,9 +1320,19 @@ class executionTest
}
}
+ /**
+ * function getMembers2Import test by execution
+ *
+ * @param string $execution
+ * @param array $currentMembers
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getMembers2ImportTest($execution, $currentMembers, $count)
{
$object = $this->objectModel->getMembers2Import($execution, $currentMembers);
+
if(dao::isError())
{
$error = dao::getError();
@@ -887,9 +1355,18 @@ class executionTest
}
}
+ /**
+ * function getCanCopyObjects test by execution
+ *
+ * @param int $projectID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getCanCopyObjectsTest($projectID = 0, $count)
{
$object = $this->objectModel->getCanCopyObjects($projectID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -912,23 +1389,39 @@ class executionTest
}
}
+ /**
+ * function manageMembers test by execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function manageMembersTest($executionID, $count, $param = array())
{
global $tester;
$tester->dbh->query("delete from zt_team where root = $executionID");
+
$realnames = array();
$roles = array();
$days = array();
$hours = array();
$accounts = array();
$limited = array();
+
$createFields = array('realnames' => $realnames, 'roles' => $roles, 'hours' => $hours, 'accounts' => $accounts,
'limited' => $limited, 'days' => $days);
+
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
+
$object = $this->objectModel->manageMembers($executionID);
+
unset($_POST);
+
$object = $tester->dbh->query("select * from zt_team where root = $executionID")->fetchAll();
+
if(dao::isError())
{
$error = dao::getError();
@@ -951,13 +1444,25 @@ class executionTest
}
}
+ /**
+ * function addProjectMembers test by execution
+ *
+ * @param int $projectID
+ * @param string $executionID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function addProjectMembersTest($projectID = 0, $executionID, $count)
{
global $tester;
$tester->dbh->query("delete from zt_team where root = $projectID");
$executionMembers = $tester->dao->select('`root`,`account`,`join`,`role`,`days`,`type`,`hours`')->from(TABLE_TEAM)->where('root')->eq($executionID)->fetchAll('account');
+
$this->objectModel->addProjectMembers($projectID, $executionMembers);
+
$object = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($projectID)->fetchAll();
+
if(dao::isError())
{
$error = dao::getError();
@@ -973,12 +1478,24 @@ class executionTest
}
}
+ /**
+ * function unlinkMember test by execution
+ *
+ * @param string $sprintID
+ * @param string $account
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function unlinkMemberTest($sprintID, $account, $count)
{
global $tester;
$oldObject = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($sprintID)->fetchAll();
+
$this->objectModel->unlinkMember($sprintID, $account);
+
$object = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($sprintID)->fetchAll();
+
if(dao::isError())
{
$error = dao::getError();
@@ -994,9 +1511,17 @@ class executionTest
}
}
+ /**
+ * function computeBurn test by execution
+ *
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function computeBurnTest($count)
{
$object = $this->objectModel->computeBurn();
+
if(dao::isError())
{
$error = dao::getError();
@@ -1012,17 +1537,32 @@ class executionTest
}
}
+ /**
+ * function fixFirst test by execution
+ *
+ * @param string $executionID
+ * @param array $param
+ * @access public
+ * @return array
+ */
public function fixFirstTest($executionID, $param = array())
{
global $tester;
+
$date = date('Y-m-d');
+
$createFields = array('estimate' => '');
+
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
+
$this->objectModel->computeBurn();
$this->objectModel->fixFirst($executionID);
+
unset($_POST);
+
$object = $tester->dao->select('*')->from(TABLE_BURN)->where('execution')->eq($executionID)->andWhere('date')->eq($date)->fetchAll();
+
if(dao::isError())
{
$error = dao::getError();
@@ -1041,9 +1581,18 @@ class executionTest
}
}
+ /**
+ * function getBurnDataFlot test by execution
+ *
+ * @param int $executionID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getBurnDataFlotTest($executionID = 0, $count)
{
$object = $this->objectModel->getBurnDataFlot($executionID, $burnBy = 'left');
+
if(dao::isError())
{
$error = dao::getError();
@@ -1059,11 +1608,24 @@ class executionTest
}
}
+ /**
+ * function processBurnData test by execution
+ *
+ * @param string $executionID
+ * @param array $itemCounts
+ * @param string $begin
+ * @param string $end
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function processBurnDataTest($executionID, $itemCounts, $begin, $end, $count)
{
global $tester;
$sets = $tester->dao->select('execution, `date` as name, `left` as value')->from(TABLE_BURN)->where('execution')->eq($executionID)->fetchAll('name');
+
$object = $this->objectModel->processBurnData($sets, $itemCounts, $begin, $end);
+
if(dao::isError())
{
$error = dao::getError();
@@ -1079,14 +1641,23 @@ class executionTest
}
}
+ /**
+ * function summary test by execution
+ *
+ * @param string $executionID
+ * @access public
+ * @return array
+ */
public function summaryTest($executionID)
{
global $tester;
$execution = $tester->dbh->query("select * from zt_project where id = $executionID")->fetch();
$executions = array($executionID => $execution->name);
$page = 'NULL';
- $tasks = $this->objectModel->getTasks('0', $executionID, $executions,'all', '0', '0', 'status,id_desc', $page);
+ $tasks = $this->objectModel->getTasks('0', $executionID, $executions,'all', '0', '0', 'status,id_desc', $page);
+
$object = $this->objectModel->summary($tasks);
+
if(dao::isError())
{
$error = dao::getError();
@@ -1098,9 +1669,18 @@ class executionTest
}
}
+ /**
+ * function isClickable test by execution
+ *
+ * @param string $execution
+ * @param string $action
+ * @access public
+ * @return array
+ */
public function isClickableTest($execution, $action)
{
$object = $this->objectModel->isClickable($execution, $action);
+
if(dao::isError())
{
$error = dao::getError();
@@ -1119,9 +1699,21 @@ class executionTest
}
}
+ /**
+ * function getDateList test by execution
+ *
+ * @param string $begin
+ * @param string $end
+ * @param string $type
+ * @param string $count
+ * @param int $interval
+ * @access public
+ * @return array
+ */
public function getDateListTest($begin, $end, $type, $count, $interval = 0)
{
$object = $this->objectModel->getDateList($begin, $end, $type, $interval);
+
if(dao::isError())
{
$error = dao::getError();
@@ -1144,9 +1736,17 @@ class executionTest
}
}
+ /**
+ * function getTotalEstimate test by execution
+ *
+ * @param string $executionID
+ * @access public
+ * @return array
+ */
public function getTotalEstimateTest($executionID)
{
$object = $this->objectModel->getTotalEstimate($executionID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -1158,11 +1758,20 @@ class executionTest
}
}
+ /**
+ * function fixOrder test by execution
+ *
+ * @access public
+ * @return array
+ */
public function fixOrderTest()
{
global $tester;
+
$this->objectModel->fixOrder();
+
$object = $tester->dao->select('id,`order`')->from(TABLE_EXECUTION)->fetchAll('id');
+
if(dao::isError())
{
$error = dao::getError();
@@ -1174,9 +1783,18 @@ class executionTest
}
}
+ /**
+ * function getKanbanTasks test by execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getKanbanTasksTest($executionID, $count)
{
$object = $this->objectModel->getKanbanTasks($executionID);
+
if(dao::isError())
{
$error = dao::getError();
@@ -1192,9 +1810,17 @@ class executionTest
}
}
+ /**
+ * function getKanbanSetting test by execution
+ *
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getKanbanSettingTest($count)
{
$object = $this->objectModel->getKanbanSetting();
+
if(dao::isError())
{
$error = dao::getError();
@@ -1210,10 +1836,18 @@ class executionTest
}
}
+ /**
+ * function getKanbanColumns test by execution
+ *
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getKanbanColumnsTest($count)
{
$kanbanSetting = $this->objectModel->getKanbanSetting();
- $object = $this->objectModel->getKanbanColumns($kanbanSetting);
+ $object = $this->objectModel->getKanbanColumns($kanbanSetting);
+
if(dao::isError())
{
$error = dao::getError();
@@ -1229,10 +1863,18 @@ class executionTest
}
}
+ /**
+ * function getKanbanStatusMap test by execution
+ *
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getKanbanStatusMapTest($count)
{
$kanbanSetting = $this->objectModel->getKanbanSetting();
- $object = $this->objectModel->getKanbanStatusMap($kanbanSetting);
+ $object = $this->objectModel->getKanbanStatusMap($kanbanSetting);
+
if(dao::isError())
{
$error = dao::getError();
@@ -1248,10 +1890,18 @@ class executionTest
}
}
+ /**
+ * function getKanbanStatusList test by execution
+ *
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getKanbanStatusListTest($count)
{
$kanbanSetting = $this->objectModel->getKanbanSetting();
- $object = $this->objectModel->getKanbanStatusList($kanbanSetting);
+ $object = $this->objectModel->getKanbanStatusList($kanbanSetting);
+
if(dao::isError())
{
$error = dao::getError();
@@ -1267,10 +1917,18 @@ class executionTest
}
}
+ /**
+ * function getKanbanColorList test by execution
+ *
+ * @param string $count
+ * @access public
+ * @return array
+ */
public function getKanbanColorListTest($count)
{
$kanbanSetting = $this->objectModel->getKanbanSetting();
- $object = $this->objectModel->getKanbanColorList($kanbanSetting);
+ $object = $this->objectModel->getKanbanColorList($kanbanSetting);
+
if(dao::isError())
{
$error = dao::getError();
@@ -1285,4 +1943,118 @@ class executionTest
return $object;
}
}
+
+ /**
+ * function buildBurnData test by execution
+ *
+ * @param string $executionID
+ * @param string $count
+ * @param string $type
+ * @access public
+ * @return array
+ */
+ public function buildBurnDataTest($executionID, $count, $type = 'noweek')
+ {
+ $begin = '2022-01-07';
+ $end = '2022-01-17';
+
+ $dateList = $this->objectModel->getDateList($begin, $end, $type, 0, $format = 'Y-m-d');
+
+ $object = $this->objectModel->buildBurnData($executionID, $dateList[0], $type);
+
+ if(dao::isError())
+ {
+ $error = dao::getError();
+ return $error;
+ }
+ elseif($count == 1)
+ {
+ return count($object);
+ }
+ else
+ {
+ return $object;
+ }
+ }
+
+ /**
+ * function getPlans test by execution
+ *
+ * @param array $products
+ * @param string $executionID
+ * @param string $count
+ * @access public
+ * @return array
+ */
+ public function getPlansTest($products, $executionID, $count)
+ {
+ $object = $this->objectModel->getPlans($products,'', $executionID);
+
+ if(dao::isError())
+ {
+ $error = dao::getError();
+ return $error;
+ }
+ elseif($count == 1)
+ {
+ return count($object);
+ }
+ else
+ {
+ return $object;
+ }
+ }
+
+ /**
+ * function getStageLinkProductPairs test by execution
+ *
+ * @param array $projects
+ * @param string $count
+ * @access public
+ * @return array
+ */
+ public function getStageLinkProductPairsTest($projects, $count)
+ {
+ $object = $this->objectModel->getStageLinkProductPairs($projects);
+
+ if(dao::isError())
+ {
+ $error = dao::getError();
+ return $error;
+ }
+ elseif($count == 1)
+ {
+ return count($object);
+ }
+ else
+ {
+ return $object;
+ }
+ }
+
+ /**
+ * function setTreePath test by executon
+ *
+ * @param string $executionID
+ * @access public
+ * @return array
+ */
+ public function setTreePathTest($executionID)
+ {
+ global $tester;
+
+ $this->objectModel->setTreePath($executionID);
+
+ $object = $tester->dao->select('id,project,parent,path')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetchAll('id');
+
+ if(dao::isError())
+ {
+ $error = dao::getError();
+ return $error;
+ }
+ else
+ {
+ return $object;
+ }
+ }
}
diff --git a/test/class/task.class.php b/test/class/task.class.php
index 7a0e7ed53b..0199f8ea2d 100644
--- a/test/class/task.class.php
+++ b/test/class/task.class.php
@@ -18,7 +18,7 @@ class taskTest
*/
public function createObject($param = array(), $executionID = '')
{
- $assignedTo = array('');
+ $assignedTo = array('');
$createFields = array('module' => '', 'story' => '', 'name' => '', 'type' => '', 'assignedTo' => $assignedTo,
'pri' => 3, 'estimate' => '', 'estStarted' => '2021-01-10', 'deadline' => '2021-03-19', 'desc' => '');
diff --git a/test/class/user.class.php b/test/class/user.class.php
index 854110c622..c74010d5b8 100644
--- a/test/class/user.class.php
+++ b/test/class/user.class.php
@@ -427,4 +427,221 @@ class userTest
return $user;
}
+
+ /**
+ * Test authorize user.
+ *
+ * @param string $account
+ * @access public
+ * @return void
+ */
+ public function authorizeTest($account)
+ {
+ $user = $this->objectModel->authorize($account);
+
+ return $user;
+ }
+
+ /**
+ * Test login user.
+ *
+ * @param object $user
+ * @access public
+ * @return void
+ */
+ public function loginTest($user)
+ {
+ $user = $this->objectModel->login($user);
+
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ return $user;
+ }
+ }
+
+ /**
+ * Test get groups by user.
+ *
+ * @param string $account
+ * @param string $password
+ * @access public
+ * @return void
+ */
+ public function getGroupsTest($account)
+ {
+ $groups = $this->objectModel->getGroups($account);
+
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ return $groups;
+ }
+ }
+
+ /**
+ * Test get groups by visions.
+ *
+ * @param string $visions
+ * @access public
+ * @return void
+ */
+ public function getGroupsByVisionsTest($visions)
+ {
+ $groups = $this->objectModel->getGroupsByVisions($visions);
+
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ return $groups;
+ }
+ }
+
+ /**
+ * Test get my objects.
+ *
+ * @param string $account
+ * @param string $type
+ * @param string $status
+ * @param string $orderBy
+ * @access public
+ * @return void
+ */
+ public function getObjectsTest($account, $type, $status, $orderBy)
+ {
+ $myObjects = $this->objectModel->getObjects($account, $type, $status, $orderBy);
+
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ return $myObjects;
+ }
+ }
+
+ /**
+ * Test get contact list.
+ *
+ * @param string $account
+ * @param string $params
+ * @access public
+ * @return void
+ */
+ public function getContactListsTest($account = '', $params = '')
+ {
+ $contacts = $this->objectModel->getContactLists($account, $params);
+
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ return $contacts;
+ }
+ }
+
+ /**
+ * Test get list by account method.
+ *
+ * @param string $account
+ * @access public
+ * @return void
+ */
+ public function getListByAccountTest($account)
+ {
+ return $this->objectModel->getListByAccount($account);
+ }
+
+ /**
+ * Test get parent stage authed users.
+ *
+ * @param int $stageID
+ * @access public
+ * @return void
+ */
+ public function getParentStageAuthedUsersTest($stageID)
+ {
+ return $this->objectModel->getParentStageAuthedUsers($stageID);
+ }
+
+ /**
+ * Test get contact list by id.
+ *
+ * @param int $listID
+ * @access public
+ * @return void
+ */
+ public function getContactListByIDTest($listID)
+ {
+ return $this->objectModel->getContactListByID($listID);
+ }
+
+ /**
+ * Test get contact user pairs.
+ *
+ * @param array $accountList
+ * @access public
+ * @return void
+ */
+ public function getContactUserPairsTest($accountList)
+ {
+ return $this->objectModel->getContactListByID($listID);
+ }
+
+ /**
+ * Test create contact list.
+ *
+ * @param string $listName
+ * @param array $userList
+ * @access public
+ * @return void
+ */
+ public function createContactListTest($listName = '', $userList = array())
+ {
+ $listID = $this->objectModel->createContactList($listName, $userList);
+
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ return $listID;
+ }
+ }
+
+ /**
+ * Test update contact list.
+ *
+ * @param int $listID
+ * @param string $listName
+ * @param array $userList
+ * @access public
+ * @return void
+ */
+ public function updateContactListTest($listID = 0, $listName = '', $userList = array())
+ {
+ $this->objectModel->updateContactList($listID, $listName, $userList);
+
+ if(dao::isError())
+ {
+ return dao::getError();
+ }
+ else
+ {
+ return $this->objectModel->getContactListByID($listID);
+ }
+ }
}
diff --git a/test/data/execution.yaml b/test/data/execution.yaml
index 35587270c9..33cc7708a3 100644
--- a/test/data/execution.yaml
+++ b/test/data/execution.yaml
@@ -38,11 +38,11 @@ fields:
- field: path2
prefix: ","
range: 101-700
- - field: path3
- range: []
postfix: ","
- field: acl
range: open{4},private{4}
+ - field: openedVersion
+ range: "16.5"
- field: whitelist
froms:
- from: common.user.v1.yaml
diff --git a/test/data/executionson.yaml b/test/data/executionson.yaml
index 49ec1af958..2384886896 100644
--- a/test/data/executionson.yaml
+++ b/test/data/executionson.yaml
@@ -37,10 +37,10 @@ fields:
range: 41-70
- field: path2
prefix: ","
+ postfix: ","
range: 131-160
- field: path6
- prefix: ","
- range: [701-730]
+ range: 701-730
postfix: ","
- field: acl
range: open{4},private{4}
@@ -64,6 +64,8 @@ fields:
prefix: ""
postfix: ""
format: ""
+ - field: openedVersion
+ range: "16.5"
- field: whitelist
froms:
- from: common.user.v1.yaml
diff --git a/test/data/program.yaml b/test/data/program.yaml
index 540219d041..ee09f51582 100644
--- a/test/data/program.yaml
+++ b/test/data/program.yaml
@@ -42,6 +42,8 @@ fields:
prefix: "项目集描述"
- field: acl
range: open{4},private{4}
+ - field: openedVersion
+ range: "16.5"
- field: whitelist
froms:
- from: common.user.v1.yaml
diff --git a/test/data/project.yaml b/test/data/project.yaml
index acebfb2f65..8f42782bf7 100644
--- a/test/data/project.yaml
+++ b/test/data/project.yaml
@@ -79,5 +79,7 @@ fields:
range: open,private,custom
- field: order
range: 5-10000:5
+ - field: openedVersion
+ range: "16.5"
- field: deleted
range: 0
diff --git a/test/data/usercontact.yaml b/test/data/usercontact.yaml
new file mode 100644
index 0000000000..737ab3898e
--- /dev/null
+++ b/test/data/usercontact.yaml
@@ -0,0 +1,41 @@
+title: table zt_usercontact
+desc: "用户联系人"
+author: automated export
+version: "1.0"
+fields:
+ - field: id
+ note: "ID"
+ range: 1-10000
+ prefix: ""
+ postfix: ""
+ loop: 0
+ format: ""
+ - field: account
+ note: "用户名"
+ fields:
+ - field: account1
+ range: user,dev,test,admin
+ - field: account2
+ range: 1-20,1-20,1-20,""
+ prefix: ""
+ postfix: ""
+ format: ""
+ - field: listName
+ note: "列表名称"
+ range: 1-10000
+ prefix: "联系人列表"
+ postfix: ""
+ format: ""
+ - field: userList
+ note: "用户列表"
+ fields:
+ - field: userList1
+ range: user,dev,test
+ - field: userList2
+ range: 20-30,20-30,20-30
+ postfix: ","
+ - field: userList3
+ range: user,dev,test
+ - field: userList4
+ range: 40-50,40-5040-50
+ format: ""
diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php
index 507db40578..182ba933f0 100644
--- a/test/data/zentao/config.php
+++ b/test/data/zentao/config.php
@@ -1,13 +1,14 @@
company = array('rows' => 1, 'extends' => array('company'));
-$builder->user = array('rows' => 1000, 'extends' => array('user'));
-$builder->todo = array('rows' => 2000, 'extends' => array('todo'));
-$builder->effort = array('rows' => 100, 'extends' => array('effort'));
-$builder->usergroup = array('rows' => 600, 'extends' => array('usergroup'));
-$builder->dept = array('rows' => 100, 'extends' => array('dept'));
-$builder->action = array('rows' => 100, 'extends' => array('action'));
+$builder->company = array('rows' => 1, 'extends' => array('company'));
+$builder->user = array('rows' => 1000, 'extends' => array('user'));
+$builder->todo = array('rows' => 2000, 'extends' => array('todo'));
+$builder->effort = array('rows' => 100, 'extends' => array('effort'));
+$builder->usergroup = array('rows' => 600, 'extends' => array('usergroup'));
+$builder->usercontact = array('rows' => 61, 'extends' => array('usercontact'));
+$builder->dept = array('rows' => 100, 'extends' => array('dept'));
+$builder->action = array('rows' => 100, 'extends' => array('action'));
$builder->program = array('rows' => 10, 'extends' => array('project', 'program'));
$builder->project = array('rows' => 90, 'extends' => array('project', 'project'));
diff --git a/test/data/zentao/processor.php b/test/data/zentao/processor.php
index 26f11f7eb8..bf9a124e6e 100644
--- a/test/data/zentao/processor.php
+++ b/test/data/zentao/processor.php
@@ -89,6 +89,8 @@ class Processor
$users['user2'] = array('account' => 'noprogram1', 'realname' => '不在项目集1用户');
foreach($users as $account => $user) $this->dao->update(TABLE_USER)->data($user)->where('account')->eq($account)->exec();
+
+ $this->dao->update(TABLE_USERCONTACT)->set('account')->eq('admin')->where('account')->like('admin%')->exec();
}
/**
diff --git a/test/model/bug/batchcreate.php b/test/model/bug/batchcreate.php
new file mode 100755
index 0000000000..7b0a35f94f
--- /dev/null
+++ b/test/model/bug/batchcreate.php
@@ -0,0 +1,48 @@
+#!/usr/bin/env php
+batchCreate();
+cid=1
+pid=1
+
+测试正常批量创建bug1 >> 批量bug一,trunk,3,codeerror,3,3,1,101
+测试正常批量创建bug2 >> 批量bug五,trunk,codeerror,3,3,1,101
+测试正常批量创建bug3 >> 批量bug九,1,config,3,3,1,0
+测试短时间内重复批量创建bug >> 0
+测试异常创建bug >>