Merge branch 'autotest_ly' into 'master'
add dept and bug data See merge request easycorp/zentaopms!2425
This commit is contained in:
274
test/class/dept.class.php
Normal file
274
test/class/dept.class.php
Normal file
@@ -0,0 +1,274 @@
|
||||
<?php
|
||||
class deptTest
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel = $tester->loadModel('dept');
|
||||
}
|
||||
|
||||
/**
|
||||
* function getByID test by dept
|
||||
*
|
||||
* @param string $deptID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByIDTest($deptID)
|
||||
{
|
||||
$objects = $this->objectModel->getByID($deptID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function getDeptPairs test by dept
|
||||
*
|
||||
* @param string $deptID
|
||||
* @param string $count
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDeptPairsTest($deptID, $count)
|
||||
{
|
||||
$objects = $this->objectModel->getDeptPairs($deptID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
if($count == '1') return count($objects);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function buildMenuQuery test by dept
|
||||
*
|
||||
* @param string $rootDeptID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function buildMenuQueryTest($rootDeptID)
|
||||
{
|
||||
$objects = $this->objectModel->buildMenuQuery($rootDeptID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function getOptionMenu test by dept
|
||||
*
|
||||
* @param string $rootDeptID
|
||||
* @param string $count
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getOptionMenuTest($rootDeptID, $count)
|
||||
{
|
||||
$objects = $this->objectModel->getOptionMenu($rootDeptID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
if($count == '1') return count($objects);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function getTreeMenu test by dept
|
||||
*
|
||||
* @param string $rootDeptID
|
||||
* @param array $userFunc
|
||||
* @param int $param
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getTreeMenuTest($rootDeptID, $userFunc, $param = 0)
|
||||
{
|
||||
$objects = $this->objectModel->getTreeMenu($rootDeptID, $userFunc, $param = 0);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function update test by dept
|
||||
*
|
||||
* @param string $deptID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function updateTest($deptID, $param = array())
|
||||
{
|
||||
global $tester;
|
||||
|
||||
$createFields = array('parent' => '', 'name' => '', 'manager' => '');
|
||||
|
||||
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
|
||||
foreach($param as $key => $value) $_POST[$key] = $value;
|
||||
|
||||
$this->objectModel->update($deptID);
|
||||
|
||||
unset($_POST);
|
||||
|
||||
$objects = $tester->dao->select('*')->from(TABLE_DEPT)->where('id')->eq($deptID)->fetchAll('id');
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function createManageLink test by dept
|
||||
*
|
||||
* @param string $deptID
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function createManageLinkTest($deptID)
|
||||
{
|
||||
$dept = $this->objectModel->getByID($deptID);
|
||||
$objects = $this->objectModel->createManageLink($dept);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function createMemberLink test by dept
|
||||
*
|
||||
* @param string $deptID
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function createMemberLinkTest($deptID)
|
||||
{
|
||||
$dept = $this->objectModel->getByID($deptID);
|
||||
$objects = $this->objectModel->createMemberLink($dept);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function traingoalMemberLinkTest($dept, $planID)
|
||||
{
|
||||
$objects = $this->objectModel->traingoalMemberLink($dept, $planID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function createGroupManageMemberLinkTest($dept, $groupID)
|
||||
{
|
||||
$objects = $this->objectModel->createGroupManageMemberLink($dept, $groupID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function createManageProjectAdminLinkTest($dept, $groupID)
|
||||
{
|
||||
$objects = $this->objectModel->createManageProjectAdminLink($dept, $groupID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getSonsTest($deptID)
|
||||
{
|
||||
$objects = $this->objectModel->getSons($deptID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getAllChildIdTest($deptID)
|
||||
{
|
||||
$objects = $this->objectModel->getAllChildId($deptID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getParentsTest($deptID)
|
||||
{
|
||||
$objects = $this->objectModel->getParents($deptID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function updateOrderTest($orders)
|
||||
{
|
||||
$objects = $this->objectModel->updateOrder($orders);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function manageChildTest($parentDeptID, $childs)
|
||||
{
|
||||
$objects = $this->objectModel->manageChild($parentDeptID, $childs);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getUsersTest($browseType = 'inside', $deptID = 0, $pager = null, $orderBy = 'id')
|
||||
{
|
||||
$objects = $this->objectModel->getUsers($browseType = 'inside', $deptID = 0, $pager = null, $orderBy = 'id');
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getDeptUserPairsTest($deptID = 0, $key = 'account', $type = 'inside', $params = '')
|
||||
{
|
||||
$objects = $this->objectModel->getDeptUserPairs($deptID = 0, $key = 'account', $type = 'inside', $params = '');
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function deleteTest($deptID, $null = null)
|
||||
{
|
||||
$objects = $this->objectModel->delete($deptID, $null = null);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function fixDeptPathTest()
|
||||
{
|
||||
$objects = $this->objectModel->fixDeptPath();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getDataStructureTest()
|
||||
{
|
||||
$objects = $this->objectModel->getDataStructure();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ fields:
|
||||
- field: activatedCount
|
||||
range: 0
|
||||
- field: mailto
|
||||
range: []
|
||||
range: admin{100},[]{200}
|
||||
- field: openedBy
|
||||
range: admin
|
||||
- field: openedDate
|
||||
|
||||
@@ -6,27 +6,27 @@ fields:
|
||||
range: 1-1000
|
||||
|
||||
- field: project
|
||||
range: 31{5},32{2},0
|
||||
range: 11-20,0{630}
|
||||
|
||||
- field: product
|
||||
range: [1,41]{2!},1{2},42,2
|
||||
range: 1-10
|
||||
|
||||
- field: branch
|
||||
range: [0,1]{2!},0{2},2,0
|
||||
range: 0
|
||||
|
||||
- field: execution
|
||||
range: 391{2},121{2},661,122{2},0
|
||||
range: 0{10}, 101-110
|
||||
|
||||
- field: name
|
||||
fields:
|
||||
- field: name1
|
||||
range: 迭代{7},无相关迭代的
|
||||
range: 项目{10},执行{10}
|
||||
|
||||
- field: name2
|
||||
range: 131{5},132{2},[]
|
||||
range: 11-20,101-110
|
||||
|
||||
- field: name2
|
||||
range: 版本{6},`版本!@()[]{}|\+=%^&*$#测试版本名称到底可以有多长!@#¥%&*'":.<>。?/();`,版本
|
||||
range: 版本
|
||||
|
||||
- field: name3
|
||||
range: 1-1000
|
||||
|
||||
131
test/data/morebug.yaml
Normal file
131
test/data/morebug.yaml
Normal file
@@ -0,0 +1,131 @@
|
||||
title: zt_bug
|
||||
desc: Bug表
|
||||
version: 1.0
|
||||
fields:
|
||||
- field: id
|
||||
range: 301-10000
|
||||
- field: project
|
||||
range: 11-20,0{5}
|
||||
- field: product
|
||||
range: 1-10,1{5}
|
||||
- field: branch
|
||||
range: 0
|
||||
- field: module
|
||||
range: 0
|
||||
- field: execution
|
||||
range: 101-110,0{5}
|
||||
- field: plan
|
||||
range: 0
|
||||
- field: story
|
||||
range: 2-40:4,0{5}
|
||||
- field: storyVersion
|
||||
range: 3{10},1{5}
|
||||
- field: task
|
||||
range: 0
|
||||
- field: toTask
|
||||
range: 0
|
||||
- field: toStory
|
||||
range: 0
|
||||
- field: title
|
||||
fields:
|
||||
- field: title1
|
||||
range: 测试单转Bug,SonarQube_Bug
|
||||
- field: title2
|
||||
range: 1-10000
|
||||
- field: keywords
|
||||
range: []
|
||||
- field: severity
|
||||
range: 1-4
|
||||
- field: pri
|
||||
range: 1-4
|
||||
- field: type
|
||||
range: codeerror
|
||||
- field: os
|
||||
range: ""
|
||||
- field: browser
|
||||
range: []
|
||||
- field: hardware
|
||||
range: []
|
||||
- field: found
|
||||
range: []
|
||||
- field: steps
|
||||
range: [<p>【步骤】</p><br/><p>【结果】</p><br/><p>【期望】</p><br/>,【步骤】进入成果展示<br/>【结果】乱码<br/>【期望】正常显示<br/>]
|
||||
- field: status
|
||||
range: active
|
||||
- field: subStatus
|
||||
range: []
|
||||
- field: color
|
||||
range: [#3da7f5,#75c941,#2dbdb2,#797ec9,#ffaf38,#ff4e3e]
|
||||
- field: confirmed
|
||||
range: 0
|
||||
- field: activatedCount
|
||||
range: 0
|
||||
- field: mailto
|
||||
range: admin{100},[]{200}
|
||||
- field: openedBy
|
||||
range: admin
|
||||
- field: openedDate
|
||||
range: "(-1M)-(+1w):60"
|
||||
type: timestamp
|
||||
format: "YYYY-MM-DD hh:mm:ss"
|
||||
- field: openedBuild
|
||||
range: 11-20
|
||||
- field: assignedTo
|
||||
range: admin,dev1,test1
|
||||
- field: assignedDate
|
||||
range: "(-1M)-(+1w):60"
|
||||
type: timestamp
|
||||
format: "YYYY-MM-DD"
|
||||
- field: deadline
|
||||
range: "(-1M)-(+1w):-1D"
|
||||
type: timestamp
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: "YYYY-MM-DD"
|
||||
- field: resolvedBy
|
||||
range: ""
|
||||
- field: resolution
|
||||
range: ""
|
||||
- field: resolvedBuild
|
||||
range: ""
|
||||
- field: resolvedDate
|
||||
range: ""
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
- field: closedBy
|
||||
range: ""
|
||||
- field: closedDate
|
||||
range: ""
|
||||
- field: duplicateBug
|
||||
range: 0
|
||||
- field: linkBug
|
||||
range:
|
||||
- field: case
|
||||
range: 2-40:4
|
||||
- field: caseVersion
|
||||
range: 1{10},0{5}
|
||||
- field: result
|
||||
range: 2-40:4
|
||||
- field: repo
|
||||
range: 0
|
||||
- field: entry
|
||||
range:
|
||||
- field: lines
|
||||
range:
|
||||
- field: v1
|
||||
range:
|
||||
- field: v2
|
||||
range:
|
||||
- field: issueKey
|
||||
range: []{10},[17]{5}
|
||||
- field: repoType
|
||||
range:
|
||||
- field: testtask
|
||||
range: 1-10,0{5}
|
||||
- field: lastEditedBy
|
||||
range:
|
||||
- field: lastEditedDate
|
||||
range:
|
||||
- field: deleted
|
||||
range: 0
|
||||
69
test/data/testrun.yaml
Normal file
69
test/data/testrun.yaml
Normal file
@@ -0,0 +1,69 @@
|
||||
title: table zt_testrun
|
||||
desc: "测试执行"
|
||||
author: automated export
|
||||
version: "1.0"
|
||||
fields:
|
||||
- field: id
|
||||
note: "ID"
|
||||
range: 1-10000
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: task
|
||||
note: "测试单任务ID"
|
||||
range: 1-10{4}
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: case
|
||||
note: "用例ID"
|
||||
range: 1-40
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: version
|
||||
note: "版本"
|
||||
range: 1
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: assignedTo
|
||||
note: "指派给"
|
||||
range: ""
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: lastRunner
|
||||
note: "最后执行人"
|
||||
use: admin
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: lastRunDate
|
||||
note: "最后执行时间"
|
||||
range: "(M)-(w):60"
|
||||
type: timestamp
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: "YYYY-MM-DD"
|
||||
- field: lastRunResult
|
||||
note: "最后执行结果"
|
||||
range: pass,fail
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: status
|
||||
note: "状态"
|
||||
range: normal
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
126
test/data/testtask.yaml
Normal file
126
test/data/testtask.yaml
Normal file
@@ -0,0 +1,126 @@
|
||||
title: table zt_testtask
|
||||
desc: "测试版本"
|
||||
author: automated export
|
||||
version: "1.0"
|
||||
fields:
|
||||
- field: id
|
||||
note: "ID"
|
||||
range: 1-10000
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: name
|
||||
note: "测试单名称"
|
||||
range: 1-10000
|
||||
prefix: "测试单"
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: product
|
||||
note: "所属产品"
|
||||
range: 1-10
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: project
|
||||
note: "所属项目"
|
||||
range: 11-20
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: execution
|
||||
note: "所属执行"
|
||||
range: 101-110
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: build
|
||||
range: 11-20
|
||||
note: "版本"
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: owner
|
||||
note: "负责人"
|
||||
range: 3-14
|
||||
prefix: "user"
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: pri
|
||||
note: "优先级"
|
||||
range: 1-4
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: begin
|
||||
note: "开始日期"
|
||||
range: "(M)-(w):60"
|
||||
type: timestamp
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: "YYYY-MM-DD"
|
||||
- field: end
|
||||
note: "结束日期"
|
||||
range: "(M)-(+1w):60"
|
||||
type: timestamp
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: "YYYY-MM-DD"
|
||||
- field: mailto
|
||||
note: "抄送给"
|
||||
range: ""
|
||||
prefix: ","
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: desc
|
||||
note: "描述"
|
||||
range: 1-1000
|
||||
prefix: "这是测试单描述"
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: report
|
||||
note: "报告"
|
||||
range: ""
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: status
|
||||
note: "状态"
|
||||
range: wait,doing,done,blocked
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: auto
|
||||
note: "自动"
|
||||
range: no
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: subStatus
|
||||
note: "子状态"
|
||||
range: ""
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: deleted
|
||||
note: "是否删除"
|
||||
range: 0
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
@@ -27,6 +27,10 @@ $builder->taskestimate = array('rows' => 600, 'extends' => array('taskestimate')
|
||||
$builder->taskson = array('rows' => 10, 'extends' => array('task', 'taskson'));
|
||||
$builder->case = array('rows' => 400, 'extends' => array('case'));
|
||||
$builder->bug = array('rows' => 300, 'extends' => array('bug'));
|
||||
$builder->morebug = array('rows' => 15, 'extends' => array('bug','morebug'));
|
||||
|
||||
$builder->testtask = array('rows' => 10, 'extends' => array('testtask'));
|
||||
$builder->testrun = array('rows' => 40, 'extends' => array('testrun'));
|
||||
|
||||
$builder->product = array('rows' => 100, 'extends' => array('product'));
|
||||
$builder->productline = array('rows' => 20, 'extends' => array('module', 'productline'));
|
||||
@@ -61,7 +65,7 @@ $builder->doclib = array('rows' => 900, 'extends' => array('doclib'));
|
||||
$builder->doc = array('rows' => 900, 'extends' => array('doc'));
|
||||
$builder->doccontent = array('rows' => 900, 'extends' => array('doccontent'));
|
||||
|
||||
$builder->build = array('rows' => 8, 'extends' => array('build'));
|
||||
$builder->build = array('rows' => 20, 'extends' => array('build'));
|
||||
$builder->release = array('rows' => 8, 'extends' => array('release'));
|
||||
|
||||
$builder->pipeline = array('rows' => 2, 'extends' => array('pipeline'));
|
||||
|
||||
@@ -46,6 +46,7 @@ class Processor
|
||||
$this->initUserquery();
|
||||
$this->initUpdateKanban();
|
||||
$this->initStory();
|
||||
$this->initBug();
|
||||
|
||||
$this->dao->commit();
|
||||
}
|
||||
@@ -156,6 +157,11 @@ class Processor
|
||||
$this->dao->update(TABLE_STORY)->set('`status`')->eq('active')->where('id')->le('20')->exec();
|
||||
}
|
||||
|
||||
private function initBug()
|
||||
{
|
||||
$this->dao->update(TABLE_BUG)->set('`issueKey`')->eq('2:AX-W7K3_L7H_36P3H4le')->where('issueKey')->eq('17')->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Init product plan.
|
||||
*
|
||||
|
||||
18
test/model/dept/buildmenuquery.php
Executable file
18
test/model/dept/buildmenuquery.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->buildMenuQuery();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('', '2');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->buildMenuQueryTest($deptIDList[0])) && p() && e('SELECT * FROM `zt_dept` ORDER BY `grade` desc,`order` '); //不输入部门id
|
||||
r($dept->buildMenuQueryTest($deptIDList[1])) && p() && e(',2,'); //输入部门id
|
||||
16
test/model/dept/creategroupmanagememberlink.php
Executable file
16
test/model/dept/creategroupmanagememberlink.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->createGroupManageMemberLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
20
test/model/dept/createmanagelink.php
Executable file
20
test/model/dept/createmanagelink.php
Executable file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->createManageLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$deptID = '5';
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->createManageLinkTest($deptID)) && p() && e('编辑'); //编辑链接
|
||||
r($dept->createManageLinkTest($deptID)) && p() && e('删除'); //删除链接
|
||||
r($dept->createManageLinkTest($deptID)) && p() && e('下级部门'); //下级部门
|
||||
r($dept->createManageLinkTest($deptID)) && p() && e('orders[5]'); //数量
|
||||
16
test/model/dept/createmanageprojectadminlink.php
Executable file
16
test/model/dept/createmanageprojectadminlink.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->createManageProjectAdminLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
17
test/model/dept/creatememberlink.php
Executable file
17
test/model/dept/creatememberlink.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->createMemberLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$deptID = '2';
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->createMemberLinkTest($deptID)) && p() && e('>开发部<');
|
||||
16
test/model/dept/delete.php
Executable file
16
test/model/dept/delete.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->delete();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
16
test/model/dept/fixdeptpath.php
Executable file
16
test/model/dept/fixdeptpath.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->fixDeptPath();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
16
test/model/dept/getallchildid.php
Executable file
16
test/model/dept/getallchildid.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->getAllChildId();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
18
test/model/dept/getbyid.php
Executable file
18
test/model/dept/getbyid.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->getByID();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('1','0');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->getByIDTest($deptIDList[0])) && p('name') && e('产品部'); //查找id为1的部门
|
||||
r($dept->getByIDTest($deptIDList[1])) && p() && e('0'); //查找id不存在的部门
|
||||
16
test/model/dept/getdatastructure.php
Executable file
16
test/model/dept/getdatastructure.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->getDataStructure();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
20
test/model/dept/getdeptpairs.php
Executable file
20
test/model/dept/getdeptpairs.php
Executable file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->getDeptPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$deptIDlist = array('0', '2');
|
||||
$count = array('0', '1');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->getDeptPairsTest($deptIDlist[0], $count[1])) && p() && e('100'); //查询全部部门统计
|
||||
r($dept->getDeptPairsTest($deptIDlist[1], $count[0])) && p('2') && e('开发部'); //查询id为2的部门
|
||||
r($dept->getDeptPairsTest($deptIDlist[1], $count[1])) && p() && e('100'); //查询id为2的部门数量
|
||||
16
test/model/dept/getdeptuserpairs.php
Executable file
16
test/model/dept/getdeptuserpairs.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->getDeptUserPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
23
test/model/dept/getoptionmenu.php
Executable file
23
test/model/dept/getoptionmenu.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->getOptionMenu();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('0', '1', '2');
|
||||
$count = array('0', '1');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->getOptionMenuTest($deptIDList[1], $count[0])) && p('1') && e('/产品部'); //父级部门查询
|
||||
r($dept->getOptionMenuTest($deptIDList[2], $count[0])) && p('2') && e('开发部'); //多级部门查询
|
||||
r($dept->getOptionMenuTest($deptIDList[0], $count[0])) && p('5') && e('/开发部/开发部1'); //全部部门查询
|
||||
r($dept->getOptionMenuTest($deptIDList[1], $count[1])) && p() && e('2'); //父级部门查询统计
|
||||
r($dept->getOptionMenuTest($deptIDList[2], $count[1])) && p() && e('4'); //多级部门查询统计
|
||||
r($dept->getOptionMenuTest($deptIDList[0], $count[1])) && p() && e('101'); //全部部门查询统计
|
||||
16
test/model/dept/getparents.php
Executable file
16
test/model/dept/getparents.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->getParents();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
16
test/model/dept/getsons.php
Executable file
16
test/model/dept/getsons.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->getSons();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
20
test/model/dept/gettreemenu.php
Executable file
20
test/model/dept/gettreemenu.php
Executable file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->getTreeMenu();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('0', '1', '2');
|
||||
$userFunc = array('deptmodel', 'createManageLink');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->getTreeMenuTest($deptIDList[0], $userFunc)) && p() && e('<li>开发部 <a'); //全部部门树结构查询
|
||||
r($dept->getTreeMenuTest($deptIDList[1], $userFunc)) && p() && e('<li>产品部 <a'); //无子部门树结构查询
|
||||
r($dept->getTreeMenuTest($deptIDList[2], $userFunc)) && p() && e('<li>开发部部1 <a'); //有子部门树结构查询
|
||||
16
test/model/dept/getusers.php
Executable file
16
test/model/dept/getusers.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->getUsers();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
16
test/model/dept/managechild.php
Executable file
16
test/model/dept/managechild.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->manageChild();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
16
test/model/dept/traingoalmemberlink.php
Executable file
16
test/model/dept/traingoalmemberlink.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->traingoalMemberLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
29
test/model/dept/update.php
Executable file
29
test/model/dept/update.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->update();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$deptIDList = array('16', '17', '18', '19', '20');
|
||||
|
||||
$parentDept = array('parent' => '0', 'name' => '修改后部门', 'manager' => 'dev1');
|
||||
$childDept = array('parent' => '1', 'name' => '子级部门修改', 'manager' => 'dev2');
|
||||
$noParent = array('name' => '无父级部门', 'manager' => 'test1');
|
||||
$noName = array('parent' => '0', 'manager' => 'test2');
|
||||
$noManager = array('parent' => '1', 'name' => '无负责人部门');
|
||||
|
||||
$dept = new deptTest();
|
||||
r($dept->updateTest($deptIDList[0], $parentDept)) && p('16:name,parent,path,manager') && e('修改后部门,0,,16,,dev1');
|
||||
r($dept->updateTest($deptIDList[2], $childDept)) && p('18:name,parent,path,manager') && e('子级部门修改,1,,1,18,,dev2');
|
||||
r($dept->updateTest($deptIDList[1], $noParent)) && p('parent:0') && e('『上级部门』应当是数字。');
|
||||
r($dept->updateTest($deptIDList[3], $noName)) && p('name:0') && e('『部门名称』不能为空。');
|
||||
r($dept->updateTest($deptIDList[4], $noManager)) && p('20:name,parent,path,manager') && e('无负责人部门,1,,1,20,,');
|
||||
|
||||
system("./ztest init");
|
||||
16
test/model/dept/updateorder.php
Executable file
16
test/model/dept/updateorder.php
Executable file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/dept.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 deptModel->updateOrder();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$dept = new deptTest();
|
||||
|
||||
r() && p() && e();
|
||||
Reference in New Issue
Block a user