diff --git a/module/doc/model.php b/module/doc/model.php
index 6c1ce17a86..bd6c10c81c 100644
--- a/module/doc/model.php
+++ b/module/doc/model.php
@@ -1196,7 +1196,7 @@ class docModel extends model
{
$libs = array();
$docLibs = array();
- if($type == 'product' or $type == 'extension')
+ if($type == 'product' or $type == 'execution')
{
$nonzeroLibs = array();
if(strpos($this->config->doc->custom->showLibs, 'zero') === false)
diff --git a/test/class/datatable.class.php b/test/class/datatable.class.php
new file mode 100644
index 0000000000..7e354de529
--- /dev/null
+++ b/test/class/datatable.class.php
@@ -0,0 +1,44 @@
+objectModel = $tester->loadModel('datatable');
+ }
+
+ public function getFieldListTest($module, $method)
+ {
+ $module = zget($this->objectModel->config->datatable->moduleAlias, "$module-$method", $module);
+ $result = $this->objectModel->getFieldList($module);
+ return $result;
+ }
+
+ public function getSettingTest($module, $method)
+ {
+ $this->objectModel->app->methodName = $method;
+ $result = $this->objectModel->getSetting($module);
+ return $result;
+ }
+
+ public function printHeadTest($data)
+ {
+ ob_start();
+ $this->objectModel->printHead($data['cols'], $data['orderBy'], $data['vars'], $data['checkBox']);
+ $head = ob_get_clean();
+
+ $isTh = strpos($head, '
objectModel->setFixedFieldWidth($setting);
+ return $result;
+ }
+}
diff --git a/test/class/doc.class.php b/test/class/doc.class.php
index 143e7413aa..c8dc0af4d4 100644
--- a/test/class/doc.class.php
+++ b/test/class/doc.class.php
@@ -298,6 +298,13 @@ class docTest
return $objects;
}
+ /**
+ * Test stat module and document counts of lib.
+ *
+ * @param array $idList
+ * @access public
+ * @return array
+ */
public function statLibCountsTest($idList)
{
$objects = $this->objectModel->statLibCounts($idList);
@@ -307,49 +314,125 @@ class docTest
return $objects;
}
+ /**
+ * Test get lib files.
+ *
+ * @param string $type
+ * @param int $objectID
+ * @param string $orderBy
+ * @param object $pager
+ * @access public
+ * @return string
+ */
public function getLibFilesTest($type, $objectID, $orderBy, $pager = null)
{
$objects = $this->objectModel->getLibFiles($type, $objectID, $orderBy, $pager = null);
if(dao::isError()) return dao::getError();
- return $objects;
+ $titles = '';
+ foreach($objects as $object)
+ {
+ $titles .= "$object->title,";
+ }
+ $titles = trim($titles, ',');
+ return $titles;
}
- public function getFileSourcePairsTest($files)
+ /**
+ * Test get file source pairs.
+ *
+ * @param array $files
+ * @access public
+ * @return void
+ */
+ public function getFileSourcePairsTest($type, $objectID)
{
+ $files = $this->objectModel->getLibFiles($type, $objectID, 't1.id_desc', $pager = null);
+
$objects = $this->objectModel->getFileSourcePairs($files);
if(dao::isError()) return dao::getError();
- return $objects;
+ $counts = '';
+ foreach($objects as $type => $items)
+ {
+ $counts .= "$type:" . count($items) .';';
+ }
+ return $counts;
}
- public function getFileIconTest($files)
+ /**
+ * Test get file icon.
+ *
+ * @param string $type
+ * @param int $objectID
+ * @access public
+ * @return string
+ */
+ public function getFileIconTest($type, $objectID)
{
+ $files = $this->objectModel->getLibFiles($type, $objectID, 't1.id_desc', $pager = null);
+
$objects = $this->objectModel->getFileIcon($files);
if(dao::isError()) return dao::getError();
- return $objects;
+ $icons = '';
+ foreach($objects as $object)
+ {
+ preg_match("/icon-[^']*/", $object, $matches);
+ $icons .= "$matches[0] ";
+ }
+ $icons = trim($icons);
+ return $icons;
}
+ /**
+ * Test get doc tree.
+ *
+ * @param int $libID
+ * @access public
+ * @return string
+ */
public function getDocTreeTest($libID)
{
$objects = $this->objectModel->getDocTree($libID);
if(dao::isError()) return dao::getError();
- return $objects;
+ $names = '';
+ foreach($objects as $object)
+ {
+ $names .= "$object->name:";
+ foreach($object->children as $children) $names .= (isset($children->name) ? $children->name : $children->title) . ",";
+ $names = trim($names, ',');
+ $names .= ";";
+ }
+ return $names;
}
+ /**
+ * Test fill docs in tree.
+ *
+ * @param object $node
+ * @param int $libID
+ * @access public
+ * @return object
+ */
public function fillDocsInTreeTest($node, $libID)
{
- $objects = $this->objectModel->fillDocsInTree($node, $libID);
+ $object = $this->objectModel->fillDocsInTree($node, $libID);
if(dao::isError()) return dao::getError();
- return $objects;
+ $docsCounts = "$object->name:$object->docsCount;";
+ foreach($object->children as $children)
+ {
+ if(isset($children->type) and $children->type == 'doc') continue;
+ $docsCounts .= "$children->name:$children->docsCount;";
+ }
+ return $docsCounts;
}
public function getProductCrumbTest($productID, $executionID = 0)
@@ -361,13 +444,21 @@ class docTest
return $objects;
}
+ /**
+ * Test set lib users.
+ *
+ * @param string $type
+ * @param int $objectID
+ * @access public
+ * @return array
+ */
public function setLibUsersTest($type, $objectID)
{
$objects = $this->objectModel->setLibUsers($type, $objectID);
if(dao::isError()) return dao::getError();
- return $objects;
+ return implode($objects, ',');
}
public function getLibIdListByProjectTest($projectID = 0)
@@ -379,6 +470,12 @@ class docTest
return $objects;
}
+ /**
+ * Get statistic information.
+ *
+ * @access public
+ * @return object
+ */
public function getStatisticInfoTest()
{
$objects = $this->objectModel->getStatisticInfo();
@@ -388,6 +485,14 @@ class docTest
return $objects;
}
+ /**
+ * Get the previous and next doc.
+ *
+ * @param int $docID
+ * @param int $libID
+ * @access public
+ * @return object
+ */
public function getPreAndNextDocTest($docID, $libID)
{
$objects = $this->objectModel->getPreAndNextDoc($docID, $libID);
diff --git a/test/class/git.class.php b/test/class/git.class.php
index 6478e17bb5..d667572f9c 100644
--- a/test/class/git.class.php
+++ b/test/class/git.class.php
@@ -10,17 +10,6 @@ class gitTest
$this->gitModel = $this->tester->loadModel('git');
}
- /**
- * Run
- *
- * @access public
- * @return void
- */
- public function run()
- {
- return $this->gitModel->run();
- }
-
/**
* Update commit.
*
@@ -28,7 +17,7 @@ class gitTest
* @param array $commentGroup
* @param bool $printLog
* @access public
- * @return string
+ * @return bool
*/
public function updateCommit($repo)
{
@@ -44,7 +33,7 @@ class gitTest
* Set the repos.
*
* @access public
- * @return mixed
+ * @return object
*/
public function setRepos()
{
@@ -57,7 +46,7 @@ class gitTest
* Get repos.
*
* @access public
- * @return array
+ * @return string
*/
public function getRepos()
{
@@ -70,7 +59,7 @@ class gitTest
*
* @param object $repo
* @access public
- * @return bool
+ * @return object
*/
public function setRepo($repo)
{
@@ -91,7 +80,7 @@ class gitTest
*
* @param object $repo
* @access public
- * @return mixed
+ * @return int
*/
public function getRepoTags($repo)
{
@@ -104,9 +93,8 @@ class gitTest
* Get repo logs.
*
* @param object $repo
- * @param int $fromRevision
* @access public
- * @return array
+ * @return int
*/
public function getRepoLogs($repo)
{
diff --git a/test/class/jenkins.class.php b/test/class/jenkins.class.php
new file mode 100644
index 0000000000..7d75f0c5f1
--- /dev/null
+++ b/test/class/jenkins.class.php
@@ -0,0 +1,102 @@
+tester = $tester;
+ $this->jenkins = $this->tester->loadModel('jenkins');
+ }
+
+ /**
+ * Get by id.
+ *
+ * @param int $id
+ * @access public
+ * @return object
+ */
+ public function getByID($id)
+ {
+ $jenkins = $this->jenkins->getByID($id);
+ if(empty($jenkins)) return 0;
+ return $jenkins;
+ }
+
+ /**
+ * Get jenkins list.
+ *
+ * @param string $orderBy
+ * @access public
+ * @return object
+ */
+ public function getList($orderBy = 'id_desc')
+ {
+ $jenkins = $this->jenkins->getList($orderBy);
+ if(empty($jenkins)) return 0;
+ return array_shift($jenkins);
+ }
+
+ /**
+ * Get jenkins pairs
+ *
+ * @return string
+ */
+ public function getPairs()
+ {
+ $pairs = $this->jenkins->getPairs();
+ return key($pairs);
+ }
+
+ /**
+ * Get jenkins tasks.
+ *
+ * @param int $id
+ * @access public
+ * @return array
+ */
+ public function getTasks($id)
+ {
+ $tasks = $this->jenkins->getTasks($id);
+ if(empty($tasks)) return 0;
+ return $tasks;
+ }
+
+ /**
+ * Create a jenkins.
+ *
+ * @access public
+ * @return object|string
+ */
+ public function create()
+ {
+ $jenkinsID = $this->jenkins->create();
+ if(dao::isError())
+ {
+ $errors = dao::getError();
+ return key($errors);
+ }
+
+ return $this->jenkins->getById($jenkinsID);
+ }
+
+ /**
+ * Update a jenkins.
+ *
+ * @param int $id
+ * @access public
+ * @return object|string
+ */
+ public function update($id)
+ {
+ $this->jenkins->update($id);
+ if(dao::isError())
+ {
+ $errors = dao::getError();
+ return key($errors);
+ }
+
+ return $this->jenkins->getById($id);
+ }
+}
diff --git a/test/class/pipeline.class.php b/test/class/pipeline.class.php
new file mode 100644
index 0000000000..2fd000a20b
--- /dev/null
+++ b/test/class/pipeline.class.php
@@ -0,0 +1,126 @@
+objectModel = $tester->loadModel('pipeline');
+ }
+
+ /**
+ * Get a pipeline by id.
+ *
+ * @param int $id
+ * @access public
+ * @return object
+ */
+ public function getByIDTest($id)
+ {
+ $objects = $this->objectModel->getByID($id);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Get pipeline list.
+ *
+ * @param string $type jenkins|gitlab
+ * @param string $orderBy
+ * @param object $pager
+ * @access public
+ * @return array
+ */
+ public function getListTest($type = 'jenkins', $orderBy = 'id_desc', $pager = null)
+ {
+ $objects = $this->objectModel->getList($type, $orderBy, $pager);
+
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Get pipeline pairs
+ *
+ * @param int $data
+ * @access public
+ * @return array
+ */
+ public function getPairs($data)
+ {
+ $objects = $this->objectModel->getPairs($data['type']);
+
+ if(empty($objects)) return '没有获取到数据';
+ if(isset($data['id'])) return $objects[$data['id']];
+ if(dao::isError()) return dao::getError();
+
+ return $objects;
+ }
+
+ /**
+ * Create a pipeline.
+ *
+ * @param int $type
+ * @param int $param
+ * @access public
+ * @return void
+ */
+ public function createTest($type, $param)
+ {
+ foreach($param as $k => $v) $_POST[$k] = $v;
+ $objects = $this->objectModel->create($type);
+ unset($_POST);
+
+ if(dao::isError()) return dao::getError();
+
+ $objects = $this->objectModel->getById($objects);
+
+ return $objects;
+ }
+
+ /**
+ * Update a pipeline.
+ *
+ * @param int $id
+ * @access public
+ * @return bool
+ */
+ public function updateTest($id)
+ {
+ $objects = $this->objectModel->update($id);
+
+ if(dao::isError()) return dao::getError();
+
+ $objects = $this->objectModel->getByID($id);
+
+ return $objects;
+ }
+
+ /**
+ * Delete one record.
+ *
+ * @param string $id the id to be deleted
+ * @param string $object the action object
+ * @access public
+ * @return int
+ */
+ public function deleteTest($id, $object = 'gitlab')
+ {
+ $objects = $this->objectModel->delete($id, $object = 'gitlab');
+
+ if(dao::isError()) return dao::getError();
+
+ $objects = $this->objectModel->getById($id);
+
+ return $objects;
+ }
+}
diff --git a/test/class/setting.class.php b/test/class/setting.class.php
index 7c6639ea28..b87b6ebaaf 100644
--- a/test/class/setting.class.php
+++ b/test/class/setting.class.php
@@ -7,15 +7,30 @@ class settingTest
$this->objectModel = $tester->loadModel('setting');
}
+ /**
+ * Get value of an item.
+ *
+ * @param string $paramString see parseItemParam();
+ * @access public
+ * @return bool
+ */
public function getItemTest($paramString)
{
$objects = $this->objectModel->getItem($paramString);
if(dao::isError()) return dao::getError();
- return $objects;
+ if($objects or $objects === 0 or $objects === '0') return true;
+ return false;
}
+ /**
+ * Get some items.
+ *
+ * @param string $paramString see parseItemParam();
+ * @access public
+ * @return array|string
+ */
public function getItemsTest($paramString)
{
$objects = $this->objectModel->getItems($paramString);
@@ -25,33 +40,81 @@ class settingTest
return $objects;
}
+ /**
+ * Set value of an item.
+ *
+ * @param string $path system.common.global.sn | system.common.sn | system.common.global.sn@rnd
+ * @param string $value
+ * @access public
+ * @return misc
+ */
public function setItemTest($path, $value = '')
{
- $objects = $this->objectModel->setItem($path, $value = '');
+ $this->objectModel->setItem($path, $value);
if(dao::isError()) return dao::getError();
+ /* Determine vision of config item. */
+ $pathVision = explode('@', $path);
+ $vision = isset($pathVision[1]) ? $pathVision[1] : '';
+ $path = $pathVision[0];
+ $level = substr_count($path, '.');
+ $section = '';
+
+ if($level <= 1) return false;
+ if($level == 2) list($owner, $module, $key) = explode('.', $path);
+ if($level == 3) list($owner, $module, $section, $key) = explode('.', $path);
+ $paramString = "vision=$vision&owner=$owner&module=$module§ion=$section&key=$key";
+ $objects = $this->objectModel->getItem($paramString);
+
return $objects;
}
+ /**
+ * Batch set items, the example:
+ *
+ * $path = 'system.mail';
+ * $items->turnon = true;
+ * $items->smtp->host = 'localhost';
+ *
+ * @param string $path like system.mail
+ * @param array|object $items the items array or object, can be mixed by one level or two levels.
+ * @access public
+ * @return bool|string
+ */
public function setItemsTest($path, $items)
{
- $objects = $this->objectModel->setItems($path, $items);
+ $result = $this->objectModel->setItems($path, $items);
if(dao::isError()) return dao::getError();
- return $objects;
+ return $result;
}
+ /**
+ * Delete items.
+ *
+ * @param string $paramString see parseItemParam();
+ * @access public
+ * @return misc
+ */
public function deleteItemsTest($paramString)
{
- $objects = $this->objectModel->deleteItems($paramString);
+ $this->objectModel->deleteItems($paramString);
if(dao::isError()) return dao::getError();
- return $objects;
+ $object = $this->getItemTest($paramString);
+ return $object;
}
+ /**
+ * Parse the param string for select or delete items.
+ *
+ * @param string $paramString owner=xxx&key=sn and so on.
+ * @access public
+ * @return array
+ */
public function parseItemParamTest($paramString)
{
$objects = $this->objectModel->parseItemParam($paramString);
diff --git a/test/data/doc.yaml b/test/data/doc.yaml
index f35cad144e..5219381342 100644
--- a/test/data/doc.yaml
+++ b/test/data/doc.yaml
@@ -78,7 +78,7 @@ fields:
format: ""
- field: type
note: "文档类型"
- range: text,markdown
+ range: text,markdown,url
prefix: ""
postfix: ""
loop: 0
diff --git a/test/data/doccontent.yaml b/test/data/doccontent.yaml
index dd58eec311..0a9d65af62 100644
--- a/test/data/doccontent.yaml
+++ b/test/data/doccontent.yaml
@@ -33,8 +33,11 @@ fields:
format: ""
- field: content
note: "文档正文"
- range: 1-10000
- prefix: "文档正文"
+ fields:
+ - field: content1
+ range: 文档正文,文档正文,www.baidu.com
+ - field: content2
+ range: 1-2,[]
postfix: ""
loop: 0
format: ""
@@ -47,7 +50,7 @@ fields:
format: ""
- field: type
note: "文档类型"
- range: text,markdown
+ range: text,markdown,html
prefix: ""
postfix: ""
loop: 0
diff --git a/test/model/datatable/getFieldList.php b/test/model/datatable/getFieldList.php
new file mode 100644
index 0000000000..ef6183a769
--- /dev/null
+++ b/test/model/datatable/getFieldList.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+> ID
+获取项目模块browse方法自定义列 >> 项目名称
+获取执行模块task方法自定义列 >> 70
+获取测试用例模块browse方法自定义列 >> auto
+
+*/
+
+$datatable = new datatableTest();
+r($datatable->getFieldListTest('product', 'browse')) && p('id:title') && e('ID'); //获取产品模块browse方法自定义列
+r($datatable->getFieldListTest('project', 'browse')) && p('name:title') && e('项目名称'); //获取项目模块browse方法自定义列
+r($datatable->getFieldListTest('execution', 'task')) && p('id:width') && e('70'); //获取执行模块task方法自定义列
+r($datatable->getFieldListTest('testcase', 'browse')) && p('title:width') && e('auto'); //获取测试用例模块browse方法自定义列
diff --git a/test/model/datatable/getSetting.php b/test/model/datatable/getSetting.php
new file mode 100644
index 0000000000..dcb3c87da8
--- /dev/null
+++ b/test/model/datatable/getSetting.php
@@ -0,0 +1,24 @@
+#!/usr/bin/env php
+> ID
+获取项目模块browse方法设置 >> 项目名称
+获取执行模块task方法设置 >> 70
+获取测试用例模块browse方法设置 >> auto
+
+*/
+
+$datatable = new datatableTest();
+r($datatable->getSettingTest('product', 'browse')) && p('0:title') && e('ID'); //获取产品模块browse方法设置
+r($datatable->getSettingTest('project', 'browse')) && p('1:title') && e('项目名称'); //获取项目模块browse方法设置
+r($datatable->getSettingTest('execution', 'task')) && p('0:width') && e('70'); //获取执行模块task方法设置
+r($datatable->getSettingTest('testcase', 'browse')) && p('2:width') && e('auto'); //获取测试用例模块browse方法设置
diff --git a/test/model/datatable/printHead.php b/test/model/datatable/printHead.php
new file mode 100644
index 0000000000..e48162d59f
--- /dev/null
+++ b/test/model/datatable/printHead.php
@@ -0,0 +1,31 @@
+#!/usr/bin/env php
+> 1
+获取产品模块browse方法头部html带排序 >> 1
+获取产品模块browse方法头部html带参数 >> 1
+获取产品模块browse方法头部html带checkbox >> 1
+
+*/
+
+$datatable = new datatableTest();
+$productSetting = $datatable->getSettingTest('product', 'browse');
+
+$data = array('cols' => $productSetting[0], 'orderBy' => '', 'vars' => '', 'checkBox' => false);
+$data_order = array('cols' => $productSetting[0], 'orderBy' => 'id_asc', 'vars' => '', 'checkBox' => false);
+$data_vars = array('cols' => $productSetting[0], 'orderBy' => 'id_asc', 'vars' => 'productID=1', 'checkBox' => false);
+$data_check = array('cols' => $productSetting[0], 'orderBy' => 'id_asc', 'vars' => 'productID=1', 'checkBox' => true);
+
+r($datatable->printHeadTest($data)) && p() && e(1); //获取产品模块browse方法头部html
+r($datatable->printHeadTest($data_order)) && p() && e(1); //获取产品模块browse方法头部html带排序
+r($datatable->printHeadTest($data_vars)) && p() && e(1); //获取产品模块browse方法头部html带参数
+r($datatable->printHeadTest($data_check)) && p() && e(1); //获取产品模块browse方法头部html带checkbox
diff --git a/test/model/datatable/setFixedFieldWidth.php b/test/model/datatable/setFixedFieldWidth.php
new file mode 100644
index 0000000000..f615831913
--- /dev/null
+++ b/test/model/datatable/setFixedFieldWidth.php
@@ -0,0 +1,29 @@
+#!/usr/bin/env php
+> 550
+获取项目模块browse方法设置宽度 >> 180
+获取执行模块task方法设置宽度 >> 550
+获取测试用例模块browse方法设置宽度 >> 150
+
+*/
+
+$datatable = new datatableTest();
+$productSetting = $datatable->getSettingTest('product', 'browse');
+$projectSetting = $datatable->getSettingTest('project', 'browse');
+$executionSetting = $datatable->getSettingTest('execution', 'task');
+$testcaseSetting = $datatable->getSettingTest('testcase', 'browse');
+
+r($datatable->setFixedFieldWidthTest($productSetting)) && p('leftWidth') && e('550'); //获取产品模块browse方法设置宽度
+r($datatable->setFixedFieldWidthTest($projectSetting)) && p('rightWidth') && e('180'); //获取项目模块browse方法设置宽度
+r($datatable->setFixedFieldWidthTest($executionSetting)) && p('leftWidth') && e('550'); //获取执行模块browse方法设置宽度
+r($datatable->setFixedFieldWidthTest($testcaseSetting)) && p('rightWidth') && e('150'); //获取测试用例模块browse方法设置宽度
diff --git a/test/model/doc/filldocsintree.php b/test/model/doc/filldocsintree.php
index 28aa89df22..9eb6fdeb5a 100644
--- a/test/model/doc/filldocsintree.php
+++ b/test/model/doc/filldocsintree.php
@@ -10,10 +10,26 @@ title=测试 docModel->fillDocsInTree();
cid=1
pid=1
-
+测试填充libID 1 文档树第一个节点的文档 >> 目录1:3;子目录1:0;子目录2:0;
+测试填充libID 2 文档树第一个节点的文档 >> 目录2:2;子目录3:0;子目录4:0;
+测试填充libID 3 文档树第一个节点的文档 >> 目录3:2;子目录5:0;子目录6:0;
+测试填充libID 11 文档树第一个节点的文档 >> 目录11:2;子目录21:0;子目录22:0;
+测试填充libID 12 文档树第一个节点的文档 >> 目录12:2;子目录23:0;子目录24:0;
*/
+$libID = array(1, 2, 3, 11, 12);
+
+global $tester;
+$fullTree1 = $tester->loadModel('tree')->getTreeStructure($libID[0], 'doc');
+$fullTree2 = $tester->loadModel('tree')->getTreeStructure($libID[1], 'doc');
+$fullTree3 = $tester->loadModel('tree')->getTreeStructure($libID[2], 'doc');
+$fullTree4 = $tester->loadModel('tree')->getTreeStructure($libID[3], 'doc');
+$fullTree5 = $tester->loadModel('tree')->getTreeStructure($libID[4], 'doc');
$doc = new docTest();
-r($doc->fillDocsInTreeTest()) && p() && e();
\ No newline at end of file
+r($doc->fillDocsInTreeTest($fullTree1[0], $libID[0])) && p() && e('目录1:3;子目录1:0;子目录2:0;'); // 测试填充libID 1 文档树第一个节点的文档
+r($doc->fillDocsInTreeTest($fullTree2[0], $libID[1])) && p() && e('目录2:2;子目录3:0;子目录4:0;'); // 测试填充libID 2 文档树第一个节点的文档
+r($doc->fillDocsInTreeTest($fullTree3[0], $libID[2])) && p() && e('目录3:2;子目录5:0;子目录6:0;'); // 测试填充libID 3 文档树第一个节点的文档
+r($doc->fillDocsInTreeTest($fullTree4[0], $libID[3])) && p() && e('目录11:2;子目录21:0;子目录22:0;'); // 测试填充libID 11 文档树第一个节点的文档
+r($doc->fillDocsInTreeTest($fullTree5[0], $libID[4])) && p() && e('目录12:2;子目录23:0;子目录24:0;'); // 测试填充libID 12 文档树第一个节点的文档
\ No newline at end of file
diff --git a/test/model/doc/getdoctree.php b/test/model/doc/getdoctree.php
index 247c9b34ec..c17a168044 100644
--- a/test/model/doc/getdoctree.php
+++ b/test/model/doc/getdoctree.php
@@ -10,10 +10,26 @@ title=测试 docModel->getDocTree();
cid=1
pid=1
-
+获取libID 1 的文档树 >> 目录1:文档标题1,子目录1,子目录2;
+获取libID 3 的文档树 >> 目录3:子目录5,子目录6;
+获取libID 8 的文档树 >> 目录8:子目录15,子目录16;
+获取libID 20 的文档树 >> 目录20:子目录39,子目录40;
+获取libID 101 的文档树 >> 0
+获取libID 191 的文档树 >> 0
+获取libID 821 的文档树 >> 0
+获取libID 901 的文档树 >> 0
*/
+$libID = array(1, 3, 8, 20, 101, 191, 821, 901);
+
$doc = new docTest();
-r($doc->getDocTreeTest()) && p() && e();
\ No newline at end of file
+r($doc->getDocTreeTest($libID[0])) && p() && e('目录1:文档标题1,子目录1,子目录2;'); // 获取libID 1 的文档树
+r($doc->getDocTreeTest($libID[1])) && p() && e('目录3:子目录5,子目录6;'); // 获取libID 3 的文档树
+r($doc->getDocTreeTest($libID[2])) && p() && e('目录8:子目录15,子目录16;'); // 获取libID 8 的文档树
+r($doc->getDocTreeTest($libID[3])) && p() && e('目录20:子目录39,子目录40;'); // 获取libID 20 的文档树
+r($doc->getDocTreeTest($libID[4])) && p() && e('0'); // 获取libID 101 的文档树
+r($doc->getDocTreeTest($libID[5])) && p() && e('0'); // 获取libID 191 的文档树
+r($doc->getDocTreeTest($libID[6])) && p() && e('0'); // 获取libID 821 的文档树
+r($doc->getDocTreeTest($libID[7])) && p() && e('0'); // 获取libID 901 的文档树
\ No newline at end of file
diff --git a/test/model/doc/getfileicon.php b/test/model/doc/getfileicon.php
index 7dc8bf3819..6b90b210d0 100644
--- a/test/model/doc/getfileicon.php
+++ b/test/model/doc/getfileicon.php
@@ -10,10 +10,23 @@ title=测试 docModel->getFileIcon();
cid=1
pid=1
-
+测试获取 产品 1 的文件icon >> icon-file icon-file-word icon-file-word
+测试获取 产品 2 的文件icon >> 0
+测试获取 项目 11 的文件icon >> icon-file-word icon-file-word icon-file-text
+测试获取 项目 12 的文件icon >> 0
+测试获取 执行 101 的文件icon >> icon-file icon-file-word icon-file-text
+测试获取 执行 102 的文件icon >> 0
*/
+$type = array('product', 'project', 'execution');
+$objectID = array(1, 2, 11, 12, 101, 102);
+
$doc = new docTest();
-r($doc->getFileIconTest()) && p() && e();
\ No newline at end of file
+r($doc->getFileIconTest($type[0], $objectID[0])) && p() && e('icon-file icon-file-word icon-file-word'); // 测试获取 产品 1 的文件icon
+r($doc->getFileIconTest($type[0], $objectID[1])) && p() && e('0'); // 测试获取 产品 2 的文件icon
+r($doc->getFileIconTest($type[1], $objectID[2])) && p() && e('icon-file-word icon-file-word icon-file-text'); // 测试获取 项目 11 的文件icon
+r($doc->getFileIconTest($type[1], $objectID[3])) && p() && e('0'); // 测试获取 项目 12 的文件icon
+r($doc->getFileIconTest($type[2], $objectID[4])) && p() && e('icon-file icon-file-word icon-file-text'); // 测试获取 执行 101 的文件icon
+r($doc->getFileIconTest($type[2], $objectID[5])) && p() && e('0'); // 测试获取 执行 102 的文件icon
\ No newline at end of file
diff --git a/test/model/doc/getfilesourcepairs.php b/test/model/doc/getfilesourcepairs.php
index f4f4279d42..d47fc8a828 100644
--- a/test/model/doc/getfilesourcepairs.php
+++ b/test/model/doc/getfilesourcepairs.php
@@ -10,10 +10,23 @@ title=测试 docModel->getFileSourcePairs();
cid=1
pid=1
-
+测试获取 产品 1 的文件类型分组 >> testcase:1;story:1;bug:1;
+测试获取 产品 2 的文件类型分组 >> 0
+测试获取 项目 11 的文件类型分组 >> task:2;bug:1;
+测试获取 项目 12 的文件类型分组 >> 0
+测试获取 执行 101 的文件类型分组 >> testcase:1;bug:1;task:1;
+测试获取 执行 102 的文件类型分组 >> 0
*/
+$type = array('product', 'project', 'execution');
+$objectID = array(1, 2, 11, 12, 101, 102);
+
$doc = new docTest();
-r($doc->getFileSourcePairsTest()) && p() && e();
\ No newline at end of file
+r($doc->getFileSourcePairsTest($type[0], $objectID[0])) && p() && e('testcase:1;story:1;bug:1;'); // 测试获取 产品 1 的文件类型分组
+r($doc->getFileSourcePairsTest($type[0], $objectID[1])) && p() && e('0'); // 测试获取 产品 2 的文件类型分组
+r($doc->getFileSourcePairsTest($type[1], $objectID[2])) && p() && e('task:2;bug:1;'); // 测试获取 项目 11 的文件类型分组
+r($doc->getFileSourcePairsTest($type[1], $objectID[3])) && p() && e('0'); // 测试获取 项目 12 的文件类型分组
+r($doc->getFileSourcePairsTest($type[2], $objectID[4])) && p() && e('testcase:1;bug:1;task:1;'); // 测试获取 执行 101 的文件类型分组
+r($doc->getFileSourcePairsTest($type[2], $objectID[5])) && p() && e('0'); // 测试获取 执行 102 的文件类型分组
\ No newline at end of file
diff --git a/test/model/doc/getlibfiles.php b/test/model/doc/getlibfiles.php
index 9c9b825e20..d74c3bee76 100644
--- a/test/model/doc/getlibfiles.php
+++ b/test/model/doc/getlibfiles.php
@@ -10,10 +10,36 @@ title=测试 docModel->getLibFiles();
cid=1
pid=1
-
+获取 产品 1 下文件库id倒序排列的文件 >> 这是一个文件名称4.dot,这是一个文件名称3.docx,这是一个文件名称2.doc
+获取 产品 2 下文件库id倒序排列的文件 >> 0
+获取 项目 11 下文件库id倒序排列的文件 >> 这是一个文件名称91.docx,这是一个文件名称2.doc,这是一个文件名称1.txt
+获取 项目 12 下文件库id倒序排列的文件 >> 0
+获取 执行 101 下文件库id倒序排列的文件 >> 这是一个文件名称4.dot,这是一个文件名称2.doc,这是一个文件名称1.txt
+获取 执行 102 下文件库id倒序排列的文件 >> 0
+获取 产品 1 下文件库id正序排列的文件 >> 这是一个文件名称2.doc,这是一个文件名称3.docx,这是一个文件名称4.dot
+获取 产品 2 下文件库id正序排列的文件 >> 0
+获取 项目 11 下文件库id正序排列的文件 >> 这是一个文件名称1.txt,这是一个文件名称2.doc,这是一个文件名称91.docx
+获取 项目 12 下文件库id正序排列的文件 >> 0
+获取 执行 101 下文件库id正序排列的文件 >> 这是一个文件名称1.txt,这是一个文件名称2.doc,这是一个文件名称4.dot
+获取 执行 102 下文件库id正序排列的文件 >> 0
*/
+$type = array('product', 'project', 'execution');
+$objectID = array(1, 2, 11, 12, 101, 102);
+$orderBy = array('t1.id_desc', 't1.id_asc');
+
$doc = new docTest();
-r($doc->getLibFilesTest()) && p() && e();
\ No newline at end of file
+r($doc->getLibFilesTest($type[0], $objectID[0], $orderBy[0])) && p() && e('这是一个文件名称4.dot,这是一个文件名称3.docx,这是一个文件名称2.doc'); // 获取 产品 1 下文件库id倒序排列的文件
+r($doc->getLibFilesTest($type[0], $objectID[1], $orderBy[0])) && p() && e('0'); // 获取 产品 2 下文件库id倒序排列的文件
+r($doc->getLibFilesTest($type[1], $objectID[2], $orderBy[0])) && p() && e('这是一个文件名称91.docx,这是一个文件名称2.doc,这是一个文件名称1.txt'); // 获取 项目 11 下文件库id倒序排列的文件
+r($doc->getLibFilesTest($type[1], $objectID[3], $orderBy[0])) && p() && e('0'); // 获取 项目 12 下文件库id倒序排列的文件
+r($doc->getLibFilesTest($type[2], $objectID[4], $orderBy[0])) && p() && e('这是一个文件名称4.dot,这是一个文件名称2.doc,这是一个文件名称1.txt'); // 获取 执行 101 下文件库id倒序排列的文件
+r($doc->getLibFilesTest($type[2], $objectID[5], $orderBy[0])) && p() && e('0'); // 获取 执行 102 下文件库id倒序排列的文件
+r($doc->getLibFilesTest($type[0], $objectID[0], $orderBy[1])) && p() && e('这是一个文件名称2.doc,这是一个文件名称3.docx,这是一个文件名称4.dot'); // 获取 产品 1 下文件库id正序排列的文件
+r($doc->getLibFilesTest($type[0], $objectID[1], $orderBy[1])) && p() && e('0'); // 获取 产品 2 下文件库id正序排列的文件
+r($doc->getLibFilesTest($type[1], $objectID[2], $orderBy[1])) && p() && e('这是一个文件名称1.txt,这是一个文件名称2.doc,这是一个文件名称91.docx'); // 获取 项目 11 下文件库id正序排列的文件
+r($doc->getLibFilesTest($type[1], $objectID[3], $orderBy[1])) && p() && e('0'); // 获取 项目 12 下文件库id正序排列的文件
+r($doc->getLibFilesTest($type[2], $objectID[4], $orderBy[1])) && p() && e('这是一个文件名称1.txt,这是一个文件名称2.doc,这是一个文件名称4.dot'); // 获取 执行 101 下文件库id正序排列的文件
+r($doc->getLibFilesTest($type[2], $objectID[5], $orderBy[1])) && p() && e('0'); // 获取 执行 102 下文件库id正序排列的文件
\ No newline at end of file
diff --git a/test/model/doc/getpreandnextdoc.php b/test/model/doc/getpreandnextdoc.php
index 0e9019503d..4a635940d4 100644
--- a/test/model/doc/getpreandnextdoc.php
+++ b/test/model/doc/getpreandnextdoc.php
@@ -10,10 +10,43 @@ title=测试 docModel->getPreAndNextDoc();
cid=1
pid=1
-
+查询空数据 >> ,
+查询文档ID为空的数据 >> ,
+查询文档ID为空的数据 >> ,
+查询文档ID为空的数据 >> ,
+查询文档库ID为空的数据 >> ,
+查询文档库ID为空的数据 >> ,
+查询文档库ID为空的数据 >> ,
+查询文档ID为1并且文档库ID为1的数据 >> ,
+查询文档ID为2并且文档库ID为1的数据 >> ,
+查询文档ID不存在并且文档库ID为1的数据 >> ,
+查询文档ID为1并且文档库ID为2的数据 >> ,
+查询文档ID为2并且文档库ID为2的数据 >> ,
+查询文档ID不存在并且文档库ID为2的数据 >> ,
+查询文档ID为1并且文档库ID不存在的数据 >> ,
+查询文档ID为2并且文档库ID不存在的数据 >> ,
+查询文档ID不存在并且文档库ID不存在的数据 >> ,
*/
$doc = new docTest();
-r($doc->getPreAndNextDocTest()) && p() && e();
\ No newline at end of file
+$docIDList = array(0, 1, 2, 1000);
+$libIDList = array(0, 1, 2, 1000);
+
+r($doc->getPreAndNextDocTest($docIDList[0], $libIDList[0])) && p('pre,next') && e(','); // 查询空数据
+r($doc->getPreAndNextDocTest($docIDList[0], $libIDList[1])) && p('pre,next') && e(','); // 查询文档ID为空的数据
+r($doc->getPreAndNextDocTest($docIDList[0], $libIDList[2])) && p('pre,next') && e(','); // 查询文档ID为空的数据
+r($doc->getPreAndNextDocTest($docIDList[0], $libIDList[3])) && p('pre,next') && e(','); // 查询文档ID为空的数据
+r($doc->getPreAndNextDocTest($docIDList[1], $libIDList[0])) && p('pre,next') && e(','); // 查询文档库ID为空的数据
+r($doc->getPreAndNextDocTest($docIDList[2], $libIDList[0])) && p('pre,next') && e(','); // 查询文档库ID为空的数据
+r($doc->getPreAndNextDocTest($docIDList[3], $libIDList[0])) && p('pre,next') && e(','); // 查询文档库ID为空的数据
+r($doc->getPreAndNextDocTest($docIDList[1], $libIDList[1])) && p('pre,next') && e(','); // 查询文档ID为1并且文档库ID为1的数据
+r($doc->getPreAndNextDocTest($docIDList[2], $libIDList[1])) && p('pre,next') && e(','); // 查询文档ID为2并且文档库ID为1的数据
+r($doc->getPreAndNextDocTest($docIDList[3], $libIDList[1])) && p('pre,next') && e(','); // 查询文档ID不存在并且文档库ID为1的数据
+r($doc->getPreAndNextDocTest($docIDList[1], $libIDList[2])) && p('pre,next') && e(','); // 查询文档ID为1并且文档库ID为2的数据
+r($doc->getPreAndNextDocTest($docIDList[2], $libIDList[2])) && p('pre,next') && e(','); // 查询文档ID为2并且文档库ID为2的数据
+r($doc->getPreAndNextDocTest($docIDList[3], $libIDList[2])) && p('pre,next') && e(','); // 查询文档ID不存在并且文档库ID为2的数据
+r($doc->getPreAndNextDocTest($docIDList[1], $libIDList[3])) && p('pre,next') && e(','); // 查询文档ID为1并且文档库ID不存在的数据
+r($doc->getPreAndNextDocTest($docIDList[2], $libIDList[3])) && p('pre,next') && e(','); // 查询文档ID为2并且文档库ID不存在的数据
+r($doc->getPreAndNextDocTest($docIDList[3], $libIDList[3])) && p('pre,next') && e(','); // 查询文档ID不存在并且文档库ID不存在的数据
diff --git a/test/model/doc/getstatisticinfo.php b/test/model/doc/getstatisticinfo.php
index 26ceba1733..c095600292 100644
--- a/test/model/doc/getstatisticinfo.php
+++ b/test/model/doc/getstatisticinfo.php
@@ -10,10 +10,9 @@ title=测试 docModel->getStatisticInfo();
cid=1
pid=1
-
-
+测试正常查询 >> 900,0,0,900,0,900,900
*/
$doc = new docTest();
-r($doc->getStatisticInfoTest()) && p() && e();
\ No newline at end of file
+r($doc->getStatisticInfoTest()) && p('totalDocs,todayEditedDocs,lastEditedDocs,lastAddedDocs,myCollection,myDocs,pastEditedDocs') && e('900,0,0,900,0,900,900'); //测试正常查询
diff --git a/test/model/doc/setlibusers.php b/test/model/doc/setlibusers.php
index 0485e11ee1..3b3689fc84 100644
--- a/test/model/doc/setlibusers.php
+++ b/test/model/doc/setlibusers.php
@@ -10,10 +10,24 @@ title=测试 docModel->setLibUsers();
cid=1
pid=1
-
+测试获取 产品 1 的团队成员 >> po82,user92,po92,test2,test82,test92,pm72,pm82
+测试获取 产品 2 的团队成员 >> po83,user93,po93,test3,test83,test93,pm73,pm83
+测试获取 产品 3 的团队成员 >> po84,user94,po94,test4,test84,test94,pm74,pm84
+测试获取 执行 101 的团队成员 >> po82,user92
+测试获取 执行 102 的团队成员 >> po83,user93
+测试获取 执行 103 的团队成员 >> po84,user94
+测试获取 项目 11 的团队成员 >> 0
*/
+$type = array('product', 'execution', 'project');
+$objectID = array(1, 2, 3, 101, 102, 103, 11);
$doc = new docTest();
-r($doc->setLibUsersTest()) && p() && e();
\ No newline at end of file
+r($doc->setLibUsersTest($type[0], $objectID[0])) && p() && e('po82,user92,po92,test2,test82,test92,pm72,pm82'); // 测试获取 产品 1 的团队成员
+r($doc->setLibUsersTest($type[0], $objectID[1])) && p() && e('po83,user93,po93,test3,test83,test93,pm73,pm83'); // 测试获取 产品 2 的团队成员
+r($doc->setLibUsersTest($type[0], $objectID[2])) && p() && e('po84,user94,po94,test4,test84,test94,pm74,pm84'); // 测试获取 产品 3 的团队成员
+r($doc->setLibUsersTest($type[1], $objectID[3])) && p() && e('po82,user92'); // 测试获取 执行 101 的团队成员
+r($doc->setLibUsersTest($type[1], $objectID[4])) && p() && e('po83,user93'); // 测试获取 执行 102 的团队成员
+r($doc->setLibUsersTest($type[1], $objectID[5])) && p() && e('po84,user94'); // 测试获取 执行 103 的团队成员
+r($doc->setLibUsersTest($type[2], $objectID[6])) && p() && e('0'); // 测试获取 项目 11 的团队成员
\ No newline at end of file
diff --git a/test/model/doc/statlibcounts.php b/test/model/doc/statlibcounts.php
index 730df24862..006e801d99 100644
--- a/test/model/doc/statlibcounts.php
+++ b/test/model/doc/statlibcounts.php
@@ -10,10 +10,20 @@ title=测试 docModel->statLibCounts();
cid=1
pid=1
-
+测试统计libID 1 3 5 的模块文件数量 >> 3;3;3
+测试统计libID 2 4 6 的模块文件数量 >> 3;3;3
+测试统计libID 7 9 11 的模块文件数量 >> 3;3;4
+测试统计libID 8 10 12 的模块文件数量 >> 3;3;4
+测试统计libID 13 14 15 的模块文件数量 >> 4;4;4
*/
+$libIDList = array(array(1, 3, 5), array(2, 4, 6), array(7, 9, 11), array(8, 10, 12), array(13, 14, 15));
+
$doc = new docTest();
-r($doc->statLibCountsTest()) && p() && e();
\ No newline at end of file
+r($doc->statLibCountsTest($libIDList[0])) && p('1;3;5') && e('3;3;3'); // 测试统计libID 1 3 5 的模块文件数量
+r($doc->statLibCountsTest($libIDList[1])) && p('2;4;6') && e('3;3;3'); // 测试统计libID 2 4 6 的模块文件数量
+r($doc->statLibCountsTest($libIDList[2])) && p('7;9;11') && e('3;3;4'); // 测试统计libID 7 9 11 的模块文件数量
+r($doc->statLibCountsTest($libIDList[3])) && p('8;10;12') && e('3;3;4'); // 测试统计libID 8 10 12 的模块文件数量
+r($doc->statLibCountsTest($libIDList[4])) && p('13;14;15') && e('4;4;4'); // 测试统计libID 13 14 15 的模块文件数量
\ No newline at end of file
diff --git a/test/model/git/getrepologs.php b/test/model/git/getrepologs.php
index b2e1dac8c9..2cd796f534 100755
--- a/test/model/git/getrepologs.php
+++ b/test/model/git/getrepologs.php
@@ -18,9 +18,6 @@ pid=1
$git = new gitTest();
-/* Fix error Gitlab url. */
-$tester->dao->update(TABLE_PIPELINE)->set('url')->eq('http://10.0.1.161:51080')->where('id')->eq(1)->exec();
-
$repo = $tester->dao->select('*')->from(TABLE_REPO)->limit(1)->fetch();
if(strtolower($repo->SCM) == 'gitlab') $repo = $tester->loadModel('repo')->processGitlab($repo);
r($git->getRepoLogs($repo)) && p() && e(1); // 获取版本库的tags
diff --git a/test/model/git/getrepos.php b/test/model/git/getrepos.php
index 0d7260bc9f..dc568ac8d1 100755
--- a/test/model/git/getrepos.php
+++ b/test/model/git/getrepos.php
@@ -16,10 +16,7 @@ pid=1
$git = new gitTest();
-/* Fix error Gitlab url. */
-$tester->dao->update(TABLE_PIPELINE)->set('url')->eq('http://10.0.1.161:51080')->where('id')->eq(1)->exec();
-
$tester->dao->update(TABLE_REPO)->set('synced')->eq(1)->where('id')->eq(1)->exec();
-r($git->getRepos()) && p() && e('http://192.168.1.161:51080/api/v4/projects/42/repository/'); // 获取版本库
+r($git->getRepos()) && p() && e('http://10.0.1.161:51080/api/v4/projects/42/repository/'); // 获取版本库
system("./ztest init");
diff --git a/test/model/git/updatecommit.php b/test/model/git/updatecommit.php
index 6e75cb6323..213b8fb322 100755
--- a/test/model/git/updatecommit.php
+++ b/test/model/git/updatecommit.php
@@ -17,9 +17,6 @@ pid=1
$git = new gitTest();
-/* Fix error Gitlab url. */
-$tester->dao->update(TABLE_PIPELINE)->set('url')->eq('http://10.0.1.161:51080')->where('id')->eq(1)->exec();
-
$repo = $tester->dao->select('*')->from(TABLE_REPO)->limit(1)->fetch();
if(strtolower($repo->SCM) == 'gitlab') $repo = $tester->loadModel('repo')->processGitlab($repo);
r($git->updateCommit($repo)) && p() && e(1); // 测试正常的版本库
diff --git a/test/model/jenkins/create.php b/test/model/jenkins/create.php
new file mode 100644
index 0000000000..627d27b13c
--- /dev/null
+++ b/test/model/jenkins/create.php
@@ -0,0 +1,37 @@
+#!/usr/bin/env php
+create();
+cid=1
+pid=1
+
+Jenkins名称为空 >> name
+服务器地址为空 >> url
+正确Jenkins数据 >> Jenkins,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d
+
+*/
+
+$jenkins = new jenkinsTest();
+
+$_POST = array();
+$_POST['name'] = '';
+$_POST['url'] = 'http://10.0.1.161:58080';
+$_POST['account'] = 'admin';
+$_POST['token'] = '1196c85ba525a268570df9da627e3a7b2d';
+$_POST['password'] = '';
+
+r($jenkins->create()) && p() && e('name'); // Jenkins名称为空
+
+$_POST['name'] = 'Jenkins';
+$_POST['url'] = '';
+r($jenkins->create()) && p() && e('url'); // 服务器地址为空
+
+$_POST['url'] = 'http://10.0.1.161:58080';
+r($jenkins->create()) && p('name,url,token') && e('Jenkins,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d'); // 正确Jenkins数据
+
+system("./ztest init");
diff --git a/test/model/jenkins/getbyid.php b/test/model/jenkins/getbyid.php
new file mode 100755
index 0000000000..f04d0bcdaf
--- /dev/null
+++ b/test/model/jenkins/getbyid.php
@@ -0,0 +1,30 @@
+#!/usr/bin/env php
+gitById();
+cid=1
+pid=1
+
+使用存在的ID >> 3
+使用空的ID >> 0
+使用不存在的ID >> 0
+
+*/
+
+$jenkins = new jenkinsTest();
+
+$jenkinsID = 3;
+r($jenkins->getById($jenkinsID)) && p('id') && e('3'); // 使用存在的ID
+
+$jenkinsID = 0;
+r($jenkins->getById($jenkinsID)) && p() && e(0); // 使用空的ID
+
+$jenkinsID = 111;
+r($jenkins->getById($jenkinsID)) && p() && e(0); // 使用不存在的ID
+
+system("./ztest init");
diff --git a/test/model/jenkins/getlist.php b/test/model/jenkins/getlist.php
new file mode 100755
index 0000000000..e799dd54ae
--- /dev/null
+++ b/test/model/jenkins/getlist.php
@@ -0,0 +1,22 @@
+#!/usr/bin/env php
+gitList();
+cid=1
+pid=1
+
+获取Jenkins列表 >> 3
+
+*/
+
+$jenkins = new jenkinsTest();
+
+$orderBy = 'id_desc';
+r($jenkins->getList($orderBy)) && p('id') && e('3'); // 获取Jenkins列表
+
+system("./ztest init");
diff --git a/test/model/jenkins/getpairs.php b/test/model/jenkins/getpairs.php
new file mode 100755
index 0000000000..f6b86224d7
--- /dev/null
+++ b/test/model/jenkins/getpairs.php
@@ -0,0 +1,21 @@
+#!/usr/bin/env php
+gitPairs();
+cid=1
+pid=1
+
+获取Jenkins >> 3
+
+*/
+
+$jenkins = new jenkinsTest();
+
+r($jenkins->getPairs()) && p() && e('3'); // 获取Jenkins
+
+system("./ztest init");
diff --git a/test/model/jenkins/gettasks.php b/test/model/jenkins/gettasks.php
new file mode 100755
index 0000000000..d2cb8aef85
--- /dev/null
+++ b/test/model/jenkins/gettasks.php
@@ -0,0 +1,30 @@
+#!/usr/bin/env php
+gitTasks();
+cid=1
+pid=1
+
+使用存在的Jenkins >> zentao-test
+使用空的Jenkins >> 0
+使用不存在的Jenkins >> 0
+
+*/
+
+$jenkins = new jenkinsTest();
+
+$id = 3;
+r($jenkins->getTasks($id)) && p('zentao-test') && e('zentao-test'); // 使用存在的Jenkins
+
+$id = 0;
+r($jenkins->getTasks($id)) && p() && e('0'); // 使用空的Jenkins
+
+$id = 111;
+r($jenkins->getTasks($id)) && p() && e('0'); // 使用不存在的Jenkins
+
+system("./ztest init");
diff --git a/test/model/jenkins/update.php b/test/model/jenkins/update.php
new file mode 100644
index 0000000000..e3b39dea82
--- /dev/null
+++ b/test/model/jenkins/update.php
@@ -0,0 +1,39 @@
+#!/usr/bin/env php
+update();
+cid=1
+pid=1
+
+Jenkins名称为空 >> name
+服务器地址为空 >> url
+正确Jenkins数据 >> Changed Jenkins
+
+*/
+
+$jenkins = new jenkinsTest();
+
+$jenkinsID = 3;
+
+$_POST = array();
+$_POST['name'] = '';
+$_POST['url'] = 'http://10.0.1.161:58080';
+$_POST['account'] = 'admin';
+$_POST['token'] = '1196c85ba525a268570df9da627e3a7b2d';
+$_POST['password'] = '';
+
+r($jenkins->update($jenkinsID)) && p() && e('name'); // Jenkins名称为空
+
+$_POST['name'] = 'Changed Jenkins';
+$_POST['url'] = '';
+r($jenkins->update($jenkinsID)) && p() && e('url'); // 服务器地址为空
+
+$_POST['url'] = 'http://10.0.1.161:58080';
+r($jenkins->update($jenkinsID)) && p('name') && e('Changed Jenkins'); // 正确Jenkins数据
+
+system("./ztest init");
diff --git a/test/model/pipeline/create.php b/test/model/pipeline/create.php
new file mode 100644
index 0000000000..9f8c1900ab
--- /dev/null
+++ b/test/model/pipeline/create.php
@@ -0,0 +1,39 @@
+#!/usr/bin/env php
+create();
+cid=1
+pid=1
+
+*/
+
+$pipeline = new pipelineTest();
+
+$data = new stdClass();
+$data->name = 'Jenkins';
+$data->url = 'http://www.zentaopms.com/';
+$data->account = 'JenkinsAccount';
+$data->token = 'Jenkins';
+$data->password = 'Jenkins';
+
+$result1 = $pipeline->createTest('Jenkins', $data); //获取添加的name
+$result2 = $pipeline->createTest('Jenkins', $data); //获取添加的account
+
+$data->url = 'error url';
+$result3 = $pipeline->createTest('Jenkins', $data); //添加错误的url信息
+
+$data->url = 'http://www.zentaopms.com/';
+$data->name = '';
+$result4 = $pipeline->createTest('Jenkins', $data); //添加名称为空时
+
+r($result1) && p('type') && e('Jenkins'); //获取添加的type
+r($result2) && p('account') && e('JenkinsAccount'); //获取添加的account
+r($result3) && p('url:0') && e('『服务地址』应当为合法的URL。'); //添加错误的url信息
+r($result4) && p('name:0') && e('『名称』不能为空'); //添加名称为空时
+
+system('./ztest init');
diff --git a/test/model/pipeline/delete.php b/test/model/pipeline/delete.php
new file mode 100644
index 0000000000..39f07ef34d
--- /dev/null
+++ b/test/model/pipeline/delete.php
@@ -0,0 +1,19 @@
+#!/usr/bin/env php
+delete();
+cid=1
+pid=1
+
+*/
+
+$pipeline = new pipelineTest();
+
+r($pipeline->deleteTest(1)) && p('deleted') && e('1'); //测试删除之后deleted值是否为1
+
+system('./ztest init');
diff --git a/test/model/pipeline/getbyid.php b/test/model/pipeline/getbyid.php
new file mode 100644
index 0000000000..06d1cc2de7
--- /dev/null
+++ b/test/model/pipeline/getbyid.php
@@ -0,0 +1,20 @@
+#!/usr/bin/env php
+getByID();
+cid=1
+pid=1
+
+*/
+
+$IDList = array('1','0');
+
+$pipeline = new pipelineTest();
+
+r($pipeline->getByIDTest($IDList[0])) && p('name') && e('gitlab服务器'); //获取id为1的name字段值
+r($pipeline->getByIDTest($IDList[1])) && p() && e(); //获取id为不存在的数据
diff --git a/test/model/pipeline/getlist.php b/test/model/pipeline/getlist.php
new file mode 100644
index 0000000000..d2c06bc3a7
--- /dev/null
+++ b/test/model/pipeline/getlist.php
@@ -0,0 +1,26 @@
+#!/usr/bin/env php
+getList();
+cid=1
+pid=1
+
+*/
+
+global $tester;
+$pipeline = new pipelineTest();
+$tester->app->loadClass('pager', $static = true);
+
+$pager = new pager(0, 10, 1);
+
+$gitlabList = $pipeline->getListTest('gitlab', 'id_desc', $pager);
+$sonarqubeList = $pipeline->getListTest('sonarqube ', 'id_desc', $pager);
+
+r($gitlabList) && p('1:name') && e('gitlab服务器'); //获取第一页第一条数据的name
+r(count($gitlabList)) && p() && e('1'); //统计所有type为gitlab的数量
+r(count($sonarqubeList)) && p() && e('1'); //统计所有type为sonarqube的数据量
diff --git a/test/model/pipeline/getpairs.php b/test/model/pipeline/getpairs.php
new file mode 100644
index 0000000000..2c856409f2
--- /dev/null
+++ b/test/model/pipeline/getpairs.php
@@ -0,0 +1,23 @@
+#!/usr/bin/env php
+getPairs();
+cid=1
+pid=1
+
+*/
+
+$pipeline = new pipelineTest();
+
+$data[0] = array('type' => 'gitlab', 'id' => 1);
+$data[1] = array('type' => 'sonarqube', 'id' => 2);
+$data[2] = array('type' => 'testType');
+
+r($pipeline->getPairs($data[0])) && p() && e('gitlab服务器'); //id为1且type为gitlab的pipeline名称
+r($pipeline->getPairs($data[1])) && p() && e('sonarqube服务器'); //id为2且type为sonarqube的pipeline名称
+r($pipeline->getPairs($data[2])) && p() && e('没有获取到数据'); //获取不存在的type
diff --git a/test/model/pipeline/update.php b/test/model/pipeline/update.php
new file mode 100644
index 0000000000..441f77f312
--- /dev/null
+++ b/test/model/pipeline/update.php
@@ -0,0 +1,34 @@
+#!/usr/bin/env php
+update();
+cid=1
+pid=1
+
+*/
+
+$pipeline = new pipelineTest();
+
+$_POST['name'] = '测试修改gitlab服务器名称';
+$_POST['url'] = 'http://www.zentaopms.com/upgrade.php';
+$result1 = $pipeline->updateTest(1);
+
+$_POST['name'] = '';
+$result2 = $pipeline->updateTest(1);
+
+$_POST['name'] = '测试修改gitlab服务器名称';
+$_POST['url'] = '';
+$result3 = $pipeline->updateTest(1);
+
+unset($_POST);
+
+r($result1) && p('name') && e('测试修改gitlab服务器名称'); //获取修改后的name值
+r($result2) && p('name:0') && e('『名称』不能为空。'); //当名称为空时
+r($result3) && p('url:0') && e('『服务地址』不能为空。'); //url为空时
+
+system('./ztest init');
diff --git a/test/model/setting/deleteitems.php b/test/model/setting/deleteitems.php
index f4e098ab30..bffcdaa3fe 100644
--- a/test/model/setting/deleteitems.php
+++ b/test/model/setting/deleteitems.php
@@ -10,8 +10,51 @@ title=测试 settingModel->deleteItems();
cid=1
pid=1
+删除键是version的common模块下的系统数据 >> 0
+删除键是hourPoint的common模块下的系统数据 >> 0
+删除键是mode的common模块下的系统数据 >> 0
+删除键是CRProduct的common模块下的系统数据 >> 0
+删除键是sn的common模块下的数据 >> 0
+删除键是CRExection的common模块下的数据 >> 0
+删除键是mode、附件条件是safe的数据 >> 0
+删除键是URSR的数据 >> 0
+删除模块是story的数据 >> 0
+删除附加条件是xuanxuan的数据 >> 0
+删除所有者是admin的数据 >> 0
+删除视图是rnd的数据 >> 0
+删除所有的数据 >> 0
+
*/
$setting = new settingTest();
-r($setting->deleteItemsTest()) && p() && e();
\ No newline at end of file
+$params = array();
+$params[0] = "vision=rnd&owner=system&module=common§ion=global&key=version";
+$params[1] = "vision=rnd&owner=system&module=common&key=hourPoint";
+$params[2] = "owner=system&module=common§ion=global&key=mode";
+$params[3] = "owner=system&module=common&key=CRProduct";
+$params[4] = "module=common§ion=global&key=sn";
+$params[5] = "module=common&key=CRExection";
+$params[6] = "section=safe&key=mode";
+$params[7] = "key=URSR";
+$params[8] = "module=story";
+$params[9] = "section=xuanxuan";
+$params[10] = "owner=admin";
+$params[11] = "vision=rnd";
+$params[12] = "";
+
+r($setting->deleteItemsTest($params[0])) && p() && e('0'); // 删除键是version的common模块下的系统数据
+r($setting->deleteItemsTest($params[1])) && p() && e('0'); // 删除键是hourPoint的common模块下的系统数据
+r($setting->deleteItemsTest($params[2])) && p() && e('0'); // 删除键是mode的common模块下的系统数据
+r($setting->deleteItemsTest($params[3])) && p() && e('0'); // 删除键是CRProduct的common模块下的系统数据
+r($setting->deleteItemsTest($params[4])) && p() && e('0'); // 删除键是sn的common模块下的数据
+r($setting->deleteItemsTest($params[5])) && p() && e('0'); // 删除键是CRExection的common模块下的数据
+r($setting->deleteItemsTest($params[6])) && p() && e('0'); // 删除键是mode、附件条件是safe的数据
+r($setting->deleteItemsTest($params[7])) && p() && e('0'); // 删除键是URSR的数据
+r($setting->deleteItemsTest($params[8])) && p() && e('0'); // 删除模块是story的数据
+r($setting->deleteItemsTest($params[9])) && p() && e('0'); // 删除附加条件是xuanxuan的数据
+r($setting->deleteItemsTest($params[10])) && p() && e('0'); // 删除所有者是admin的数据
+r($setting->deleteItemsTest($params[11])) && p() && e('0'); // 删除视图是rnd的数据
+r($setting->deleteItemsTest($params[12])) && p() && e('0'); // 删除所有的数据
+
+system("./ztest init");
diff --git a/test/model/setting/getitem.php b/test/model/setting/getitem.php
index 5f225edb7e..02b4bd84e7 100644
--- a/test/model/setting/getitem.php
+++ b/test/model/setting/getitem.php
@@ -10,8 +10,79 @@ title=测试 settingModel->getItem();
cid=1
pid=1
+查询所有数据的第一条 >> 1
+查询所有者是系统的第一条数据 >> 1
+查询所有者是系统的第一条数据 >> 1
+查询所属模块是custom的第一条数据 >> 1
+查询附加条件是global的第一条数据 >> 1
+查询值是CRProduct的第一条数据 >> 1
+查询研发界面中所有者是系统的第一条数据 >> 1
+查询研发界面中所属模块是custom的第一条数据 >> 1
+查询研发界面中附加条件是global的第一条数据 >> 1
+查询研发界面中值是CRProduct的第一条数据 >> 1
+查询所有者是系统并且所属模块是custom的第一条数据 >> 1
+查询所有者是系统并且附加条件是global的第一条数据 >> 1
+查询所有者是系统并且值是CRProduct的第一条数据 >> 1
+查询所有者是系统并且所属模块是common、附加条件是global的第一条数据 >> 1
+查询所有者是系统并且所属模块是common、值是CRProduct的第一条数据 >> 1
+查询所有者是系统并且所属模块是common、附加条件是global、值是version的第一条数据 >> 1
+查询所有者是admin并且所属模块是common、值是URSR的第一条数据 >> 1
+查询所有者是admin并且所属模块是common、附加条件是block、值是initVersion的第一条数据 >> 1
+查询不存在的界面配置 >> 0
+查询不存在的所有者配置 >> 0
+查询不存在的模块配置 >> 0
+查询不存在的附加条件配置 >> 0
+查询不存在的值配置 >> 0
+
*/
$setting = new settingTest();
-r($setting->getItemTest()) && p() && e();
\ No newline at end of file
+$items = array();
+$items[0] = "";
+$items[1] = "vision=rnd";
+$items[2] = "owner=system";
+$items[3] = "module=custom";
+$items[4] = "section=global";
+$items[5] = "key=CRProduct";
+$items[6] = "vision=rnd&owner=system";
+$items[7] = "vision=rnd&module=custom";
+$items[8] = "vision=rnd§ion=global";
+$items[9] = "vision=rnd&key=CRProduct";
+$items[10] = "owner=system&module=custom";
+$items[11] = "owner=system§ion=global";
+$items[12] = "owner=system&key=CRProduct";
+$items[13] = "owner=system&module=common§ion=global";
+$items[14] = "owner=system&module=common&key=CRExecution";
+$items[15] = "owner=system&module=common§ion=global&key=version";
+$items[16] = "owner=admin&module=common&key=URSR";
+$items[17] = "owner=admin&module=my§ion=block&key=initVersion";
+$items[18] = "vision=test";
+$items[19] = "owner=test";
+$items[20] = "module=test";
+$items[21] = "section=test";
+$items[22] = "key=test";
+
+r($setting->getItemTest($items[0])) && p() && e('1'); // 查询所有数据的第一条
+r($setting->getItemTest($items[1])) && p() && e('1'); // 查询所有者是系统的第一条数据
+r($setting->getItemTest($items[2])) && p() && e('1'); // 查询所有者是系统的第一条数据
+r($setting->getItemTest($items[3])) && p() && e('1'); // 查询所属模块是custom的第一条数据
+r($setting->getItemTest($items[4])) && p() && e('1'); // 查询附加条件是global的第一条数据
+r($setting->getItemTest($items[5])) && p() && e('1'); // 查询值是CRProduct的第一条数据
+r($setting->getItemTest($items[6])) && p() && e('1'); // 查询研发界面中所有者是系统的第一条数据
+r($setting->getItemTest($items[7])) && p() && e('1'); // 查询研发界面中所属模块是custom的第一条数据
+r($setting->getItemTest($items[8])) && p() && e('1'); // 查询研发界面中附加条件是global的第一条数据
+r($setting->getItemTest($items[9])) && p() && e('1'); // 查询研发界面中值是CRProduct的第一条数据
+r($setting->getItemTest($items[10])) && p() && e('1'); // 查询所有者是系统并且所属模块是custom的第一条数据
+r($setting->getItemTest($items[11])) && p() && e('1'); // 查询所有者是系统并且附加条件是global的第一条数据
+r($setting->getItemTest($items[12])) && p() && e('1'); // 查询所有者是系统并且值是CRProduct的第一条数据
+r($setting->getItemTest($items[13])) && p() && e('1'); // 查询所有者是系统并且所属模块是common、附加条件是global的第一条数据
+r($setting->getItemTest($items[14])) && p() && e('1'); // 查询所有者是系统并且所属模块是common、值是CRProduct的第一条数据
+r($setting->getItemTest($items[15])) && p() && e('1'); // 查询所有者是系统并且所属模块是common、附加条件是global、值是version的第一条数据
+r($setting->getItemTest($items[16])) && p() && e('1'); // 查询所有者是admin并且所属模块是common、值是URSR的第一条数据
+r($setting->getItemTest($items[17])) && p() && e('1'); // 查询所有者是admin并且所属模块是my、附加条件是block、值是initVersion的第一条数据
+r($setting->getItemTest($items[18])) && p() && e('0'); // 查询不存在的界面配置
+r($setting->getItemTest($items[19])) && p() && e('0'); // 查询不存在的所有者配置
+r($setting->getItemTest($items[20])) && p() && e('0'); // 查询不存在的模块配置
+r($setting->getItemTest($items[21])) && p() && e('0'); // 查询不存在的附加条件配置
+r($setting->getItemTest($items[22])) && p() && e('0'); // 查询不存在的值配置
diff --git a/test/model/setting/getitems.php b/test/model/setting/getitems.php
index 26a599d319..a9850988c5 100644
--- a/test/model/setting/getitems.php
+++ b/test/model/setting/getitems.php
@@ -10,8 +10,79 @@ title=测试 settingModel->getItems();
cid=1
pid=1
+查询所有数据中的第一条数据 >> 0
+查询所有者是系统的第一条数据 >> 0
+查询所有者是系统的第一条数据 >> 0
+查询所属模块是custom的第一条数据 >> 0
+查询附加条件是global的第一条数据 >> new
+查询值是CRProduct的第一条数据 >> 1
+查询研发界面中所有者是系统的第一条数据 >> 1
+查询研发界面中所属模块是custom的第一条数据 >> 0
+查询研发界面中附加条件是global的第一条数据 >> new
+查询研发界面中值是CRProduct的第一条数据 >> 1
+查询所有者是系统并且所属模块是custom的第一条数据 >> 0
+查询所有者是系统并且附加条件是global的第一条数据 >> new
+查询所有者是系统并且值是CRProduct的第一条数据 >> 1
+查询所有者是系统并且所属模块是common、附加条件是global的第一条数据 >> new
+查询所有者是系统并且所属模块是common、值是CRProduct的第一条数据 >> 1
+查询所有者是系统并且所属模块是common、附加条件是global、值是version的第一条数据 >> 16.5
+查询所有者是admin并且所属模块是common、值是URSR的第一条数据 >> 2
+查询所有者是admin并且所属模块是my、附加条件是block、值是initVersion的第一条数据 >> 2
+查询不存在的界面配置 >> 0
+查询不存在的所有者配置 >> 0
+查询不存在的模块配置 >> 0
+查询不存在的附加条件配置 >> 0
+查询不存在的值配置 >> 0
+
*/
$setting = new settingTest();
-r($setting->getItemsTest()) && p() && e();
\ No newline at end of file
+$items = array();
+$items[0] = "";
+$items[1] = "vision=rnd";
+$items[2] = "owner=system";
+$items[3] = "module=custom";
+$items[4] = "section=global";
+$items[5] = "key=CRProduct";
+$items[6] = "vision=rnd&owner=system";
+$items[7] = "vision=rnd&module=custom";
+$items[8] = "vision=rnd§ion=global";
+$items[9] = "vision=rnd&key=CRProduct";
+$items[10] = "owner=system&module=custom";
+$items[11] = "owner=system§ion=global";
+$items[12] = "owner=system&key=CRProduct";
+$items[13] = "owner=system&module=common§ion=global";
+$items[14] = "owner=system&module=common&key=CRExecution";
+$items[15] = "owner=system&module=common§ion=global&key=version";
+$items[16] = "owner=admin&module=common&key=URSR";
+$items[17] = "owner=admin&module=my§ion=block&key=initVersion";
+$items[18] = "vision=test";
+$items[19] = "owner=test";
+$items[20] = "module=test";
+$items[21] = "section=test";
+$items[22] = "key=test";
+
+r($setting->getItemsTest($items[0])) && p('1:value') && e('0'); // 查询所有数据中的第一条数据
+r($setting->getItemsTest($items[1])) && p('1:value') && e('0'); // 查询所有者是系统的第一条数据
+r($setting->getItemsTest($items[2])) && p('1:value') && e('0'); // 查询所有者是系统的第一条数据
+r($setting->getItemsTest($items[3])) && p('1:value') && e('0'); // 查询所属模块是custom的第一条数据
+r($setting->getItemsTest($items[4])) && p('9:value') && e('new'); // 查询附加条件是global的第一条数据
+r($setting->getItemsTest($items[5])) && p('2:value') && e('1'); // 查询值是CRProduct的第一条数据
+r($setting->getItemsTest($items[6])) && p('3:value') && e('1'); // 查询研发界面中所有者是系统的第一条数据
+r($setting->getItemsTest($items[7])) && p('1:value') && e('0'); // 查询研发界面中所属模块是custom的第一条数据
+r($setting->getItemsTest($items[8])) && p('9:value') && e('new'); // 查询研发界面中附加条件是global的第一条数据
+r($setting->getItemsTest($items[9])) && p('2:value') && e('1'); // 查询研发界面中值是CRProduct的第一条数据
+r($setting->getItemsTest($items[10])) && p('1:value') && e('0'); // 查询所有者是系统并且所属模块是custom的第一条数据
+r($setting->getItemsTest($items[11])) && p('9:value') && e('new'); // 查询所有者是系统并且附加条件是global的第一条数据
+r($setting->getItemsTest($items[12])) && p('2:value') && e('1'); // 查询所有者是系统并且值是CRProduct的第一条数据
+r($setting->getItemsTest($items[13])) && p('9:value') && e('new'); // 查询所有者是系统并且所属模块是common、附加条件是global的第一条数据
+r($setting->getItemsTest($items[14])) && p('3:value') && e('1'); // 查询所有者是系统并且所属模块是common、值是CRProduct的第一条数据
+r($setting->getItemsTest($items[15])) && p('10:value') && e('16.5'); // 查询所有者是系统并且所属模块是common、附加条件是global、值是version的第一条数据
+r($setting->getItemsTest($items[16])) && p('25:value') && e('2'); // 查询所有者是admin并且所属模块是common、值是URSR的第一条数据
+r($setting->getItemsTest($items[17])) && p('32:value') && e('2'); // 查询所有者是admin并且所属模块是my、附加条件是block、值是initVersion的第一条数据
+r($setting->getItemsTest($items[18])) && p() && e('0'); // 查询不存在的界面配置
+r($setting->getItemsTest($items[19])) && p() && e('0'); // 查询不存在的所有者配置
+r($setting->getItemsTest($items[20])) && p() && e('0'); // 查询不存在的模块配置
+r($setting->getItemsTest($items[21])) && p() && e('0'); // 查询不存在的附加条件配置
+r($setting->getItemsTest($items[22])) && p() && e('0'); // 查询不存在的值配置
diff --git a/test/model/setting/parseitemparam.php b/test/model/setting/parseitemparam.php
index a121884eb0..d38369bf72 100644
--- a/test/model/setting/parseitemparam.php
+++ b/test/model/setting/parseitemparam.php
@@ -10,8 +10,49 @@ title=测试 settingModel->parseItemParam();
cid=1
pid=1
+解析参数包含vision、owner、module、section、key的数据 >> rnd,system,common,global,version
+解析参数包含vision、owner、module、key的数据 >> rnd,system,common,,hourPoint
+解析参数包含owner、module、section、key的数据 >> ,system,common,global,mode
+解析参数包含owner、module、key的数据 >> ,system,common,,CRProduct
+解析参数包含module、section、key的数据 >> ,,common,global,sn
+解析参数包含module、key的数据 >> ,,common,,CRExection
+解析参数包含section、key的数据 >> ,,,safe,mode
+解析参数包含key的数据 >> ,,,,URSR
+解析参数包含module的数据 >> ,,story,,
+解析参数包含section的数据 >> ,,,xuanxuan,
+解析参数包含owner的数据 >> ,admin,,,
+解析参数包含vision的数据 >> rnd,,,,
+解析空数据 >> ,,,,
+
*/
$setting = new settingTest();
-r($setting->parseItemParamTest()) && p() && e();
\ No newline at end of file
+$params = array();
+$params[0] = "vision=rnd&owner=system&module=common§ion=global&key=version";
+$params[1] = "vision=rnd&owner=system&module=common&key=hourPoint";
+$params[2] = "owner=system&module=common§ion=global&key=mode";
+$params[3] = "owner=system&module=common&key=CRProduct";
+$params[4] = "module=common§ion=global&key=sn";
+$params[5] = "module=common&key=CRExection";
+$params[6] = "section=safe&key=mode";
+$params[7] = "key=URSR";
+$params[8] = "module=story";
+$params[9] = "section=xuanxuan";
+$params[10] = "owner=admin";
+$params[11] = "vision=rnd";
+$params[12] = "";
+
+r($setting->parseItemParamTest($params[0])) && p('vision,owner,module,section,key') && e('rnd,system,common,global,version'); // 解析参数包含vision、owner、module、section、key的数据
+r($setting->parseItemParamTest($params[1])) && p('vision,owner,module,section,key') && e('rnd,system,common,,hourPoint'); // 解析参数包含vision、owner、module、key的数据
+r($setting->parseItemParamTest($params[2])) && p('vision,owner,module,section,key') && e(',system,common,global,mode'); // 解析参数包含owner、module、section、key的数据
+r($setting->parseItemParamTest($params[3])) && p('vision,owner,module,section,key') && e(',system,common,,CRProduct'); // 解析参数包含owner、module、key的数据
+r($setting->parseItemParamTest($params[4])) && p('vision,owner,module,section,key') && e(',,common,global,sn'); // 解析参数包含module、section、key的数据
+r($setting->parseItemParamTest($params[5])) && p('vision,owner,module,section,key') && e(',,common,,CRExection'); // 解析参数包含module、key的数据
+r($setting->parseItemParamTest($params[6])) && p('vision,owner,module,section,key') && e(',,,safe,mode'); // 解析参数包含section、key的数据
+r($setting->parseItemParamTest($params[7])) && p('vision,owner,module,section,key') && e(',,,,URSR'); // 解析参数包含key的数据
+r($setting->parseItemParamTest($params[8])) && p('vision,owner,module,section,key') && e(',,story,,'); // 解析参数包含module的数据
+r($setting->parseitemparamtest($params[9])) && p('vision,owner,module,section,key') && e(',,,xuanxuan,'); // 解析参数包含section的数据
+r($setting->parseitemparamtest($params[10])) && p('vision,owner,module,section,key') && e(',admin,,,'); // 解析参数包含owner的数据
+r($setting->parseitemparamtest($params[11])) && p('vision,owner,module,section,key') && e('rnd,,,,'); // 解析参数包含vision的数据
+r($setting->parseitemparamtest($params[12])) && p('vision,owner,module,section,key') && e(',,,,'); // 解析空数据
diff --git a/test/model/setting/setitem.php b/test/model/setting/setitem.php
index 698edea9f0..4109182225 100644
--- a/test/model/setting/setitem.php
+++ b/test/model/setting/setitem.php
@@ -10,8 +10,66 @@ title=测试 settingModel->setItem();
cid=1
pid=1
+设置没有vision的空数据 >> 0
+设置没有vision的只有视图的数据 >> 0
+设置没有vision的所有者是system的数据 >> 0
+设置没有vision的my模块的系统数据 >> 0
+设置没有vision的project模块的系统数据 >> test4
+设置没有vision的product模块的系统数据 >> test5
+设置没有vision的所有者是admin的数据 >> 0
+设置没有vision的common模块的admin配置数据 >> 0
+设置没有vision的project模块的admin配置数据 >> test8
+设置没有vision的product模块的admin配置数据 >> test9
+设置有vision的所有者是system的数据 >> 0
+设置有vision的my模块的系统数据 >> 0
+设置有vision的project模块的系统数据 >> test12
+设置有vision的product模块的系统数据 >> test13
+设置有vision的所有者是admin的数据 >> 0
+设置有vision的common模块的admin配置数据 >> 0
+设置有vision的project模块的admin配置数据 >> test16
+设置有vision的product模块的admin配置数据 >> test17
+
*/
$setting = new settingTest();
-r($setting->setItemTest()) && p() && e();
\ No newline at end of file
+$pathList = array();
+$pathList[0] = "";
+$pathList[1] = "@rnd";
+$pathList[2] = "system";
+$pathList[3] = "system.my";
+$pathList[4] = "system.project.list";
+$pathList[5] = "system.product.global.story";
+$pathList[6] = "admin";
+$pathList[7] = "admin.common";
+$pathList[8] = "admin.project.list";
+$pathList[9] = "admin.product.global.story";
+$pathList[10] = "system@rnd";
+$pathList[11] = "system.my@rnd";
+$pathList[12] = "system.project.list@rnd";
+$pathList[13] = "system.product.global.story@rnd";
+$pathList[14] = "admin@rnd";
+$pathList[15] = "admin.common@rnd";
+$pathList[16] = "admin.project.list@rnd";
+$pathList[17] = "admin.product.global.story@rnd";
+
+r($setting->setItemTest($pathList[0], 'test0')) && p() && e('0'); // 设置没有vision的空数据
+r($setting->setItemTest($pathList[1], 'test1')) && p() && e('0'); // 设置没有vision的只有视图的数据
+r($setting->setItemTest($pathList[2], 'test2')) && p() && e('0'); // 设置没有vision的所有者是system的数据
+r($setting->setItemTest($pathList[3], 'test3')) && p() && e('0'); // 设置没有vision的my模块的系统数据
+r($setting->setItemTest($pathList[4], 'test4')) && p() && e('test4'); // 设置没有vision的project模块的系统数据
+r($setting->setItemTest($pathList[5], 'test5')) && p() && e('test5'); // 设置没有vision的product模块的系统数据
+r($setting->setItemTest($pathList[6], 'test6')) && p() && e('0'); // 设置没有vision的所有者是admin的数据
+r($setting->setItemTest($pathList[7], 'test7')) && p() && e('0'); // 设置没有vision的common模块的admin配置数据
+r($setting->setItemTest($pathList[8], 'test8')) && p() && e('test8'); // 设置没有vision的project模块的admin配置数据
+r($setting->setItemTest($pathList[9], 'test9')) && p() && e('test9'); // 设置没有vision的product模块的admin配置数据
+r($setting->setItemTest($pathList[10], 'test10')) && p() && e('0'); // 设置有vision的所有者是system的数据
+r($setting->setItemTest($pathList[11], 'test11')) && p() && e('0'); // 设置有vision的my模块的系统数据
+r($setting->setItemTest($pathList[12], 'test12')) && p() && e('test12'); // 设置有vision的project模块的系统数据
+r($setting->setItemTest($pathList[13], 'test13')) && p() && e('test13'); // 设置有vision的product模块的系统数据
+r($setting->setItemTest($pathList[14], 'test14')) && p() && e('0'); // 设置有vision的所有者是admin的数据
+r($setting->setItemTest($pathList[15], 'test15')) && p() && e('0'); // 设置有vision的common模块的admin配置数据
+r($setting->setItemTest($pathList[16], 'test16')) && p() && e('test16'); // 设置有vision的project模块的admin配置数据
+r($setting->setItemTest($pathList[17], 'test17')) && p() && e('test17'); // 设置有vision的product模块的admin配置数据
+
+system("./ztest init");
diff --git a/test/model/setting/setitems.php b/test/model/setting/setitems.php
index 90161bb8d3..ef4c662e38 100644
--- a/test/model/setting/setitems.php
+++ b/test/model/setting/setitems.php
@@ -10,8 +10,84 @@ title=测试 settingModel->setItems();
cid=1
pid=1
+创建空数据 >> 1
+创建没有vision,只有视图且值为空的数据 >> 1
+创建没有vision,只有所有者且值为空的数据 >> 1
+创建没有vision,my模块且值为空的数据 >> 1
+创建没有vision,只有所有者且值为空的数据 >> 1
+创建没有vision,common模块且值为空的数据 >> 1
+创建有vision,只有所有者且值为空的数据 >> 1
+创建有vision,my模块且值为空的数据 >> 1
+创建有vision,只有所有者且值为空的数据 >> 1
+创建有vision,common模块且值为空的数据 >> 1
+创建没有vision,只有视图且值project的数据 >> 1
+创建没有vision,只有所有者且值为project的数据 >> 1
+创建没有vision,my模块且值为project的数据 >> 1
+创建没有vision,只有所有者且值为project的数据 >> 1
+创建没有vision,common模块且值为project的数据 >> 1
+创建有vision,只有所有者且值为project的数据 >> 1
+创建有vision,my模块且值为project的数据 >> 1
+创建有vision,只有所有者且值为project的数据 >> 1
+创建有vision,common模块且值为project的数据 >> 1
+创建没有vision,只有视图且值project和story的数据 >> 1
+创建没有vision,只有所有者且值为project和story的数据 >> 1
+创建没有vision,my模块且值为project和story的数据 >> 1
+创建没有vision,只有所有者且值为project和story的数据 >> 1
+创建没有vision,common模块且值为project和story的数据 >> 1
+创建有vision,只有所有者且值为project和story的数据 >> 1
+创建有vision,my模块且值为project和story的数据 >> 1
+创建有vision,只有所有者且值为project和story的数据 >> 1
+创建有vision,common模块且值为project和story的数据 >> 1
+
*/
$setting = new settingTest();
-r($setting->setItemsTest()) && p() && e();
\ No newline at end of file
+$pathList = array();
+$pathList[0] = "";
+$pathList[1] = "@rnd";
+$pathList[2] = "system";
+$pathList[3] = "system.my";
+$pathList[4] = "admin";
+$pathList[5] = "admin.common";
+$pathList[6] = "system@rnd";
+$pathList[7] = "system.my@rnd";
+$pathList[8] = "admin@rnd";
+$pathList[9] = "admin.common@rnd";
+
+$items = new stdclass();
+r($setting->setItemsTest($pathList[0], $items)) && p() && e('1'); // 创建空数据
+r($setting->setItemsTest($pathList[1], $items)) && p() && e('1'); // 创建没有vision,只有视图且值为空的数据
+r($setting->setItemsTest($pathList[2], $items)) && p() && e('1'); // 创建没有vision,只有所有者且值为空的数据
+r($setting->setItemsTest($pathList[3], $items)) && p() && e('1'); // 创建没有vision,my模块且值为空的数据
+r($setting->setItemsTest($pathList[4], $items)) && p() && e('1'); // 创建没有vision,只有所有者且值为空的数据
+r($setting->setItemsTest($pathList[5], $items)) && p() && e('1'); // 创建没有vision,common模块且值为空的数据
+r($setting->setItemsTest($pathList[6], $items)) && p() && e('1'); // 创建有vision,只有所有者且值为空的数据
+r($setting->setItemsTest($pathList[7], $items)) && p() && e('1'); // 创建有vision,my模块且值为空的数据
+r($setting->setItemsTest($pathList[8], $items)) && p() && e('1'); // 创建有vision,只有所有者且值为空的数据
+r($setting->setItemsTest($pathList[9], $items)) && p() && e('1'); // 创建有vision,common模块且值为空的数据
+
+$items->projectList = 'project';
+r($setting->setItemsTest($pathList[1], $items)) && p() && e('1'); // 创建没有vision,只有视图且值project的数据
+r($setting->setItemsTest($pathList[2], $items)) && p() && e('1'); // 创建没有vision,只有所有者且值为project的数据
+r($setting->setItemsTest($pathList[3], $items)) && p() && e('1'); // 创建没有vision,my模块且值为project的数据
+r($setting->setItemsTest($pathList[4], $items)) && p() && e('1'); // 创建没有vision,只有所有者且值为project的数据
+r($setting->setItemsTest($pathList[5], $items)) && p() && e('1'); // 创建没有vision,common模块且值为project的数据
+r($setting->setItemsTest($pathList[6], $items)) && p() && e('1'); // 创建有vision,只有所有者且值为project的数据
+r($setting->setItemsTest($pathList[7], $items)) && p() && e('1'); // 创建有vision,my模块且值为project的数据
+r($setting->setItemsTest($pathList[8], $items)) && p() && e('1'); // 创建有vision,只有所有者且值为project的数据
+r($setting->setItemsTest($pathList[9], $items)) && p() && e('1'); // 创建有vision,common模块且值为project的数据
+
+$items->global = new stdclass();
+$items->global->productList = 'story';
+r($setting->setItemsTest($pathList[1], $items)) && p() && e('1'); // 创建没有vision,只有视图且值project和story的数据
+r($setting->setItemsTest($pathList[2], $items)) && p() && e('1'); // 创建没有vision,只有所有者且值为project和story的数据
+r($setting->setItemsTest($pathList[3], $items)) && p() && e('1'); // 创建没有vision,my模块且值为project和story的数据
+r($setting->setItemsTest($pathList[4], $items)) && p() && e('1'); // 创建没有vision,只有所有者且值为project和story的数据
+r($setting->setItemsTest($pathList[5], $items)) && p() && e('1'); // 创建没有vision,common模块且值为project和story的数据
+r($setting->setItemsTest($pathList[6], $items)) && p() && e('1'); // 创建有vision,只有所有者且值为project和story的数据
+r($setting->setItemsTest($pathList[7], $items)) && p() && e('1'); // 创建有vision,my模块且值为project和story的数据
+r($setting->setItemsTest($pathList[8], $items)) && p() && e('1'); // 创建有vision,只有所有者且值为project和story的数据
+r($setting->setItemsTest($pathList[9], $items)) && p() && e('1'); // 创建有vision,common模块且值为project和story的数据
+
+system("./ztest init");
diff --git a/test/ztest b/test/ztest
index 868edfaf13..0992b1e6ff 100755
--- a/test/ztest
+++ b/test/ztest
@@ -43,6 +43,9 @@ switch($argv[1])
case 'cron':
ztfRun('model/cron');
break;
+ case 'datatable':
+ ztfRun('model/datatable');
+ break;
case 'dept':
ztfRun('model/dept');
break;
@@ -52,6 +55,9 @@ switch($argv[1])
case 'entry':
ztfRun('model/entry');
break;
+ case 'doc':
+ ztfRun('model/doc');
+ break;
case 'file':
ztfRun('model/file');
break;
@@ -64,6 +70,9 @@ switch($argv[1])
case 'group':
ztfRun('model/group');
break;
+ case 'jenkins':
+ ztfRun('model/jenkins');
+ break;
case 'kanban':
ztfRun('model/kanban');
break;
@@ -94,6 +103,9 @@ switch($argv[1])
case 'project':
ztfRun('model/project');
break;
+ case 'pipeline':
+ ztfRun('model/pipeline');
+ break;
case 'holiday':
ztfRun('model/holiday');
break;
|