This commit is contained in:
王怡栋
2022-04-08 10:18:12 +08:00
31 changed files with 582 additions and 76 deletions
+1
View File
@@ -1628,6 +1628,7 @@ class block extends control
}
$overviewPercent = array();
$this->app->loadLang('project');
foreach($this->lang->project->statusList as $statusKey => $statusName)
{
if(!isset($overview[$statusKey])) $overview[$statusKey] = 0;
+3 -2
View File
@@ -253,15 +253,16 @@ class branch extends control
* @param int $oldBranch
* @param string $param
* @param int $projectID
* @param bool $withMainBranch
* @access public
* @return void
*/
public function ajaxGetBranches($productID, $oldBranch = 0, $param = 'all', $projectID = 0)
public function ajaxGetBranches($productID, $oldBranch = 0, $param = 'all', $projectID = 0, $withMainBranch = true)
{
$product = $this->loadModel('product')->getById($productID);
if(empty($product) or $product->type == 'normal') return;
$branches = $this->loadModel('branch')->getList($productID, $projectID, $param);
$branches = $this->loadModel('branch')->getList($productID, $projectID, $param, 'order', null, $withMainBranch);
$branchOption = array();
$branchTagOption = array();
foreach($branches as $branchInfo)
+6 -2
View File
@@ -43,10 +43,11 @@ class branchModel extends model
* @param string $browseType
* @param string $orderBy
* @param object $pager
* @param bool $withMainBranch
* @access public
* @return array
*/
public function getList($productID, $executionID = 0, $browseType = 'active', $orderBy = 'order', $pager = null)
public function getList($productID, $executionID = 0, $browseType = 'active', $orderBy = 'order', $pager = null, $withMainBranch = true)
{
$executionBranches = array();
if($executionID)
@@ -54,7 +55,8 @@ class branchModel extends model
$executionBranches = $this->dao->select('branch')->from(TABLE_PROJECTPRODUCT)
->where('project')->eq($executionID)
->andWhere('product')->eq($productID)
->fetchAll('branch');
->fetchPairs('branch');
if(in_array(BRANCH_MAIN, $executionBranches)) $withMainBranch = true;
if(empty($executionBranches)) return array();
}
@@ -73,6 +75,8 @@ class branchModel extends model
$defaultBranch = BRANCH_MAIN;
foreach($branchList as $branch) $defaultBranch = $branch->default ? $branch->id : $defaultBranch;
if(!$withMainBranch) return $branchList;
/* Display the main branch under all and active page. */
$mainBranch = new stdclass();
$mainBranch->id = BRANCH_MAIN;
+1
View File
@@ -278,6 +278,7 @@ class company extends control
$this->loadModel('search')->setSearchParams($this->config->company->dynamic->search);
/* Assign. */
$this->view->recTotal = $recTotal;
$this->view->browseType = $browseType;
$this->view->account = $account;
$this->view->accountPairs = $accountPairs;
+3 -1
View File
@@ -137,7 +137,9 @@ class companyModel extends model
*/
public function update()
{
$company = fixer::input('post')->get();
$company = fixer::input('post')
->stripTags('name')
->get();
if($company->website == 'http://') $company->website = '';
if($company->backyard == 'http://') $company->backyard = '';
$companyID = $this->app->company->id;
+1
View File
@@ -22,6 +22,7 @@
if($period == $browseType)
{
$active = 'btn-active-text';
$pager->recTotal = $recTotal ? $recTotal : $pager->recTotal;
$label .= " <span class='label label-light label-badge'>{$pager->recTotal}</span>";
}
echo html::a(inlink('dynamic', "browseType=$period&param=&recTotal=0&date=&direction=next&userID=$userID&productID=$productID&projectID=$projectID&executionID=$executionID&orderBy=$orderBy"), $label, '', "class='btn btn-link $active' id='{$period}'")
+1 -1
View File
@@ -54,7 +54,7 @@ $config->custom->fieldList['task']['finish'] = 'comment';
$config->custom->fieldList['task']['activate'] = 'assignedTo,comment';
$config->custom->fieldList['build'] = 'scmPath,filePath,desc';
$config->custom->fieldList['bug']['create'] = 'module,project,deadline,type,os,browser,severity,pri,steps,keywords';
$config->custom->fieldList['bug']['edit'] = 'plan,assignedTo,deadline,type,os,browser,severity,pri,steps,keywords';
$config->custom->fieldList['bug']['edit'] = 'plan,project,assignedTo,deadline,type,os,browser,severity,pri,steps,keywords';
$config->custom->fieldList['bug']['resolve'] = 'resolvedBuild,resolvedDate,assignedTo,comment';
$config->custom->fieldList['testcase']['create'] = 'stage,story,pri,precondition,keywords';
$config->custom->fieldList['testcase']['edit'] = 'stage,story,pri,precondition,keywords,status';
+1
View File
@@ -47,3 +47,4 @@
.tree-group .tree-actions {display: none; position: absolute; right: 0; top: 0; background-color: #fff; white-space: nowrap;}
.tree-group:hover > .module-name {width: calc(100% - 20px);}
.tree-group:hover .tree-actions {display: block}
.tree li.has-list.open:before {left: 6px;}
+20 -19
View File
@@ -2036,7 +2036,8 @@ class execution extends control
public function kanban($executionID, $browseType = 'all', $orderBy = 'id_asc', $groupBy = 'default')
{
$this->app->loadLang('bug');
$this->app->loadLang('story');
$this->loadModel('story');
if(empty($groupBy)) $groupBy = 'default';
$this->session->set('execLaneType', $browseType);
@@ -2104,6 +2105,7 @@ class execution extends control
$this->view->kanbanData = $kanbanData;
$this->view->executionActions = $executionActions;
$this->view->kanban = $this->lang->execution->kanban;
$this->view->reviewStoryParis = $this->story->getExecutionStoryPairs($execution->id, 0, 'all', 0, 'full', 'review');
$this->display();
}
@@ -2129,9 +2131,9 @@ class execution extends control
$this->app->session->set('kanbanType', $browseType, 'execution');
/* Load language. */
$this->app->loadLang('story');
$this->app->loadLang('task');
$this->app->loadLang('bug');
$this->loadModel('story');
$this->loadModel('kanban');
/* Compatibility IE8. */
@@ -2176,23 +2178,22 @@ class execution extends control
$userList['closed']['realname'] = 'Closed';
$userList['closed']['avatar'] = '';
$this->view->title = $this->lang->execution->kanban;
$this->view->position[] = html::a($this->createLink('execution', 'browse', "executionID=$executionID"), $execution->name);
$this->view->position[] = $this->lang->execution->kanban;
$this->view->realnames = $this->loadModel('user')->getPairs('noletter');
$this->view->storyOrder = $orderBy;
$this->view->orderBy = 'id_asc';
$this->view->executionID = $executionID;
$this->view->productID = $productID;
$this->view->productNames = $productNames;
$this->view->productNum = count($products);
$this->view->allPlans = $allPlans;
$this->view->browseType = $browseType;
$this->view->kanbanGroup = $kanbanGroup;
$this->view->execution = $execution;
$this->view->groupBy = $groupBy;
$this->view->canBeChanged = $canBeChanged;
$this->view->userList = $userList;
$this->view->title = $this->lang->execution->kanban;
$this->view->realnames = $this->loadModel('user')->getPairs('noletter');
$this->view->storyOrder = $orderBy;
$this->view->orderBy = 'id_asc';
$this->view->executionID = $executionID;
$this->view->productID = $productID;
$this->view->productNames = $productNames;
$this->view->productNum = count($products);
$this->view->allPlans = $allPlans;
$this->view->browseType = $browseType;
$this->view->kanbanGroup = $kanbanGroup;
$this->view->execution = $execution;
$this->view->groupBy = $groupBy;
$this->view->canBeChanged = $canBeChanged;
$this->view->userList = $userList;
$this->view->reviewStoryParis = $this->story->getExecutionStoryPairs($execution->id, 0, 'all', 0, 'full', 'review');
$this->display();
}
+1 -1
View File
@@ -155,7 +155,7 @@ function loadBranches(product)
var projectID = (typeof(systemMode) != 'undefined' && systemMode == 'new') ? $('#project').val() : 0;
var index = $inputgroup.find('select:first').attr('id').replace('products' , '');
$.get(createLink('branch', 'ajaxGetBranches', "productID=" + $(product).val() + "&oldBranch=0&param=active&projectID=" + projectID), function(data)
$.get(createLink('branch', 'ajaxGetBranches', "productID=" + $(product).val() + "&oldBranch=0&param=active&projectID=" + projectID + "&withMainBranch="), function(data)
{
if(data)
{
+8 -2
View File
@@ -461,8 +461,8 @@ function renderStoryItem(item, $item, col)
var $title = $item.find('.title');
if(!$title.length)
{
$title = $('<a class="title iframe" data-width="95%">' + (scaleSize <= 1 ? '<i class="icon icon-lightbulb text-muted"></i> ' : '') + '<span class="text"></span></a>')
.attr('href', $.createLink('story', 'view', 'storyID=' + item.id + '&version=0&param=' + execution.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '80%');
$title = $('<a class="title iframe">' + (scaleSize <= 1 ? '<i class="icon icon-lightbulb text-muted"></i> ' : '') + '<span class="text"></span></a>')
.attr('href', $.createLink('story', 'view', 'storyID=' + item.id + '&version=0&param=' + execution.id, '', true)).attr('data-toggle', 'modal').attr('data-width', '95%');
$title.appendTo($item);
}
$title.attr('title', item.title).find('.text').text(item.title);
@@ -959,6 +959,12 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car
{
if(toColType == 'ready' || toColType == 'backlog')
{
if(toColType == 'ready' && typeof(reviewStoryParis[objectID]) != 'undefined')
{
bootbox.alert(executionLang.storyDragError);
return false;
}
var link = createLink('kanban', 'ajaxMoveCard', 'cardID=' + objectID + '&fromColID=' + fromColID + '&toColID=' + toColID + '&fromLaneID=' + fromLaneID + '&toLaneID=' + toLaneID + '&execitionID=' + executionID + '&browseType=' + browseType + '&groupBy=' + groupBy + '&regionID=' + regionID+ '&orderBy=' + orderBy );
$.ajax(
{
+6
View File
@@ -685,6 +685,12 @@ function changeCardColType(cardID, fromColID, toColID, fromLaneID, toLaneID, car
{
if(toColType == 'ready' || toColType == 'backlog')
{
if(toColType == 'ready' && typeof(reviewStoryParis[objectID]) != 'undefined')
{
bootbox.alert(executionLang.storyDragError);
return false;
}
var link = createLink('kanban', 'ajaxMoveCard', 'cardID=' + objectID + '&fromColID=' + fromColID + '&toColID=' + toColID + '&fromLaneID=' + fromLaneID + '&toLaneID=' + toLaneID + '&execitionID=' + executionID + '&browseType=' + browseType + '&groupBy=' + groupBy);
$.get(link, function(data)
{
+1
View File
@@ -367,6 +367,7 @@ $lang->execution->unresolvedBug = "[%s] unresolved bugs. ";
$lang->execution->projectNotEmpty = 'Project cannot be empty.';
$lang->execution->confirmStoryToTask = $lang->SRCommon . '%s are converted to tasks in the current. Do you want to convert them anyways?';
$lang->execution->ge = "『%s』should be >= actual begin『%s』.";
$lang->execution->storyDragError = "The {$lang->SRCommon} is still a draft or has been changed, please drag it after the review";
/* Statistics. */
$lang->execution->charts = new stdclass();
+1
View File
@@ -367,6 +367,7 @@ $lang->execution->unresolvedBug = "[%s]个未解决的bug,";
$lang->execution->projectNotEmpty = '所属项目不能为空。';
$lang->execution->confirmStoryToTask = '%s' . $lang->SRCommon . '已经在当前' . $lang->execution->common . '中转了任务,请确认是否重复转任务。';
$lang->execution->ge = "『%s』应当不小于实际开始时间『%s』。";
$lang->execution->storyDragError = "该{$lang->SRCommon}还是草稿或已变更状态,请评审通过后再拖动";
/* 统计。*/
$lang->execution->charts = new stdclass();
+1
View File
@@ -51,6 +51,7 @@ js::set('projectID', $projectID);
js::set('vision', $this->config->vision);
js::set('productCount', count($productNames));
js::set('executionID', $execution->id);
js::set('reviewStoryParis', $reviewStoryParis);
$canSortRegion = commonModel::hasPriv('kanban', 'sortRegion') && count($regions) > 1;
$canEditRegion = commonModel::hasPriv('kanban', 'editRegion');
@@ -211,4 +211,5 @@ js::set('priv',
<?php js::set('entertime', time());?>
<?php js::set('fluidBoard', $execution->fluidBoard);?>
<?php js::set('displayCards', $execution->displayCards);?>
<?php js::set('reviewStoryParis', $reviewStoryParis);?>
<?php include '../../common/view/footer.html.php';?>
+1 -1
View File
@@ -83,7 +83,7 @@ class productplanModel extends model
$date = date('Y-m-d');
$plans = $this->dao->select('*')->from(TABLE_PRODUCTPLAN)->where('product')->eq($product)
->andWhere('deleted')->eq(0)
->beginIF(!empty($branch))->andWhere('branch')->eq($branch)->fi()
->beginIF(!empty($branch) and $branch != 'all')->andWhere('branch')->eq($branch)->fi()
->beginIF($browseType != 'all')->andWhere('status')->eq($browseType)->fi()
->beginIF(strpos($param, 'skipparent') !== false)->andWhere('parent')->ne(-1)->fi()
->orderBy($orderBy)
+1 -1
View File
@@ -360,7 +360,7 @@ class repo extends control
public function browse($repoID = 0, $branchID = '', $objectID = 0, $path = '', $revision = 'HEAD', $refresh = 0)
{
$repoID = $this->repo->saveState($repoID, $objectID);
if($branchID) $branchID = base64_decode($branchID);
if($branchID) $branchID = base64_decode(urldecode($branchID));
/* Get path and refresh. */
if($this->get->repoPath) $path = $this->get->repoPath;
+1 -1
View File
@@ -31,7 +31,7 @@
foreach($branches as $id => $branchName)
{
$isSelected = $id == $branchID ? 'class="selected"' : '';
$base64BranchID = base64_encode($id);
$base64BranchID = urlencode(base64_encode($id));
echo "<li $isSelected>" . html::a($this->createLink('repo', 'browse', "repoID=$repoID&branchID=$base64BranchID&objectID=$objectID"), $branchName, '', "title='{$branchName}' class='text-ellipsis' data-app='{$app->tab}'") . "</li>";
}
?>
+1
View File
@@ -268,6 +268,7 @@ $lang->story->specTemplate = "As a < type of user >, I want < some goal
$lang->story->needNotReview = 'No Review';
$lang->story->successSaved = "Story is saved!";
$lang->story->confirmDelete = "Do you want to delete this story?";
$lang->story->confirmRecall = "Do you want to recall this story?";
$lang->story->errorEmptyChildStory = '『Decomposed Stories』canot be blank.';
$lang->story->errorNotSubdivide = "If the status is not active, or the stage is not wait, or a sub story, it cannot be subdivided.";
$lang->story->errorEmptyReviewedBy = "『ReviewedBy』canot be blank.";
+1
View File
@@ -268,6 +268,7 @@ $lang->story->specTemplate = "建议参考的模板:作为一名<某
$lang->story->needNotReview = '不需要评审';
$lang->story->successSaved = "{$lang->SRCommon}成功添加,";
$lang->story->confirmDelete = "您确认删除该{$lang->SRCommon}吗?";
$lang->story->confirmRecall = "您确认撤销该{$lang->SRCommon}吗?";
$lang->story->errorEmptyChildStory = "『细分{$lang->SRCommon}』不能为空。";
$lang->story->errorNotSubdivide = "状态不是激活,或者阶段不是未开始的{$lang->SRCommon},或者是子需求,则不能细分。";
$lang->story->errorEmptyReviewedBy = "『由谁评审』不能为空。";
+2 -1
View File
@@ -2873,7 +2873,7 @@ class storyModel extends model
* @param int $branch
* @param array|string $moduleIdList
* @param string $type full|short
* @param string $status all|unclosed
* @param string $status all|unclosed|review
* @access public
* @return array
*/
@@ -2890,6 +2890,7 @@ class storyModel extends model
->beginIF($branch !== 'all')->andWhere('t2.branch')->eq($branch)->fi()
->beginIF($moduleIdList)->andWhere('t2.module')->in($moduleIdList)->fi()
->beginIF($status == 'unclosed')->andWhere('t2.status')->ne('closed')->fi()
->beginIF($status == 'review')->andWhere('t2.status')->in('draft,changed')->fi()
->orderBy('t1.`order` desc')
->fetchAll('id');
return empty($stories) ? array() : $this->formatStories($stories, $type);
+2 -2
View File
@@ -8,8 +8,8 @@ $(function()
{
if(!password1Encrypted && !password2Encrypted)
{
var password1 = $('#password1').val();
var password2 = $('#password2').val();
var password1 = $('#password1').val().trim();
var password2 = $('#password2').val().trim();
var passwordStrength = computePasswordStrength(password1);
if($("form input[name=passwordStrength]").length == 0) $('#submit').after("<input type='hidden' name='passwordStrength' value='0' />");
+23 -20
View File
@@ -98,6 +98,14 @@ class designTest
return $objects;
}
/**
* Function assign test by desgin
*
* @param int $designID
* @param array $param
* @access public
* @return array
*/
public function assignTest($designID, $param = array())
{
global $tester;
@@ -118,12 +126,25 @@ class designTest
return $objects;
}
public function linkCommitTest($designID = 0, $repoID = 0)
public function linkCommitTest($designID, $repoID, $param = array())
{
$objects = $this->objectModel->linkCommit($designID = 0, $repoID = 0);
global $tester;
$revision = array();
$createFields = array('revision' => $revision);
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
$this->objectModel->linkCommit($designID, $repoID);
unset($_POST);
if(dao::isError()) return dao::getError();
$objects = $tester->dao->select('*')->from(TABLE_DESIGN)->where('id')->eq($designID)->fetchAll();
return $objects;
}
@@ -136,24 +157,6 @@ class designTest
return $objects;
}
public function getByIDTest($designID = 0)
{
$objects = $this->objectModel->getByID($designID = 0);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getPairsTest($productID = 0, $type = 'all')
{
$objects = $this->objectModel->getPairs($productID = 0, $type = 'all');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getAffectedScopeTest($design = 0)
{
$objects = $this->objectModel->getAffectedScope($design = 0);
+456
View File
@@ -0,0 +1,456 @@
<?php
class testcaseTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('testcase');
}
/**
* Test get cases of a module.
*
* @param int $productID
* @param int $branch
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param string $browseType
* @param string $auto
* @access public
* @return array
*/
public function getModuleCasesTest($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
{
$objects = $this->objectModel->getModuleCases($productID, $branch, $moduleIdList, $orderBy, $pager, $browseType, $auto);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get project cases of a module.
*
* @param int $productID
* @param int $branch
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param string $browseType
* @param string $auto
* @access public
* @return array
*/
public function getModuleProjectCasesTest($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $browseType = '', $auto = 'no')
{
$objects = $this->objectModel->getModuleProjectCases($productID, $branch, $moduleIdList, $orderBy, $pager, $browseType, $auto);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getProjectCasesTest($projectID, $orderBy = 'id_desc', $pager = null, $browseType = '')
{
$objects = $this->objectModel->getProjectCases($projectID, $orderBy = 'id_desc', $pager = null, $browseType = '');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get execution cases.
*
* @param int $executionID
* @param string $orderBy
* @param object $pager
* @param string $browseType
* @access public
* @return string
*/
public function getExecutionCasesTest($executionID, $orderBy = 'id_desc', $pager = null, $browseType = '')
{
$objects = $this->objectModel->getExecutionCases($executionID, $orderBy, $pager, $browseType);
if(dao::isError()) return dao::getError();
return $browseType == 'all' ? $objects : count($objects);
}
/**
* Test get cases by suite.
*
* @param int $productID
* @param int $branch
* @param int $suiteID
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @param string $auto
* @access public
* @return array
*/
public function getBySuiteTest($productID, $branch = 0, $suiteID = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no')
{
$objects = $this->objectModel->getBySuite($productID, $branch, $suiteID, $moduleIdList, $orderBy, $pager, $auto);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get case info by ID.
*
* @param int $caseID
* @param int $version
* @access public
* @return object
*/
public function getByIdTest($caseID, $version = 0)
{
$object = $this->objectModel->getById($caseID, $version = 0);
if(dao::isError()) return dao::getError();
return $object;
}
/**
* Test get case list.
*
* @param string $caseIDList
* @access public
* @return array
*/
public function getByListTest($caseIDList = 0)
{
$objects = $this->objectModel->getByList($caseIDList = 0);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getTestCasesTest($productID, $branch, $browseType, $queryID, $moduleID, $sort, $pager, $auto = 'no')
{
$objects = $this->objectModel->getTestCases($productID, $branch, $browseType, $queryID, $moduleID, $sort, $pager, $auto = 'no');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get cases by assignedTo.
*
* @param string $account
* @param string $orderBy
* @param object $pager
* @param string $auto
* @access public
* @return string
*/
public function getByAssignedToTest($account, $orderBy = 'id_desc', $pager = null, $auto = 'no')
{
$objects = $this->objectModel->getByAssignedTo($account, $orderBy = 'id_desc', $pager = null, $auto = 'no');
if(dao::isError()) return dao::getError();
$ids = implode(array_keys($objects), ',');
return $ids;
}
/**
* Test get cases by openedBy
*
* @param string $account
* @param string $orderBy
* @param object $pager
* @param string $auto
* @access public
* @return array
*/
public function getByOpenedByTest($account, $orderBy = 'id_desc', $pager = null, $auto = 'no')
{
$objects = $this->objectModel->getByOpenedBy($account, $orderBy = 'id_desc', $pager = null, $auto = 'no');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getByStatusTest($productID = 0, $branch = 0, $type = 'all', $status = 'all', $moduleID = 0, $orderBy = 'id_desc', $pager = null, $auto = 'no')
{
$objects = $this->objectModel->getByStatus($productID, $branch, $type, $status, $moduleID, $orderBy, $pager, $auto);
if(dao::isError()) return dao::getError();
return count($objects);
}
public function getStoryCasesTest($storyID)
{
$objects = $this->objectModel->getStoryCases($storyID);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get counts of some stories' cases.
*
* @param array $stories
* @access public
* @return void
*/
public function getStoryCaseCountsTest($stories)
{
$counts = $this->objectModel->getStoryCaseCounts($stories);
if(dao::isError()) return dao::getError();
return $counts;
}
public function updateTest($caseID)
{
$objects = $this->objectModel->update($caseID);
if(dao::isError()) return dao::getError();
return $objects;
}
public function reviewTest($caseID)
{
$objects = $this->objectModel->review($caseID);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test batch review cases.
*
* @param array $caseIdList
* @param string $result
* @access public
* @return array
*/
public function batchReviewTest($caseIdList, $result)
{
$objects = $this->objectModel->batchReview($caseIdList, $result);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getCases2LinkTest($caseID, $browseType = 'bySearch', $queryID = 0)
{
$objects = $this->objectModel->getCases2Link($caseID, $browseType = 'bySearch', $queryID = 0);
if(dao::isError()) return dao::getError();
return $objects;
}
public function batchUpdateTest($param = array())
{
$batchUpdateField['caseIDList'] = array('1' => 1, '2' => 2, '3' => 3, '4' => 4);
$batchUpdateField['pris'] = array('1' => 1, '2' => 2, '3' => 3, '4' => 4);
$batchUpdateField['statuses'] = array('1' => 'wait', '2' => 'normal', '3' => 'blocked', '4' => 'investigate');
$batchUpdateField['modules'] = array('1' => 0, '2' => 0, '3' => 0, '4' => 0);
$batchUpdateField['branches'] = array('1' => 0, '2' => 0, '3' => 0, '4' => 0);
$batchUpdateField['story'] = array('1' => 0, '2' => 0, '3' => 0, '4' => 0);
$batchUpdateField['product'] = array('1' => 1, '2' => 1, '3' => 1, '4' => 1);
$batchUpdateField['title'] = array('1' => '这个是测试用例1', '2' => '这个是测试用例2', '3' => '这个是测试用例3', '4' => '这个是测试用例4');
$batchUpdateField['color'] = array('1' => '#3da7f5', '2' => '#75c941', '3' => '#2dbdb2', '4' => '#797ec9');
$batchUpdateField['types'] = array('1' => 'feature', '2' => 'performance', '3' => 'config', '4' => 'install');
$batchUpdateField['precondition'] = array('1' => '这是前置条件1', '2' => '这是前置条件2', '3' => '这是前置条件3', '4' => '这是前置条件4');
$batchUpdateField['keywords'] = array('1' => '这是关键词1', '2' => '这是关键词2', '3' => '这是关键词3', '4' => '这是关键词4');
$batchUpdateField['stages'] = array('1' => array('unittest'), '2' => array('feature'), '3' => array('intergrate'), '4' => array('system'));
foreach($batchUpdateField as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
$objects = $this->objectModel->batchUpdate();
unset($_POST);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test batch change branch.
*
* @param array $caseIDList
* @param int $branchID
* @access public
* @return array
*/
public function batchChangeBranchTest($caseIDList, $branchID)
{
$this->objectModel->batchChangeBranch($caseIDList, $branchID);
if(dao::isError()) return dao::getError();
$objects = $this->objectModel->getByList($caseIDList);
return $objects;
}
/**
* Test batch change module.
*
* @param array $caseIDList
* @param int $moduleID
* @access public
* @return array
*/
public function batchChangeModuleTest($caseIDList, $moduleID)
{
$this->objectModel->batchChangeModule($caseIDList, $moduleID);
if(dao::isError()) return dao::getError();
$objects = $this->objectModel->getByList($caseIDList);
return $objects;
}
/**
* Test batch case type change.
*
* @param array $caseIdList
* @param string $result
* @access public
* @return array
*/
public function batchCaseTypeChangeTest($caseIdList, $result)
{
$this->objectModel->batchCaseTypeChange($caseIdList, $result);
if(dao::isError()) return dao::getError();
$objects = $this->objectModel->getByList($caseIdList);
return $objects;
}
public function joinStepTest($steps)
{
$objects = $this->objectModel->joinStep($steps);
if(dao::isError()) return dao::getError();
return $objects;
}
public function createFromImportTest($productID, $branch = 0)
{
$objects = $this->objectModel->createFromImport($productID, $branch = 0);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get fields for import.
*
* @param int $productID
* @access public
* @return array
*/
public function getImportFieldsTest($productID = 0)
{
$object = $this->objectModel->getImportFields($productID);
if(dao::isError()) return dao::getError();
return $object;
}
public function importFromLibTest($productID)
{
$objects = $this->objectModel->importFromLib($productID);
if(dao::isError()) return dao::getError();
return $objects;
}
public function buildSearchFormTest($productID, $products, $queryID, $actionURL, $projectID = 0)
{
$objects = $this->objectModel->buildSearchForm($productID, $products, $queryID, $actionURL, $projectID = 0);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test append bugs and results.
*
* @param array $cases
* @param string $type
* @access public
* @return array
*/
public function appendDataTest($cases, $type = 'case')
{
$objects = $this->objectModel->appendData($cases, $type = 'case');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test check whether force not review.
*
* @access public
* @return int
*/
public function forceNotReviewTest()
{
$object = $this->objectModel->forceNotReview();
if(dao::isError()) return dao::getError();
return $object ? 1 : 2;
}
public function syncCase2ProjectTest($case, $caseID)
{
$objects = $this->objectModel->syncCase2Project($case, $caseID);
if(dao::isError()) return dao::getError();
return $objects;
}
public function updateCase2ProjectTest($oldCase, $case, $caseID)
{
$objects = $this->objectModel->updateCase2Project($oldCase, $case, $caseID);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getStatusTest($methodName, $case = null)
{
$objects = $this->objectModel->getStatus($methodName, $case = null);
if(dao::isError()) return dao::getError();
return $objects;
}
}
+1 -1
View File
@@ -8,7 +8,7 @@ INSERT INTO `zt_config` (`id`, `vision`, `owner`, `module`, `section`, `key`, `v
(6, 'rnd', 'system', 'project', '', 'unitList', 'CNY,USD'),
(7, 'rnd', 'system', 'project', '', 'defaultCurrency', 'CNY'),
(8, 'rnd', 'system', 'story', '', 'reviewRules', 'allpass'),
(10, 'rnd', 'system', 'common', 'global', 'version', '16.5.beta1'),
(10, 'rnd', 'system', 'common', 'global', 'version', '16.5'),
(11, 'rnd', 'system', 'common', 'global', 'sn', 'c8aa3269e181f2b9258ce96625de1497'),
(12, 'rnd', 'system', 'common', 'global', 'flow', 'full'),
(13, 'rnd', 'system', 'common', 'safe', 'mode', '1'),
+5 -2
View File
@@ -11,7 +11,10 @@ cid=1
pid=1
*/
global $tester;
$design = $tester->loadModel('design');
$design = new designTest();
$designIDList = array('0', '1');
r($design->getByIDTest()) && p() && e();
r($design->getByID($designIDList[1])) && p('name') && e('这是一个设计1');//正常根据id查询
r($design->getByID($designIDList[0])) && p() && e('0'); //查询不存在的设计id
+10 -2
View File
@@ -11,7 +11,15 @@ cid=1
pid=1
*/
global $tester;
$design = $tester->loadModel('design');
$design = new designTest();
$productIDList = array('0', '31');
$types = array('all', 'HLDS', 'DDS', 'DBDS', 'ADS', '0');
r($design->getPairsTest()) && p() && e();
r($design->getPairs($productIDList[0], $types[1])) && p() && e('0'); //查询不存在的产品
r($design->getPairs($productIDList[1], $types[0])) && p() && e('0'); //查询不存在的类型
r($design->getPairs($productIDList[1], $types[1])) && p('1') && e('1:这是一个设计1');//查询HLDS设计
r($design->getPairs($productIDList[1], $types[2])) && p('2') && e('2:这是一个设计2');//查询DDS设计
r($design->getPairs($productIDList[1], $types[3])) && p('3') && e('3:这是一个设计3');//查询DBDS设计
r($design->getPairs($productIDList[1], $types[4])) && p('4') && e('4:这是一个设计4');//查询ADS设计
-17
View File
@@ -1,17 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/design.class.php';
su('admin');
/**
title=测试 designModel->linkCommit();
cid=1
pid=1
*/
$design = new designTest();
r($design->linkCommitTest()) && p() && e();
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/design.class.php';
su('admin');
/**
title=测试 designModel->linkCommit();
cid=1
pid=1
*/
$designIDList = array('0', '1');
$repoIDList = array('0', '1');
$revision = array('24', '25', '26', '27');
$normalLink = array('revision' => $revision);
$design = new designTest();
var_dump($design->linkCommitTest($designIDList[1], $repoIDList[1], $normalLink));die;
r($design->linkCommitTest()) && p() && e();