*Case.
This commit is contained in:
@@ -24,7 +24,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* checkStatus
|
||||
* Check project status after activate a project.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
|
||||
@@ -21,7 +21,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* checkHasChildren
|
||||
* Check has children project.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
|
||||
@@ -24,7 +24,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* checkStatus
|
||||
* Check project status after close a project.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
|
||||
@@ -21,7 +21,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* checkBudgetUnitList
|
||||
* Check budget unit list.
|
||||
*
|
||||
* @param string $checkList
|
||||
* @access public
|
||||
|
||||
@@ -22,7 +22,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* getByIdList
|
||||
* Check projectList get from getByIdList.
|
||||
*
|
||||
* @param array $projectIdList
|
||||
* @param int $count
|
||||
|
||||
@@ -21,7 +21,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* getExecutionData
|
||||
* Get executions from getDataByProject.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param int $type
|
||||
@@ -30,13 +30,13 @@ class Tester
|
||||
*/
|
||||
public function getExecutionData($projectID, $type)
|
||||
{
|
||||
$result = $this->project->getDataByProject(TABLE_EXECUTION, $projectID, $type);
|
||||
if(empty($result)) return false;
|
||||
return $result;
|
||||
$executions = $this->project->getDataByProject(TABLE_EXECUTION, $projectID, $type);
|
||||
if(empty($executions)) return false;
|
||||
return $executions;
|
||||
}
|
||||
|
||||
/**
|
||||
* getBuildData
|
||||
* Get builds from getDataByProject.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
@@ -44,27 +44,27 @@ class Tester
|
||||
*/
|
||||
public function getBuildData($projectID)
|
||||
{
|
||||
$result = $this->project->getDataByProject(TABLE_BUILD, $projectID);
|
||||
if(empty($result)) return false;
|
||||
return $result;
|
||||
$builds = $this->project->getDataByProject(TABLE_BUILD, $projectID);
|
||||
if(empty($builds)) return false;
|
||||
return $builds;
|
||||
}
|
||||
|
||||
/**
|
||||
* getRealseData
|
||||
* Get releases from getDataByProject.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getRealseData($projectID)
|
||||
public function getReleaseData($projectID)
|
||||
{
|
||||
$result = $this->project->getDataByProject(TABLE_RELEASE, $projectID);
|
||||
if(empty($result)) return false;
|
||||
return $result;
|
||||
$releases = $this->project->getDataByProject(TABLE_RELEASE, $projectID);
|
||||
if(empty($releases)) return false;
|
||||
return $releases;
|
||||
}
|
||||
}
|
||||
|
||||
/* 还有case bug testtask doc表 */
|
||||
/* 还有case bug testtask doc表要写,暂时表中没数据 */
|
||||
$t = new Tester();
|
||||
|
||||
/* GetDataByProject(TABLE_EXECUTION, $projectID, $type). */
|
||||
@@ -78,9 +78,9 @@ r($t->getBuildData(131)) && p('id') && e('1'); //获取parent为131
|
||||
r($t->getBuildData(132)) && p('id') && e('6'); //获取parent为132的首个版本的id
|
||||
r($t->getBuildData(10000)) && p('id') && e('0'); //获取parent为10000的首个版本的id
|
||||
|
||||
/* GetDataByProject(TABLE_EXECUTION, $projectID, $type). */
|
||||
r($t->getRealseData(131)) && p('id') && e('1'); //获取parent为132的首个发布的id
|
||||
r($t->getRealseData(132)) && p('id') && e('6'); //获取parent为132的首个发布的id
|
||||
r($t->getRealseData(10000)) && p('id') && e('0'); //获取parent为10000的首个发布的id
|
||||
/* GetDataByProject(TABLE_RELEASE, $projectID, $type). */
|
||||
r($t->getReleaseData(131)) && p('id') && e('1'); //获取parent为132的首个发布的id
|
||||
r($t->getReleaseData(132)) && p('id') && e('6'); //获取parent为132的首个发布的id
|
||||
r($t->getReleaseData(10000)) && p('id') && e('0'); //获取parent为10000的首个发布的id
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* getParentName
|
||||
* Get parentName.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
|
||||
@@ -21,7 +21,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* getByStatus
|
||||
* Get executions by status.
|
||||
*
|
||||
* @param string $status
|
||||
* @access public
|
||||
@@ -42,7 +42,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* getByProject
|
||||
* Get executions by project.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
@@ -60,7 +60,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* getListByOrder
|
||||
* Get executions by order.
|
||||
*
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
|
||||
@@ -24,7 +24,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* getTeamMemberPairs
|
||||
* Get team member pairs.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
|
||||
@@ -24,7 +24,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* checkMembers
|
||||
* Check members.
|
||||
*
|
||||
* @param array $members
|
||||
* @param array $users
|
||||
@@ -41,7 +41,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* getTeamMembers
|
||||
* Get team memberm.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param array $users
|
||||
|
||||
Executable
+54
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::start();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class Tester
|
||||
{
|
||||
public function __construct($user)
|
||||
{
|
||||
global $tester;
|
||||
|
||||
su($user);
|
||||
$this->project = $tester->loadModel('project');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check project status after start a project.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkStatus($projectID)
|
||||
{
|
||||
$oldProject = $this->project->getById($projectID);
|
||||
if($oldProject->status != 'suspended' and $oldProject->status != 'wait') return false;
|
||||
|
||||
$change = $this->project->start($projectID);
|
||||
|
||||
$project = $this->project->getById($projectID);
|
||||
if($project->status != 'doing') return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
$t = new Tester('admin');
|
||||
|
||||
/* Start($projectID). */
|
||||
r($t->checkStatus(81)) && p() && e('1'); // 开始id为81状态是suspended的项目
|
||||
r($t->checkStatus(83)) && p() && e('1'); // 开始id为83状态是wait的项目
|
||||
r($t->checkStatus(82)) && p() && e('0'); // 开始id为82状态是closed的项目
|
||||
r($t->checkStatus(85)) && p() && e('0'); // 开始id为85状态是doing的项目
|
||||
|
||||
@@ -24,7 +24,7 @@ class Tester
|
||||
}
|
||||
|
||||
/**
|
||||
* checkStatus
|
||||
* Check project status after suspend a project.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
|
||||
Reference in New Issue
Block a user