Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/tianshujie_bug19813
This commit is contained in:
@@ -68,7 +68,7 @@ class productEntry extends Entry
|
||||
$product->actions = $this->loadModel('action')->processActionForAPI($actions, $users, $this->lang->product);
|
||||
break;
|
||||
case 'lastexecution':
|
||||
$execution = $this->dao->select('t2.id,t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
$execution = $this->dao->select('t2.id,t2.name,t2.type')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
|
||||
->where('t2.deleted')->eq(0)
|
||||
->andWhere('t1.product')->eq($productID)
|
||||
|
||||
@@ -95,14 +95,12 @@ class storyEntry extends Entry
|
||||
$oldStory = $this->loadModel('story')->getByID($storyID);
|
||||
|
||||
/* Set $_POST variables. */
|
||||
$fields = 'title,product,reviewer,type,plan,module,source,sourceNote,category,pri,estimate,mailto,keywords,uid,stage,notifyEmail';
|
||||
$fields = 'title,product,parent,reviewer,type,plan,module,source,sourceNote,category,pri,estimate,mailto,keywords,uid,stage,notifyEmail';
|
||||
$this->batchSetPost($fields, $oldStory);
|
||||
$this->setPost('parent', 0);
|
||||
|
||||
$control = $this->loadController('story', 'edit');
|
||||
$control->edit($storyID);
|
||||
|
||||
|
||||
$data = $this->getData();
|
||||
|
||||
if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message);
|
||||
|
||||
@@ -261,6 +261,7 @@ $lang->action->label->changestatus = 'changed status';
|
||||
$lang->action->label->marked = 'marked';
|
||||
$lang->action->label->linked2execution = "linked to {$lang->executionCommon}";
|
||||
$lang->action->label->unlinkedfromexecution = "unlinked from {$lang->executionCommon}";
|
||||
$lang->action->label->linked2kanban = 'linked to kanban';
|
||||
$lang->action->label->linked2project = "linked to project";
|
||||
$lang->action->label->unlinkedfromproject = "unlinked from project";
|
||||
$lang->action->label->unlinkedfrombuild = "unlinked Build ";
|
||||
@@ -422,6 +423,7 @@ $lang->action->dynamicAction->story['undeleted'] = 'Restore Story';
|
||||
$lang->action->dynamicAction->story['hidden'] = 'Hide Story';
|
||||
$lang->action->dynamicAction->story['linked2execution'] = "Link Story";
|
||||
$lang->action->dynamicAction->story['unlinkedfromexecution'] = "Unlink Story";
|
||||
$lang->action->dynamicAction->story['linked2kanban'] = "Link Story";
|
||||
$lang->action->dynamicAction->story['estimated'] = "Estimate $lang->SRCommon";
|
||||
|
||||
$lang->action->dynamicAction->execution['opened'] = 'Create ' . $lang->executionCommon;
|
||||
@@ -709,6 +711,7 @@ $lang->action->search->label['linked2project'] = $lang->action->label->li
|
||||
$lang->action->search->label['unlinkedfromproject'] = $lang->action->label->unlinkedfromproject;
|
||||
$lang->action->search->label['linked2execution'] = $lang->action->label->linked2execution;
|
||||
$lang->action->search->label['unlinkedfromexecution'] = $lang->action->label->unlinkedfromexecution;
|
||||
$lang->action->search->label['linked2kanban'] = $lang->action->label->linked2kanban;
|
||||
$lang->action->search->label['started'] = $lang->action->label->started;
|
||||
$lang->action->search->label['restarted'] = $lang->action->label->restarted;
|
||||
$lang->action->search->label['recordestimate'] = $lang->action->label->recordestimate;
|
||||
@@ -790,6 +793,7 @@ $lang->action->apiTitle->changestatus = 'Changed status';
|
||||
$lang->action->apiTitle->marked = 'Marked';
|
||||
$lang->action->apiTitle->linked2execution = "Linked to {$lang->executionCommon}";
|
||||
$lang->action->apiTitle->unlinkedfromexecution = "Unlinked from {$lang->executionCommon}";
|
||||
$lang->action->apiTitle->linked2kanban = 'Linked to Kanban';
|
||||
$lang->action->apiTitle->linked2project = "Linked to project";
|
||||
$lang->action->apiTitle->unlinkedfromproject = "Unlinked from project";
|
||||
$lang->action->apiTitle->unlinkedfrombuild = "Unlinked from build";
|
||||
|
||||
@@ -261,6 +261,7 @@ $lang->action->label->changestatus = '修改状态';
|
||||
$lang->action->label->marked = '编辑了';
|
||||
$lang->action->label->linked2execution = "关联{$lang->executionCommon}";
|
||||
$lang->action->label->unlinkedfromexecution = "移除{$lang->executionCommon}";
|
||||
$lang->action->label->linked2kanban = '关联看板';
|
||||
$lang->action->label->linked2project = "关联项目";
|
||||
$lang->action->label->unlinkedfromproject = "移除项目";
|
||||
$lang->action->label->unlinkedfrombuild = "移除版本";
|
||||
@@ -422,6 +423,7 @@ $lang->action->dynamicAction->story['undeleted'] = "还原{$lang->SR
|
||||
$lang->action->dynamicAction->story['hidden'] = "隐藏{$lang->SRCommon}";
|
||||
$lang->action->dynamicAction->story['linked2execution'] = "关联$lang->SRCommon";
|
||||
$lang->action->dynamicAction->story['unlinkedfromexecution'] = "移除$lang->SRCommon";
|
||||
$lang->action->dynamicAction->story['linked2kanban'] = "关联$lang->SRCommon";
|
||||
$lang->action->dynamicAction->story['estimated'] = "估算$lang->SRCommon";
|
||||
|
||||
$lang->action->dynamicAction->execution['opened'] = '创建' . $lang->executionCommon;
|
||||
@@ -710,6 +712,7 @@ $lang->action->search->label['linked2project'] = $lang->action->label->li
|
||||
$lang->action->search->label['unlinkedfromproject'] = $lang->action->label->unlinkedfromproject;
|
||||
$lang->action->search->label['linked2execution'] = $lang->action->label->linked2execution;
|
||||
$lang->action->search->label['unlinkedfromexecution'] = $lang->action->label->unlinkedfromexecution;
|
||||
$lang->action->search->label['linked2kanban'] = $lang->action->label->linked2kanban;
|
||||
$lang->action->search->label['started'] = $lang->action->label->started;
|
||||
$lang->action->search->label['restarted'] = $lang->action->label->restarted;
|
||||
$lang->action->search->label['recordestimate'] = $lang->action->label->recordestimate;
|
||||
@@ -791,6 +794,7 @@ $lang->action->apiTitle->changestatus = '修改状态';
|
||||
$lang->action->apiTitle->marked = '编辑';
|
||||
$lang->action->apiTitle->linked2execution = "关联{$lang->executionCommon}";
|
||||
$lang->action->apiTitle->unlinkedfromexecution = "移除{$lang->executionCommon}";
|
||||
$lang->action->apiTitle->linked2kanban = '关联看板';
|
||||
$lang->action->apiTitle->linked2project = "关联项目";
|
||||
$lang->action->apiTitle->unlinkedfromproject = "移除项目";
|
||||
$lang->action->apiTitle->unlinkedfrombuild = "移除版本";
|
||||
|
||||
@@ -289,7 +289,7 @@ class actionModel extends model
|
||||
}
|
||||
|
||||
if($actionType == 'unlinkedfromproject' or $actionType == 'linked2project') $record['project'] = (int)$extra ;
|
||||
if($actionType == 'unlinkedfromexecution' or $actionType == 'linked2execution') $record['execution'] = (int)$extra;
|
||||
if(in_array($actionType, array('unlinkedfromexecution', 'linked2execution', 'linked2kanban'))) $record['execution'] = (int)$extra;
|
||||
|
||||
if($record)
|
||||
{
|
||||
@@ -351,7 +351,7 @@ class actionModel extends model
|
||||
{
|
||||
$action->actor = $commiters[$action->actor];
|
||||
}
|
||||
elseif($actionName == 'linked2execution')
|
||||
elseif($actionName == 'linked2execution' or $actionName == 'linked2kanban')
|
||||
{
|
||||
$execution = $this->dao->select('name,type')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch();
|
||||
$name = $execution->name;
|
||||
|
||||
@@ -69,8 +69,8 @@ $(function()
|
||||
var isPrev = $(this).is('.prev');
|
||||
var $activeItem = $nav.children('.active');
|
||||
var $next = $activeItem[isPrev ? 'prev' : 'next']('li:not(.switch-icon)');
|
||||
if ($next.length) $next.find('a').trigger('click');
|
||||
else $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a').trigger('click');
|
||||
if ($next.length) $next.find('a[data-toggle="tab"]').trigger('click');
|
||||
else $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a[data-toggle="tab"]').trigger('click');
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
@@ -84,8 +84,8 @@ $(function()
|
||||
var isPrev = $(this).is('.prev');
|
||||
var $activeItem = $nav.children('.active');
|
||||
var $next = $activeItem[isPrev ? 'prev' : 'next']('li:not(.switch-icon)');
|
||||
if ($next.length) $next.find('a').trigger('click');
|
||||
else $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a').trigger('click');
|
||||
if ($next.length) $next.find('a[data-toggle="tab"]').trigger('click');
|
||||
else $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a[data-toggle="tab"]').trigger('click');
|
||||
e.preventDefault();
|
||||
|
||||
});
|
||||
|
||||
@@ -97,8 +97,8 @@ $(function()
|
||||
var isPrev = $(this).is('.prev');
|
||||
var $activeItem = $nav.children('.active');
|
||||
var $next = $activeItem[isPrev ? 'prev' : 'next']('li:not(.switch-icon)');
|
||||
if ($next.length) $next.find('a').trigger('click');
|
||||
else $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a').trigger('click');
|
||||
if ($next.length) $next.find('a[data-toggle="tab"]').trigger('click');
|
||||
else $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a[data-toggle="tab"]').trigger('click');
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
@@ -69,8 +69,8 @@ $(function()
|
||||
var isPrev = $(this).is('.prev');
|
||||
var $activeItem = $nav.children('.active');
|
||||
var $next = $activeItem[isPrev ? 'prev' : 'next']('li:not(.switch-icon)');
|
||||
if ($next.length) $next.find('a').trigger('click');
|
||||
else $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a').trigger('click');
|
||||
if ($next.length) $next.find('a[data-toggle="tab"]').trigger('click');
|
||||
else $nav.children('li:not(.switch-icon)')[isPrev ? 'last' : 'first']().find('a[data-toggle="tab"]').trigger('click');
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
|
||||
@@ -406,7 +406,8 @@ class bug extends control
|
||||
if(isset($output['executionID']) and isonlybody())
|
||||
{
|
||||
$executionID = $this->post->execution ? $this->post->execution : $output['executionID'];
|
||||
if($executionID == $output['executionID'] and $this->app->tab == 'execution')
|
||||
$execution = $this->loadModel('execution')->getByID($executionID);
|
||||
if($executionID == $output['executionID'] and $this->app->tab == 'execution' and $execution->type == 'kanban')
|
||||
{
|
||||
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $this->session->execLaneType ? $this->session->execLaneType : 'all');
|
||||
$kanbanData = json_encode($kanbanData);
|
||||
@@ -414,7 +415,7 @@ class bug extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true, 'locate' => 'parent'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,3 +3,4 @@
|
||||
.table-data tr > td {word-break: break-all; word-wrap: break-word;}
|
||||
.side-col .cell {padding: 0px;}
|
||||
.tab-pane table {border: 1px solid #ddd; border-top: none;}
|
||||
.btn-edit-comment {z-index: 100;}
|
||||
|
||||
@@ -2665,7 +2665,14 @@ class bugModel extends model
|
||||
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where($bugQuery)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('execution')->in('0,' . $this->app->user->view->sprints)->fi()
|
||||
->beginIF($excludeBugs)->andWhere('id')->notIN($excludeBugs)->fi()
|
||||
->beginIF($projectID)->andWhere('project')->eq($projectID)->fi()
|
||||
|
||||
->beginIF($projectID)
|
||||
->andWhere('project', true)->eq($projectID)
|
||||
->orWhere('project')->eq(0)
|
||||
->andWhere('openedBuild')->eq('trunk')
|
||||
->markRight(1)
|
||||
->fi()
|
||||
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy($orderBy)->page($pager)->fetchAll();
|
||||
return $bugs;
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
if(count($moduleOptionMenu) == 1)
|
||||
{
|
||||
echo "<span class='input-group-btn'>";
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$libID&view=caselib¤tModuleID=0", 'html', true), "<i class='icon icon-cog'></i>", '', "data-toggle='tooltip' class='btn iframe' title='{$lang->tree->manage}'");
|
||||
echo html::a($this->createLink('tree', 'browse', "rootID=$libID&view=caselib¤tModuleID=0", 'html', true), "<i class='icon icon-cog'></i>", '', "data-toggle='tooltip' class='btn iframe' data-width='95%' title='{$lang->tree->manage}'");
|
||||
echo '</span>';
|
||||
echo "<span class='input-group-btn'>";
|
||||
echo html::a("javascript:void(0)", "<i class='icon icon-refresh'></i>", '', "class='btn refresh' title='{$lang->refresh}' onclick='loadLibModules($libID)'");
|
||||
|
||||
@@ -3261,7 +3261,7 @@ class execution extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function all($status = 'all', $projectID = 0, $orderBy = 'order_asc', $productID = 0, $recTotal = 0, $recPerPage = 10, $pageID = 1)
|
||||
public function all($status = 'all', $projectID = 0, $orderBy = 'order_asc', $productID = 0, $recTotal = 0, $recPerPage = 100, $pageID = 1)
|
||||
{
|
||||
$this->app->loadLang('my');
|
||||
$this->app->loadLang('product');
|
||||
|
||||
@@ -2364,6 +2364,7 @@ class executionModel extends model
|
||||
$this->linkCases($executionID, (int)$products[$storyID], $storyID);
|
||||
|
||||
$action = $executionID == $this->session->project ? 'linked2project' : 'linked2execution';
|
||||
if($action == 'linked2execution' and $execution->type == 'kanban') $action = 'linked2kanban';
|
||||
$this->action->create('story', $storyID, $action, '', $executionID);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ $lang->my->executionLinkList = array();
|
||||
if($config->systemMode == 'new')
|
||||
{
|
||||
$lang->my->executionLinkList['execution-all'] = 'Enter the execution list by default, you can view all executions';
|
||||
$lang->my->executionLinkList['execution-task'] = 'By default, enter the list of the most recently executed task or kanban view, and you can view the task information under the current iteration';
|
||||
$lang->my->executionLinkList['execution-task'] = 'By default, enter the list of the most recently executed task, and you can view the task information under the current iteration';
|
||||
$lang->my->executionLinkList['execution-executionkanban'] = 'By default, you can enter the execution Kanban to view the execution status of projects in progress';
|
||||
}
|
||||
if($config->systemMode == 'classic') $lang->my->executionLinkList['execution-task'] = "By default, enter the list of the most recently {$lang->executionCommon} task, and you can view the task information under the current {$lang->executionCommon}";
|
||||
|
||||
@@ -115,7 +115,7 @@ $lang->my->executionLinkList = array();
|
||||
if($config->systemMode == 'new')
|
||||
{
|
||||
$lang->my->executionLinkList['execution-all'] = '默认进入执行列表,可以查看所有的执行';
|
||||
$lang->my->executionLinkList['execution-task'] = '默认进入最近一个执行的任务列表或看板视图,可以查看当前迭代下的任务信息';
|
||||
$lang->my->executionLinkList['execution-task'] = '默认进入最近一个执行的任务列表,可以查看当前迭代下的任务信息';
|
||||
$lang->my->executionLinkList['execution-executionkanban'] = '默认进入执行看板,可以查看进行中项目的执行情况';
|
||||
}
|
||||
if($config->systemMode == 'classic') $lang->my->executionLinkList['execution-task'] = "默认进入最近一个{$lang->executionCommon}的任务列表,可以查看当前{$lang->executionCommon}下的任务信息";
|
||||
|
||||
@@ -109,7 +109,10 @@
|
||||
</td>
|
||||
<td><span class='label-pri <?php echo 'label-pri-' . $bug->pri?>' title='<?php echo zget($lang->bug->priList, $bug->pri);?>'><?php echo zget($lang->bug->priList, $bug->pri)?></span></td>
|
||||
<td class="text-center"><span class='<?php echo $bug->confirmed == '1' ? 'confirmed' : 'unconfirmed';?>' title='<?php echo zget($lang->bug->confirmedList, $bug->confirmed);?>'><?php echo zget($lang->bug->confirmedList, $bug->confirmed)?></span></td>
|
||||
<td class='text-left nobr'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title, null, "style='color: $bug->color' title='{$bug->title}'");?></td>
|
||||
<td class='text-left nobr'>
|
||||
<?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title, null, "style='color: $bug->color' title='{$bug->title}'");?>
|
||||
<?php if($bug->case) echo html::a(helper::createLink('testcase', 'view', "caseID=$bug->case&version=$bug->caseVersion"), "[" . $this->lang->testcase->common . "#$bug->case]", '', "class='bug' title='$bug->case'");?>
|
||||
</td>
|
||||
<?php $param = $config->productLink == 'product-all' ? '' : "productID=$bug->product";?>
|
||||
<td class='text-left nobr'>
|
||||
<?php
|
||||
|
||||
@@ -401,7 +401,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
|
||||
$misc = $canBatchClose ? "onclick=\"setFormAction('$actionLink', '', '#productStoryForm')\"" : '';
|
||||
echo "<li $class>" . html::a('#', $lang->close, '', $misc) . "</li>";
|
||||
|
||||
if($canBatchUnlink) echo "<li $class>" . html::a('#', $lang->story->unlink, '', "id='batchUnlinkStory'") . "</li>";
|
||||
if($canBatchUnlink) echo '<li>' . html::a('#', $lang->story->unlink, '', "id='batchUnlinkStory'") . "</li>";
|
||||
|
||||
if($canBatchReview)
|
||||
{
|
||||
|
||||
@@ -125,7 +125,7 @@ class programplan extends control
|
||||
$this->programplan->create($projectID, $this->productID, $planID);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
$locate = $this->createLink('project', 'execution', "status=all&projectID=$projectID");
|
||||
$locate = $this->createLink('project', 'execution', "status=all&projectID=$projectID&orderBy=order_asc&productID=$productID");
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
|
||||
}
|
||||
|
||||
|
||||
@@ -910,7 +910,7 @@ class project extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function execution($status = 'all', $projectID = 0, $orderBy = 'order_asc', $productID = 0, $recTotal = 0, $recPerPage = 10, $pageID = 1)
|
||||
public function execution($status = 'all', $projectID = 0, $orderBy = 'order_asc', $productID = 0, $recTotal = 0, $recPerPage = 100, $pageID = 1)
|
||||
{
|
||||
$uri = $this->app->getURI(true);
|
||||
$this->app->session->set('executionList', $uri, 'project');
|
||||
|
||||
@@ -120,7 +120,7 @@ class projectModel extends model
|
||||
if(defined('TUTORIAL')) return $projectID;
|
||||
|
||||
if($projectID == 0 and $this->cookie->lastProject) $projectID = $this->cookie->lastProject;
|
||||
if(($projectID == 0 and (int)$this->session->project == 0) or !isset($projects[$projectID])) $projectID = key($projects);
|
||||
if($projectID == 0 and (int)$this->session->project == 0) $projectID = key($projects);
|
||||
if($projectID == 0) $projectID = key($projects);
|
||||
|
||||
$this->session->set('project', (int)$projectID, $this->app->tab);
|
||||
@@ -851,7 +851,7 @@ class projectModel extends model
|
||||
if(isset($project->budget) and $program->budget != 0)
|
||||
{
|
||||
$availableBudget = $this->loadModel('program')->getBudgetLeft($program);
|
||||
if($project->budget > $availableBudget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget;
|
||||
if($availableBudget > 0 and $project->budget > $availableBudget) dao::$errors['budget'] = $this->lang->program->beyondParentBudget;
|
||||
}
|
||||
|
||||
/* Judge products not empty. */
|
||||
@@ -1960,7 +1960,7 @@ class projectModel extends model
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getStats($projectID = 0, $status = 'undone', $productID = 0, $branch = 0, $itemCounts = 30, $orderBy = 'id_asc', $pager = null)
|
||||
{
|
||||
|
||||
+10
-7
@@ -545,15 +545,18 @@ class searchModel extends model
|
||||
{
|
||||
$splitedWords = $spliter->utf8Split($word);
|
||||
|
||||
$trimedWord = trim($splitedWords['words']);
|
||||
$against .= '"' . $trimedWord . '" ';
|
||||
$againstCond .= '+"' . $trimedWord . '" ';
|
||||
if(is_numeric($word) and strlen($word) == 5) $againstCond .= "-\" $word \" ";
|
||||
$trimedWord = trim($splitedWords['words']);
|
||||
$against .= '"' . $trimedWord . '" ';
|
||||
$againstCond .= '+"' . $trimedWord . '" ';
|
||||
|
||||
$likeWord = is_numeric($word) ? $word : $trimedWord;
|
||||
if(is_numeric($word) and strlen($word) < 5) $likeWord = str_pad("|$likeWord|", 5, '_');
|
||||
$likeWord = is_numeric($word) ? $word : $trimedWord;
|
||||
if(is_numeric($word) and strpos($word, '.') === false and strlen($word) < 5) $likeWord = str_pad("|$likeWord|", 5, '_');
|
||||
$condition = "OR title like '%{$likeWord}%' OR content like '%{$likeWord}%'";
|
||||
if(is_numeric($word) and strlen($word) == 5) $condition = "OR title REGEXP '[^ ]{$likeWord}[^ ]' OR content REGEXP '[^ ]{$likeWord}[^ ]'";
|
||||
if(is_numeric($word) and strpos($word, '.') === false and strlen($word) == 5)
|
||||
{
|
||||
$againstCond .= "-\" $word \" ";
|
||||
$condition = "OR title REGEXP '[^ ]{$likeWord}[^ ]' OR content REGEXP '[^ ]{$likeWord}[^ ]'";
|
||||
}
|
||||
$likeCondition .= $condition;
|
||||
}
|
||||
|
||||
|
||||
@@ -2364,7 +2364,7 @@ class story extends control
|
||||
$relatedBranchIdList[$story->branch] = $story->branch;
|
||||
$relatedStoryIds[$story->id] = $story->id;
|
||||
|
||||
if(isset($relations[$story->id])) $story->linkStories = $story->linkStories . ',' . $relations[$story->id];
|
||||
if(isset($relations[$story->id])) $story->childStories = $story->childStories . ',' . $relations[$story->id];
|
||||
|
||||
/* Process related stories. */
|
||||
$relatedStories = $story->childStories . ',' . $story->linkStories . ',' . $story->duplicateStory;
|
||||
@@ -2455,8 +2455,6 @@ class story extends control
|
||||
$linkStoriesIdList = explode(',', $story->linkStories);
|
||||
foreach($linkStoriesIdList as $linkStoryID)
|
||||
{
|
||||
if(empty($linkStoryID)) continue;
|
||||
|
||||
$linkStoryID = trim($linkStoryID);
|
||||
$tmpLinkStories[] = isset($relatedStories[$linkStoryID]) ? $relatedStories[$linkStoryID] : $linkStoryID;
|
||||
}
|
||||
@@ -2469,6 +2467,8 @@ class story extends control
|
||||
$childStoriesIdList = explode(',', $story->childStories);
|
||||
foreach($childStoriesIdList as $childStoryID)
|
||||
{
|
||||
if(empty($childStoryID)) continue;
|
||||
|
||||
$childStoryID = trim($childStoryID);
|
||||
$tmpChildStories[] = isset($relatedStories[$childStoryID]) ? $relatedStories[$childStoryID] : $childStoryID;
|
||||
}
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
.side-col #legendProjectAndTask .list-unstyled {padding: 10px; border-top: 0px; margin: 0px;}
|
||||
#legendStories ul li {padding: 10px 0 0 12px; line-height: 20px;}
|
||||
.main-actions .btn-toolbar .btn {padding-right: 6px; padding-left: 6px;}
|
||||
.btn-edit-comment {z-index: 100;}
|
||||
|
||||
@@ -302,6 +302,7 @@ $lang->story->action->linked2plan = array('main' => '$date, linked by
|
||||
$lang->story->action->unlinkedfromplan = array('main' => '$date, unlinked by <strong>$actor</strong> from Plan <strong>$extra</strong>.');
|
||||
$lang->story->action->linked2execution = array('main' => '$date, linked by <strong>$actor</strong> to ' . $lang->executionCommon . ' <strong>$extra</strong>.');
|
||||
$lang->story->action->unlinkedfromexecution = array('main' => '$date, unlinked by <strong>$actor</strong> from ' . $lang->executionCommon . ' <strong>$extra</strong>.');
|
||||
$lang->story->action->linked2kanban = array('main' => '$date, linked by <strong>$actor</strong> to Kanban <strong>$extra</strong>.');
|
||||
$lang->story->action->linked2project = array('main' => '$date, linked by <strong>$actor</strong> to project <strong>$extra</strong>.');
|
||||
$lang->story->action->unlinkedfromproject = array('main' => '$date, unlinked by <strong>$actor</strong> from project <strong>$extra</strong>.');
|
||||
$lang->story->action->linked2build = array('main' => '$date, linked by <strong>$actor</strong> to Build <strong>$extra</strong>');
|
||||
|
||||
@@ -302,6 +302,7 @@ $lang->story->action->linked2plan = array('main' => '$date, 由 <stron
|
||||
$lang->story->action->unlinkedfromplan = array('main' => '$date, 由 <strong>$actor</strong> 从计划 <strong>$extra</strong> 移除。');
|
||||
$lang->story->action->linked2execution = array('main' => '$date, 由 <strong>$actor</strong> 关联到' . $lang->executionCommon . ' <strong>$extra</strong>。');
|
||||
$lang->story->action->unlinkedfromexecution = array('main' => '$date, 由 <strong>$actor</strong> 从' . $lang->executionCommon . ' <strong>$extra</strong> 移除。');
|
||||
$lang->story->action->linked2kanban = array('main' => '$date, 由 <strong>$actor</strong> 关联到看板 <strong>$extra</strong>。');
|
||||
$lang->story->action->linked2project = array('main' => '$date, 由 <strong>$actor</strong> 关联到项目 <strong>$extra</strong>。');
|
||||
$lang->story->action->unlinkedfromproject = array('main' => '$date, 由 <strong>$actor</strong> 从项目 <strong>$extra</strong> 移除。');
|
||||
$lang->story->action->linked2build = array('main' => '$date, 由 <strong>$actor</strong> 关联到版本 <strong>$extra</strong>。');
|
||||
|
||||
@@ -3232,7 +3232,7 @@ class storyModel extends model
|
||||
if(isset($stories[$storyID]) and $stories[$storyID] > $storyVersionList[$key]) $objectList[$key]->needconfirm = true;
|
||||
}
|
||||
|
||||
return is_object($data) ? current($objectList) : $objectList;
|
||||
return is_object($data) ? reset($objectList) : $objectList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,3 +4,4 @@
|
||||
.page-title{max-width: 80%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;}
|
||||
.pull-left{max-width: 80%;}
|
||||
.MRThWidth {width: 90px !important;}
|
||||
.btn-edit-comment {z-index: 100;}
|
||||
|
||||
@@ -853,7 +853,7 @@ class taskModel extends model
|
||||
{
|
||||
$currentTask->status = 'done';
|
||||
$currentTask->finishedBy = $this->app->user->account;
|
||||
$currentTask->finishedDate = $now;
|
||||
$currentTask->finishedDate = $task->finishedDate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -883,6 +883,8 @@ class taskModel extends model
|
||||
*/
|
||||
public function update($taskID)
|
||||
{
|
||||
if($taskID <= 0) return;
|
||||
|
||||
$oldTask = $this->getByID($taskID);
|
||||
if($this->post->estimate < 0 or $this->post->left < 0 or $this->post->consumed < 0)
|
||||
{
|
||||
@@ -1717,7 +1719,7 @@ class taskModel extends model
|
||||
->setDefault('status', 'done')
|
||||
->setDefault('finishedBy, lastEditedBy', $this->app->user->account)
|
||||
->setDefault('finishedDate, lastEditedDate', $now)
|
||||
->removeIF(!empty($oldTask->team), 'finishedBy,finishedDate,status,left')
|
||||
->removeIF(!empty($oldTask->team), 'finishedBy,status,left')
|
||||
->remove('comment,files,labels,currentConsumed')
|
||||
->get();
|
||||
|
||||
|
||||
@@ -1866,6 +1866,8 @@ class testcase extends control
|
||||
if($_POST)
|
||||
{
|
||||
$this->testcase->createFromImport($productID, (int)$branch);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
if($this->post->isEndPage)
|
||||
{
|
||||
unlink($tmpFile);
|
||||
|
||||
@@ -578,13 +578,16 @@ class testreportModel extends model
|
||||
* Get pairs.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $appendID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPairs($productID = 0)
|
||||
public function getPairs($productID = 0, $appendID = 0)
|
||||
{
|
||||
return $this->dao->select('id,title')->from(TABLE_TESTREPORT)
|
||||
->beginIF($productID)->where('product')->eq($productID)->fi()
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($productID)->andWhere('product')->eq($productID)->fi()
|
||||
->beginIF($appendID)->orWhere('id')->eq($appendID)->fi()
|
||||
->orderBy('id_desc')
|
||||
->fetchPairs();
|
||||
}
|
||||
|
||||
@@ -242,13 +242,12 @@ class testtask extends control
|
||||
}
|
||||
|
||||
/* Create testtask from testtask of test.*/
|
||||
$productID = $productID ? $productID : key($this->products);
|
||||
$executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID);
|
||||
$builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk');
|
||||
$testreports = $this->testtask->getTestReportPairsByBuild($build);
|
||||
$productID = $productID ? $productID : key($this->products);
|
||||
$executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID);
|
||||
$builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk');
|
||||
|
||||
/* Set menu. */
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
$productID = $this->product->saveState($productID, $this->products);
|
||||
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->create;
|
||||
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
@@ -261,7 +260,7 @@ class testtask extends control
|
||||
$this->view->executions = $executions;
|
||||
$this->view->builds = $builds;
|
||||
$this->view->build = $build;
|
||||
$this->view->testreports = $testreports;
|
||||
$this->view->testreports = array('') + $this->loadModel('testreport')->getPairs($productID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noclosed|qdfirst|nodeleted');
|
||||
|
||||
$this->display();
|
||||
@@ -758,12 +757,11 @@ class testtask extends control
|
||||
$executions = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID);
|
||||
$executionID = $task->execution;
|
||||
$builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'noempty,notrunk', $executionID, 'execution');
|
||||
$testreports = $this->loadModel('testreport')->getPairs($task->product);
|
||||
|
||||
$this->view->task = $task;
|
||||
$this->view->executions = $executions;
|
||||
$this->view->builds = $builds;
|
||||
$this->view->testreports = $testreports;
|
||||
$this->view->testreports = $this->loadModel('testreport')->getPairs($task->product, $task->testreport);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('nodeleted|noclosed', $task->owner);
|
||||
$this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote');
|
||||
|
||||
|
||||
@@ -38,6 +38,5 @@ function loadExecutions(productID)
|
||||
$(function()
|
||||
{
|
||||
adjustPriBoxWidth();
|
||||
loadTestReports($('#product').val());
|
||||
if($('#execution').val() != 0) loadExecutionBuilds($('#execution').val());
|
||||
});
|
||||
|
||||
@@ -492,20 +492,6 @@ class testtaskModel extends model
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get test report pairs by build.
|
||||
*
|
||||
* @param string $build
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getTestReportPairsByBuild($build = '')
|
||||
{
|
||||
if(empty($build)) return array();
|
||||
|
||||
return $this->dao->select('id,title')->from(TABLE_TESTREPORT)->where("CONCAT(',', builds, ',')")->like("%,$build,%")->fetchPairs('id','title');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get related test tasks.
|
||||
*
|
||||
|
||||
@@ -7,6 +7,14 @@ class caselibTest
|
||||
$this->objectModel = $tester->loadModel('caselib');
|
||||
}
|
||||
|
||||
/**
|
||||
* Set lib menu test.
|
||||
*
|
||||
* @param mixed $libraries
|
||||
* @param mixed $libID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function setLibMenuTest($libraries, $libID)
|
||||
{
|
||||
$objects = $this->objectModel->setLibMenu($libraries, $libID);
|
||||
@@ -16,6 +24,14 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Save lib state test.
|
||||
*
|
||||
* @param int $libID
|
||||
* @param array $libraries
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveLibStateTest($libID = 0, $libraries = array())
|
||||
{
|
||||
$objects = $this->objectModel->saveLibState($libID, $libraries);
|
||||
@@ -25,6 +41,14 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get by ID test.
|
||||
*
|
||||
* @param mixed $libID
|
||||
* @param mixed $setImgSize
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getByIdTest($libID, $setImgSize = false)
|
||||
{
|
||||
$objects = $this->objectModel->getById($libID, $setImgSize);
|
||||
@@ -34,6 +58,13 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update test.
|
||||
*
|
||||
* @param mixed $libID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateTest($libID)
|
||||
{
|
||||
$objects = $this->objectModel->update($libID);
|
||||
@@ -45,6 +76,14 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete test.
|
||||
*
|
||||
* @param mixed $libID
|
||||
* @param string $table
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteTest($libID, $table = '')
|
||||
{
|
||||
$objects = $this->objectModel->delete($libID, $table);
|
||||
@@ -56,6 +95,12 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get libraries test.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getLibrariesTest()
|
||||
{
|
||||
$objects = $this->objectModel->getLibraries();
|
||||
@@ -65,6 +110,14 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list test.
|
||||
*
|
||||
* @param string $orderBy
|
||||
* @param mixed $pager
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getListTest($orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$objects = $this->objectModel->getList($orderBy, $pager);
|
||||
@@ -74,6 +127,13 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create test.
|
||||
*
|
||||
* @param mixed $param
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createTest($param)
|
||||
{
|
||||
foreach($param as $k => $v) $_POST[$k] = $v;
|
||||
@@ -87,6 +147,18 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get libcases test.
|
||||
*
|
||||
* @param mixed $libID
|
||||
* @param mixed $browseType
|
||||
* @param int $queryID
|
||||
* @param int $moduleID
|
||||
* @param string $sort
|
||||
* @param mixed $pager
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getLibCasesTest($libID, $browseType, $queryID = 0, $moduleID = 0, $sort = 'id_desc', $pager = null)
|
||||
{
|
||||
$objects = $this->objectModel->getLibCases($libID, $browseType, $queryID, $moduleID, $sort, $pager);
|
||||
@@ -96,6 +168,16 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build searchform test.
|
||||
*
|
||||
* @param mixed $libID
|
||||
* @param mixed $libraries
|
||||
* @param mixed $queryID
|
||||
* @param mixed $actionURL
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildSearchFormTest($libID, $libraries, $queryID, $actionURL)
|
||||
{
|
||||
$objects = $this->objectModel->buildSearchForm($libID, $libraries, $queryID, $actionURL);
|
||||
@@ -105,6 +187,15 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get liblink test.
|
||||
*
|
||||
* @param mixed $module
|
||||
* @param mixed $method
|
||||
* @param mixed $extra
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getLibLinkTest($module, $method, $extra)
|
||||
{
|
||||
$objects = $this->objectModel->getLibLink($module, $method, $extra);
|
||||
@@ -114,6 +205,13 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from import test.
|
||||
*
|
||||
* @param mixed $libID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createFromImportTest($libID)
|
||||
{
|
||||
$objects = $this->objectModel->createFromImport($libID);
|
||||
@@ -123,6 +221,13 @@ class caselibTest
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch create case test.
|
||||
*
|
||||
* @param mixed $libID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchCreateCaseTest($libID)
|
||||
{
|
||||
$objects = $this->objectModel->batchCreateCase($libID);
|
||||
|
||||
@@ -0,0 +1,254 @@
|
||||
<?php
|
||||
class cronTest
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel = $tester->loadModel('cron');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get by id test.
|
||||
*
|
||||
* @param int $cronID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByIdTest($cronID)
|
||||
{
|
||||
$objects = $this->objectModel->getById($cronID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get crons test.
|
||||
*
|
||||
* @param string $params
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getCronsTest($params = '')
|
||||
{
|
||||
$objects = $this->objectModel->getCrons($params);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse crons test.
|
||||
*
|
||||
* @param array $crons
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function parseCronTest($crons)
|
||||
{
|
||||
$objects = $this->objectModel->parseCron($crons);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change cron status test.
|
||||
*
|
||||
* @param int $cronID
|
||||
* @param string $status
|
||||
* @param bool $changeTime
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function changeStatusTest($cronID, $status, $changeTime = false)
|
||||
{
|
||||
$objects = $this->objectModel->changeStatus($cronID, $status, $changeTime);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change cron status to running test.
|
||||
*
|
||||
* @param int $cronID
|
||||
* @param string $lastTime
|
||||
* @access public
|
||||
* @return bool|int
|
||||
*/
|
||||
public function changeStatusRunningTest($cronID, $lastTime)
|
||||
{
|
||||
$objects = $this->objectModel->changeStatusRunning($cronID, $lastTime);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Log cron test.
|
||||
*
|
||||
* @param string $log
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function logCronTest($log)
|
||||
{
|
||||
$objects = $this->objectModel->logCron($log);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get last execed time test.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getLastTimeTest()
|
||||
{
|
||||
$objects = $this->objectModel->getLastTime();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runable cron test.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function runableTest()
|
||||
{
|
||||
$objects = $this->objectModel->runable();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check change cron test.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function checkChangeTest()
|
||||
{
|
||||
$objects = $this->objectModel->checkChange();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create cron test.
|
||||
*
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function createTest($param)
|
||||
{
|
||||
foreach($param as $k => $v) $_POST[$k] = $v;
|
||||
$cronID = $this->objectModel->create();
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getById($cronID);
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update cron test.
|
||||
*
|
||||
* @param int $cronID
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function updateTest($cronID, $param)
|
||||
{
|
||||
foreach($param as $k => $v) $_POST[$k] = $v;
|
||||
$objects = $this->objectModel->update($cronID);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getById($cronID);
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check cron rule test.
|
||||
*
|
||||
* @param object $cron
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function checkRuleTest($cron)
|
||||
{
|
||||
$objects = $this->objectModel->checkRule($cron);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark cron status test.
|
||||
*
|
||||
* @param mixed $status
|
||||
* @param int $configID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function markCronStatusTest($status, $configID = 0)
|
||||
{
|
||||
$objects = $this->objectModel->markCronStatus($status, $configID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get config id test.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getConfigIDTest()
|
||||
{
|
||||
$objects = $this->objectModel->getConfigID();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current cron status test.
|
||||
*
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function getTurnonTest()
|
||||
{
|
||||
$objects = $this->objectModel->getTurnon();
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
+21
-292
@@ -8,11 +8,10 @@ class Project
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($user)
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
|
||||
su($user);
|
||||
$this->project = $tester->loadModel('project');
|
||||
}
|
||||
|
||||
@@ -36,18 +35,6 @@ class Project
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* checkHasChildren
|
||||
*
|
||||
* @param int mixed $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkHasChildren($projectID)
|
||||
{
|
||||
return $this->project->checkHasChildren($projectID);
|
||||
}
|
||||
|
||||
/**
|
||||
* checkStatusOff
|
||||
*
|
||||
@@ -74,136 +61,6 @@ class Project
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* checkBudgetUnitList
|
||||
*
|
||||
* @param string $checkList
|
||||
* @param 'USD' => '美元') $'USD' => '美元')
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkBudgetUnitList($checkList = array('CNY' => '人民币', 'USD' => '美元'))
|
||||
{
|
||||
$budgetList = $this->project->getBudgetUnitList();
|
||||
foreach($budgetList as $enBudget => $zhBudget)
|
||||
{
|
||||
if($checkList[$enBudget] != $zhBudget) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* getByIdList
|
||||
*
|
||||
* @param array mixed $projectIdList
|
||||
* @param int mixed $count
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getByIdList($projectIdList, $count)
|
||||
{
|
||||
$projectList = $this->project->getByIdList($projectIdList);
|
||||
if(count($projectList) != $count) return false;
|
||||
return $projectList;
|
||||
}
|
||||
|
||||
/**
|
||||
* getProjectByID
|
||||
*
|
||||
* @param int mixed $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProjectByID($projectID)
|
||||
{
|
||||
return $this->project->getByID($projectID);
|
||||
}
|
||||
|
||||
/**
|
||||
* getProgramByID
|
||||
*
|
||||
* @param int mixed $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProgramByID($programID)
|
||||
{
|
||||
return $this->project->getByID($programID, 'program');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* getSprintByID
|
||||
*
|
||||
* @param int mixed $sprintID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getSprintByID($sprintID)
|
||||
{
|
||||
return $this->project->getByID($sprintID, 'sprint');
|
||||
}
|
||||
|
||||
/**
|
||||
* getStageByID
|
||||
*
|
||||
* @param int mixed $stageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getStageByID($stageID)
|
||||
{
|
||||
return $this->project->getByID($stageID, 'stage');
|
||||
}
|
||||
|
||||
/**
|
||||
* getKanbanByID
|
||||
*
|
||||
* @param int mixed $kanbanID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getKanbanByID($kanbanID)
|
||||
{
|
||||
return $this->project->getByID($kanbanID, 'kanban');
|
||||
}
|
||||
|
||||
/**
|
||||
* getBystatus
|
||||
*
|
||||
* @param string mixed $status
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getBystatus($status)
|
||||
{
|
||||
$projects = $this->project->getOverviewList('byStatus', $status);
|
||||
if(!$projects)
|
||||
{
|
||||
$result = array();
|
||||
$result['code'] = 'fail';
|
||||
$result['message'] = 'No data.';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
if($status == 'undone') $status = 'wait,doing,suspended';
|
||||
|
||||
foreach($projects as $project)
|
||||
{
|
||||
if(strpos(",$status,", $project->status) === false)
|
||||
{
|
||||
$result = array();
|
||||
$result['code'] = 'fail';
|
||||
$result['message'] = 'Error data.';
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
return count($projects);
|
||||
}
|
||||
|
||||
/**
|
||||
* getListByOrder
|
||||
*
|
||||
@@ -229,54 +86,6 @@ class Project
|
||||
return $this->project->getOverviewList('byID', $projectID);
|
||||
}
|
||||
|
||||
/**
|
||||
* getByIdListFind
|
||||
*
|
||||
* @param array mixed $IDList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getByIdListFind($IDList)
|
||||
{
|
||||
$projects = $this->project->getPairsByIdList($IDList);
|
||||
if(empty($projects))
|
||||
{
|
||||
$result = array();
|
||||
$result['code'] = 'fail';
|
||||
$result['message'] = 'No data.';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
foreach($projects as $projectID => $projectName)
|
||||
{
|
||||
if(!empty($IDList) and !in_array($projectID, $IDList))
|
||||
{
|
||||
$result = array();
|
||||
$result['code'] = 'fail';
|
||||
$result['message'] = 'Error Data.';
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
return count($projects);
|
||||
}
|
||||
|
||||
/**
|
||||
* getParentName
|
||||
*
|
||||
* @param int mixed $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getParentName($projectID)
|
||||
{
|
||||
$program = $this->project->getParentName($projectID);
|
||||
if(empty($program)) return false;
|
||||
return $program;
|
||||
}
|
||||
|
||||
/**
|
||||
* getTeamMemberPairs
|
||||
*
|
||||
@@ -408,63 +217,6 @@ class Project
|
||||
return $releases;
|
||||
}
|
||||
|
||||
/**
|
||||
* getByProgram
|
||||
*
|
||||
* @param int mixed $programID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getByProgram($programID)
|
||||
{
|
||||
$projects = $this->project->getPairsByProgram($programID);
|
||||
if(empty($projects))
|
||||
{
|
||||
$result = array();
|
||||
$result['code'] = 'fail';
|
||||
$result['message'] = 'No data.';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
return count($projects);
|
||||
}
|
||||
|
||||
/**
|
||||
* getByStatusPairs
|
||||
*
|
||||
* @param string mixed $status
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getByStatusPairs($status)
|
||||
{
|
||||
$projects = $this->project->getPairsByProgram(2, $status);
|
||||
if(empty($projects))
|
||||
{
|
||||
$result = array();
|
||||
$result['code'] = 'fail';
|
||||
$result['message'] = 'No data.';
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
return count($projects);
|
||||
}
|
||||
|
||||
/**
|
||||
* getConsumed
|
||||
*
|
||||
* @param array mixed $projectIdList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getConsumed($projectIdList)
|
||||
{
|
||||
$projects = $this->project->getProjectsConsumed($projectIdList, $time = '');
|
||||
return $projects;
|
||||
}
|
||||
|
||||
/**
|
||||
* getByStatusExe
|
||||
*
|
||||
@@ -504,46 +256,6 @@ class Project
|
||||
return count($executions);
|
||||
}
|
||||
|
||||
/**
|
||||
* getTotalBugBy
|
||||
*
|
||||
* @param array mixed $projectIdList
|
||||
* @param string mixed $status
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getTotalBugBy($projectIdList, $status)
|
||||
{
|
||||
$projects = $this->project->getTotalBugByProject($projectIdList, $status);
|
||||
return $projects;
|
||||
}
|
||||
|
||||
/**
|
||||
* getWorkHour
|
||||
*
|
||||
* @param int mixed $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getWorkHour($projectID)
|
||||
{
|
||||
$projects = $this->project->getWorkhour($projectID);
|
||||
return $projects;
|
||||
}
|
||||
|
||||
/**
|
||||
* getInfoList
|
||||
*
|
||||
* @param string mixed $status
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getInfoList($status)
|
||||
{
|
||||
$projects = $this->project->getInfoList($status);
|
||||
return $projects;
|
||||
}
|
||||
|
||||
/**
|
||||
* getStatData
|
||||
*
|
||||
@@ -573,6 +285,25 @@ class Project
|
||||
return $projects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create project.
|
||||
*
|
||||
* @param array $params
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function create($params)
|
||||
{
|
||||
$_POST = $params;
|
||||
|
||||
$projectID = $this->project->create();
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return array('message' => dao::getError());
|
||||
|
||||
return $this->project->getById($projectID);
|
||||
}
|
||||
|
||||
/**
|
||||
* saveState
|
||||
*
|
||||
@@ -583,9 +314,7 @@ class Project
|
||||
public function saveState($projectID)
|
||||
{
|
||||
$projects = $this->project->getPairsByProgram();
|
||||
$object = $this->project->saveState($projectID, $projects);
|
||||
$object = $this->project->saveState($projectID, $projects);
|
||||
return $object;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
class releaseTest
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel = $tester->loadModel('release');
|
||||
}
|
||||
|
||||
/**
|
||||
* function getByIDTest by release
|
||||
*
|
||||
* @param string $releaseID
|
||||
* @param beel $setImgSize
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByIDTest($releaseID, $setImgSize = false)
|
||||
{
|
||||
$objects = $this->objectModel->getByID($releaseID, $setImgSize);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function getListTest by release
|
||||
*
|
||||
* @param string $productID
|
||||
* @param string $branch
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function getListTest($productID, $branch = 'all', $type = 'all', $orderBy = 't1.date_desc', $pager = null)
|
||||
{
|
||||
$objects = $this->objectModel->getList($productID, $branch, $type, $orderBy, $pager);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* function getLastTest by release
|
||||
*
|
||||
* @param string $productID
|
||||
* @param string $branch
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getLastTest($productID, $branch = 0)
|
||||
{
|
||||
$objects = $this->objectModel->getLast($productID, $branch);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get released test builds from product .
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string|int $branch
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getReleasedBuildsTest($productID, $branch = 'all')
|
||||
{
|
||||
$objects = $this->objectModel->getReleasedBuilds($productID, $branch);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a release.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function createTest($productID = 0, $branch = 0, $projectID = 0, $param = array())
|
||||
{
|
||||
|
||||
$date = date('Y-m-d');
|
||||
$labels = array();
|
||||
$files = array();
|
||||
$mailto = array();
|
||||
|
||||
$createFields = array('name' => '','marker' => '1', 'build' => '', 'date' => $date, 'desc' => '', 'mailto' => $mailto , 'labels' => $labels, 'files' => $files);
|
||||
|
||||
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
|
||||
foreach($param as $key => $value) $_POST[$key] = $value;
|
||||
|
||||
$objectsID = $this->objectModel->create($productID, $branch, $projectID);
|
||||
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getByID($objectsID);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
/**
|
||||
* Update a release.
|
||||
*
|
||||
* @param int $releaseID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function updateTest($releaseID, $param = array())
|
||||
{
|
||||
$date = date('Y-m-d');
|
||||
$labels = array();
|
||||
$files = array();
|
||||
$mailto = array();
|
||||
|
||||
$createFields = array('name' => '','marker' => '1', 'build' => '', 'date' => $date, 'desc' => '', 'mailto' => $mailto , 'labels' => $labels, 'files' => $files);
|
||||
|
||||
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
|
||||
foreach($param as $key => $value) $_POST[$key] = $value;
|
||||
$this->objectModel->update($releaseID);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getByID($releaseID);
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notify persons.
|
||||
*
|
||||
* @param string $notfiyList
|
||||
* @param int $productID
|
||||
* @param int $buildID
|
||||
* @param int $releaseID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function getNotifyPersonsTest($notifyList = '', $productID = 0, $buildID = 0, $releaseID = 0)
|
||||
{
|
||||
$objects = $this->objectModel->getNotifyPersons($notifyList, $productID, $buildID, $releaseID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link stories
|
||||
*
|
||||
* @param int $releaseID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function linkStoryTest($releaseID, $stories)
|
||||
{
|
||||
$_POST['stories'] = $stories;
|
||||
$this->objectModel->linkStory($releaseID);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getByID($releaseID);
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlink story
|
||||
*
|
||||
* @param int $releaseID
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function unlinkStoryTest($releaseID, $storyID)
|
||||
{
|
||||
$_POST['stories'] = $storyID;
|
||||
$this->objectModel->linkStory($releaseID);
|
||||
unset($_POST);
|
||||
|
||||
$this->objectModel->unlinkStory($releaseID, $storyID[0]);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getByID($releaseID);
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch unlink story.
|
||||
*
|
||||
* @param int $releaseID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function batchUnlinkStoryTest($releaseID, $stories)
|
||||
{
|
||||
$_POST['stories'] = $stories;
|
||||
$this->objectModel->linkStory($releaseID);
|
||||
unset($_POST);
|
||||
|
||||
$_POST['storyIdList'] = $stories;
|
||||
$this->objectModel->batchUnlinkStory($releaseID);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getByID($releaseID);
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Link bugs.
|
||||
*
|
||||
* @param int $releaseID
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
|
||||
public function linkBugTest($releaseID, $type = 'bug', $bugs)
|
||||
{
|
||||
$_POST['bugs'] = $bugs;
|
||||
$this->objectModel->linkBug($releaseID, $type);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getByID($releaseID);
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlink bug.
|
||||
*
|
||||
* @param int $releaseID
|
||||
* @param int $bugID
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function unlinkBugTest($releaseID, $bugID, $type = 'bug')
|
||||
{
|
||||
$_POST['bugs'] = $bugID;
|
||||
$this->objectModel->linkBug($releaseID);
|
||||
unset($_POST);
|
||||
|
||||
$this->objectModel->unlinkBug($releaseID, $bugID[0], $type);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getByID($releaseID);
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch unlink bug.
|
||||
*
|
||||
* @param int $releaseID
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function batchUnlinkBugTest($releaseID, $type = 'bug', $bugs)
|
||||
{
|
||||
$_POST['bugs'] = $bugs;
|
||||
$this->objectModel->linkBug($releaseID);
|
||||
unset($_POST);
|
||||
|
||||
$_POST['unlinkBugs'] = $bugs;
|
||||
$this->objectModel->batchUnlinkBug($releaseID, $type);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getByID($releaseID);
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change status.
|
||||
*
|
||||
* @param int $releaseID
|
||||
* @param string $status
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
public function changeStatusTest($releaseID, $status)
|
||||
{
|
||||
$this->objectModel->changeStatus($releaseID, $status);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$objects = $this->objectModel->getByID($releaseID);
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function sendmailTest($releaseID)
|
||||
{
|
||||
$objects = $this->objectModel->sendmail($releaseID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get toList and ccList.
|
||||
*
|
||||
* @param object $release
|
||||
* @access public
|
||||
* @return bool|array
|
||||
*/
|
||||
public function getToAndCcListTest($releaseID)
|
||||
{
|
||||
$release = $this->objectModel->getByID($releaseID);
|
||||
|
||||
$objects = $this->objectModel->getToAndCcList($release);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function sendMail2FeedbackTest($release, $subject)
|
||||
{
|
||||
$objects = $this->objectModel->sendMail2Feedback($release, $subject);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
@@ -33,8 +33,11 @@ fields:
|
||||
format: ""
|
||||
- field: actor
|
||||
note: "操作者"
|
||||
from: common.user.v1.yaml
|
||||
use: user
|
||||
fields:
|
||||
- field: actor1
|
||||
range: admin,dev,test
|
||||
- field: actor2
|
||||
range: [],17-18
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
@@ -62,7 +65,7 @@ fields:
|
||||
format: ""
|
||||
- field: extra
|
||||
note: "附加参数"
|
||||
range: "0"
|
||||
range: 1{4},11,1{22},33,1{22},101,1{22},131,1{22},161,1{3}
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
title: table zt_history
|
||||
desc: "操作历史"
|
||||
author: automated export
|
||||
version: "1.0"
|
||||
fields:
|
||||
- field: id
|
||||
note: "ID"
|
||||
range: 1-100
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: action
|
||||
note: "关联日志"
|
||||
range: 1-100
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: field
|
||||
note: "字段"
|
||||
range: "resolution,resolvedBuild,resolvedDate,status"
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: old
|
||||
note: "旧值"
|
||||
range: [1,2,2020-01-01,doing]
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: new
|
||||
note: "新值"
|
||||
range: [2,3,2020-01-17,done]
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: diff
|
||||
note: "不同"
|
||||
range: ""
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
@@ -11,6 +11,7 @@ $builder->usercontact = array('rows' => 61, 'extends' => array('usercontact'));
|
||||
$builder->userview = array('rows' => 400, 'extends' => array('userview'));
|
||||
$builder->dept = array('rows' => 100, 'extends' => array('dept'));
|
||||
$builder->action = array('rows' => 100, 'extends' => array('action'));
|
||||
$builder->history = array('rows' => 100, 'extends' => array('history'));
|
||||
|
||||
$builder->program = array('rows' => 10, 'extends' => array('project', 'program'));
|
||||
$builder->project = array('rows' => 90, 'extends' => array('project', 'project'));
|
||||
@@ -48,6 +49,7 @@ $builder->product = array('rows' => 100, 'extends' => array('product
|
||||
$builder->productalone = array('rows' => 20, 'extends' => array('product','productalone'));
|
||||
$builder->productline = array('rows' => 20, 'extends' => array('module', 'productline'));
|
||||
$builder->productplan = array('rows' => 70, 'extends' => array('productplan'));
|
||||
$builder->productsonplan = array('rows' => 10, 'extends' => array('productplan', 'productsonplan'));
|
||||
$builder->branch = array('rows' => 240, 'extends' => array('branch'));
|
||||
$builder->projectproduct = array('rows' => 200, 'extends' => array('projectproduct'));
|
||||
$builder->projectproductalone = array('rows' => 28, 'extends' => array('projectproduct','projectproductalone'));
|
||||
|
||||
@@ -50,6 +50,7 @@ class Processor
|
||||
$this->initBug();
|
||||
$this->initTest();
|
||||
$this->initTodo();
|
||||
$this->initSonPlan();
|
||||
$this->initBassicSql();
|
||||
|
||||
$this->dao->commit();
|
||||
@@ -443,4 +444,15 @@ class Processor
|
||||
$this->dao->query("update zt_kanbancolumn set `parent` = '-1' where id = 206");
|
||||
$this->dao->query("update zt_kanbancolumn set `parent` = '206' where id in ('207','208')");
|
||||
}
|
||||
|
||||
/**
|
||||
* Init son plan
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function initSonPlan()
|
||||
{
|
||||
$this->dao->query("update zt_productplan set `parent` = '-1' where id < 10 and id > 0");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ title=测试 caselibModel->batchCreateCase();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
添加两条数据之后查询数据条数是否正确 >> 12
|
||||
添加数据之后查询新加用例的名称,用例类型 >> 测试导入添加1,performance
|
||||
添加数据之后查询新加用例的名称,用例类型 >> 测试导入添加2,unit
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
@@ -25,11 +29,11 @@ $_POST = array(
|
||||
);
|
||||
$caselib->batchCreateCaseTest(201);
|
||||
unset($_POST);
|
||||
$total = $tester->dao->select('count(*) total')->from(TABLE_CASE)->where('lib')->eq(201)->fetch('total');
|
||||
$cases = $tester->dao->select('*')->from(TABLE_CASE)->where('lib')->eq(201)->fetchAll('id');
|
||||
$total = $tester->dao->select('count(*) total')->from(TABLE_CASE)->where( 'lib')->eq(201)->fetch('total');
|
||||
$cases = $tester->dao->select('*')->from(TABLE_CASE)->where( 'lib')->eq(201)->fetchAll('id');
|
||||
|
||||
r($total) && p() && e('12'); // 添加两条数据之后查询数据条数是否正确
|
||||
r($cases) && p('411:title,type') && e('测试导入添加1,performance'); // 添加数据之后查询新加用例的名称,用例类型
|
||||
r($cases) && p('412:title,type') && e('测试导入添加2,unit'); // 添加数据之后查询新加用例的名称,用例类型
|
||||
|
||||
system('./ztest init');
|
||||
system('./ztest init');
|
||||
@@ -10,6 +10,9 @@ title=测试 caselibModel->buildSearchForm();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试设置的url参数 >> model/caselib/buildsearchform.php?m=caselib&f=browse&t=&libID=201&browseType=bySearch&queryID=myQueryID
|
||||
测试设置的queryID值是否正确 >> 10
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
@@ -22,4 +25,4 @@ $caselib->buildSearchFormTest($libID, $libs, $queryID, $actionURL);
|
||||
$search = $tester->config->testcase->search;
|
||||
|
||||
r($search) && p('actionURL') && e('model/caselib/buildsearchform.php?m=caselib&f=browse&t=&libID=201&browseType=bySearch&queryID=myQueryID'); //测试设置的url参数
|
||||
r($search) && p('queryID') && e('10'); //测试设置的queryID值是否正确
|
||||
r($search) && p('queryID') && e('10'); //测试设置的queryID值是否正确
|
||||
@@ -10,6 +10,11 @@ title=测试 caselibModel->create();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试名称是空时候添加 >> 『名称』不能为空。
|
||||
测试添加的名称信息 >> 测试用例库名称
|
||||
测试添加的描述信息 >> 测试用例库描述
|
||||
测试名称是空时候添加 >> 『名称』已经有『测试用例库名称』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
@@ -32,4 +37,4 @@ r($result2) && p('name') && e('测试用例库名称'); //测试添加的
|
||||
r($result2) && p('desc') && e('测试用例库描述'); //测试添加的描述信息
|
||||
r($result3) && p('name:0') && e('『名称』已经有『测试用例库名称』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); //测试名称是空时候添加
|
||||
|
||||
system('./ztest init');
|
||||
system('./ztest init');
|
||||
@@ -10,6 +10,10 @@ title=测试 caselibModel->createFromImport();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
添加两条数据之后查询数据条数是否正确 >> 12
|
||||
添加数据之后查询新加用例的名称,关键字 >> 测试导入添加1,keywords1
|
||||
添加数据之后查询新加用例的名称,关键字 >> 测试导入添加2,keywords2
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
@@ -28,11 +32,11 @@ $_POST = array(
|
||||
|
||||
$caselib->createFromImportTest(201);
|
||||
unset($_POST);
|
||||
$total = $tester->dao->select('count(*) total')->from(TABLE_CASE)->where('lib')->eq(201)->fetch('total');
|
||||
$cases = $tester->dao->select('*')->from(TABLE_CASE)->where('lib')->eq(201)->fetchAll('id');
|
||||
$total = $tester->dao->select('count(*) total')->from(TABLE_CASE)->where( 'lib')->eq(201)->fetch('total');
|
||||
$cases = $tester->dao->select('*')->from(TABLE_CASE)->where( 'lib')->eq(201)->fetchAll('id');
|
||||
|
||||
r($total) && p() && e('12'); //添加两条数据之后查询数据条数是否正确
|
||||
r($cases) && p('411:title,keywords') && e('测试导入添加1,keywords1'); //添加数据之后查询新加用例的名称,关键字
|
||||
r($cases) && p('412:title,keywords') && e('测试导入添加2,keywords2'); //添加数据之后查询新加用例的名称,关键字
|
||||
|
||||
system('./ztest init');
|
||||
system('./ztest init');
|
||||
@@ -10,6 +10,8 @@ title=测试 caselibModel->delete();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试删除之后deleted值是否为1 >> 1
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
@@ -17,4 +19,4 @@ $lib = $caselib->deleteTest(201);
|
||||
|
||||
r($lib) && p('deleted') && e('1'); //测试删除之后deleted值是否为1
|
||||
|
||||
system('./ztest init');
|
||||
system('./ztest init');
|
||||
@@ -10,6 +10,10 @@ title=测试 caselibModel->getById();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试获取数据的名称信息 >> 这是测试套件名称201
|
||||
测试获取数据的描述信息 >> 这是测试套件的描述201
|
||||
测试获取数据的type类型 >> library
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
@@ -17,4 +21,4 @@ $data = $caselib->getByIdTest(201);
|
||||
|
||||
r($data) && p('name') && e('这是测试套件名称201'); //测试获取数据的名称信息
|
||||
r($data) && p('desc') && e('这是测试套件的描述201'); //测试获取数据的描述信息
|
||||
r($data) && p('type') && e('library'); //测试获取数据的type类型
|
||||
r($data) && p('type') && e('library'); //测试获取数据的type类型
|
||||
@@ -10,6 +10,10 @@ title=测试 caselibModel->getLibCases();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
所有状态下,用例库下用例数量 >> 10
|
||||
搜索状态下,用例库下用例数量 >> 10
|
||||
分页状态下,用例库下用例数量 >> 5
|
||||
|
||||
*/
|
||||
global $tester;
|
||||
$tester->app->loadClass('pager', $static = true);
|
||||
@@ -23,4 +27,4 @@ $list3 = $caselib->getLibCasesTest(201, 'all', '0', '0', 'id_desc', $pager);
|
||||
|
||||
r(count($list1)) && p() && e('10'); //所有状态下,用例库下用例数量
|
||||
r(count($list2)) && p() && e('10'); //搜索状态下,用例库下用例数量
|
||||
r(count($list3)) && p() && e('5'); //分页状态下,用例库下用例数量
|
||||
r(count($list3)) && p() && e('5'); //分页状态下,用例库下用例数量
|
||||
@@ -10,6 +10,11 @@ title=测试 caselibModel->getLibLink();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试参数情况1返回值 >> model/caselib/getliblink.php?m=caselib&f=browse&t=&libID=%s
|
||||
测试参数情况2返回值 >> model/caselib/getliblink.php?m=caselib&f=test&t=&libID=%s
|
||||
测试参数情况3返回值 >> model/caselib/getliblink.php?m=tree&f=&t=&libID=%s&type=caselib¤tModuleID=0
|
||||
测试参数情况4返回值 >> model/caselib/getliblink.php?m=caselib&f=browse&t=&libID=%s
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
@@ -21,4 +26,4 @@ $link4 = $caselib->getLibLinkTest('', '', '');
|
||||
r($link1) && p() && e('model/caselib/getliblink.php?m=caselib&f=browse&t=&libID=%s'); // 测试参数情况1返回值
|
||||
r($link2) && p() && e('model/caselib/getliblink.php?m=caselib&f=test&t=&libID=%s'); // 测试参数情况2返回值
|
||||
r($link3) && p() && e('model/caselib/getliblink.php?m=tree&f=&t=&libID=%s&type=caselib¤tModuleID=0'); // 测试参数情况3返回值
|
||||
r($link4) && p() && e('model/caselib/getliblink.php?m=caselib&f=browse&t=&libID=%s'); // 测试参数情况4返回值
|
||||
r($link4) && p() && e('model/caselib/getliblink.php?m=caselib&f=browse&t=&libID=%s'); // 测试参数情况4返回值
|
||||
@@ -10,9 +10,11 @@ title=测试 caselibModel->getLibraries();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试获取用例库的键值对 >> 这是测试套件名称201
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
$list = $caselib->getLibrariesTest();
|
||||
|
||||
r($list) && p('201') && e('这是测试套件名称201'); //测试获取用例库的键值对
|
||||
r($list) && p('201') && e('这是测试套件名称201'); //测试获取用例库的键值对
|
||||
@@ -10,10 +10,13 @@ title=测试 caselibModel->getList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试获取列表的个数,目前只有一个 >> 1
|
||||
测试获取列表某个用例库的名称信息 >> 这是测试套件名称201
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
$list = $caselib->getListTest();
|
||||
|
||||
r(count($list)) && p() && e('1'); //测试获取列表的个数,目前只有一个
|
||||
r($list) && p('201:name') && e('这是测试套件名称201');//测试获取列表某个用例库的名称信息
|
||||
r($list) && p('201:name') && e('这是测试套件名称201');//测试获取列表某个用例库的名称信息
|
||||
@@ -10,6 +10,8 @@ title=测试 caselibModel->saveLibState();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
保存用例库状态之后返回值 >> 201
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
|
||||
@@ -10,13 +10,16 @@ title=测试 caselibModel->setLibMenu();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
修改下拉菜单之后返回值 >> 1
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
$libs = $tester->loadModel('caselib')->getLibraries();
|
||||
$info = $caselib->setLibMenuTest($libs, 201);
|
||||
$caselib = new caselibTest();
|
||||
$libs = $tester->loadModel('caselib')->getLibraries();
|
||||
$config->webRoot = 'model/caselib/';//ztest运行时候获取的不一致
|
||||
$info = $caselib->setLibMenuTest($libs, 201);
|
||||
|
||||
$menuStr = <<<EOT
|
||||
<div class='btn-group header-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='这是测试套件名称201'><span class='text'>这是测试套件名称201</span> <span class='caret' style='margin-top: 3px'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='model/caselib/setlibmenu.php?m=caselib&f=ajaxGetDropMenu&t=&objectID=201&module=caselib&method=browse'><div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div></div></div>
|
||||
EOT;
|
||||
r($tester->lang->switcherMenu) && p() && e($menuStr); //修改下拉菜单之后返回值
|
||||
r($tester->lang->switcherMenu == trim($menuStr)) && p() && e('1'); //修改下拉菜单之后返回值
|
||||
|
||||
@@ -10,6 +10,10 @@ title=测试 caselibModel->update();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试更新名称为空时候返回 >> 『name』不能为空。
|
||||
测试更新之后名称信息 >> 测试修改名称
|
||||
测试更新之后描述信息 >> 测试修改描述
|
||||
|
||||
*/
|
||||
|
||||
$caselib = new caselibTest();
|
||||
@@ -26,4 +30,4 @@ r($lib1) && p('name:0') && e('『name』不能为空。'); //测试更新名称
|
||||
r($lib2) && p('name') && e('测试修改名称'); //测试更新之后名称信息
|
||||
r($lib2) && p('desc') && e('测试修改描述'); //测试更新之后描述信息
|
||||
|
||||
system('./ztest init');
|
||||
system('./ztest init');
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->changeStatus();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
更新定时任务状态之后查看返回值 >> 1
|
||||
更新定时任务状态之后查看状态值 >> stop
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$cronID = 1;
|
||||
$status = 'stop';
|
||||
$result = $cron->changeStatusTest($cronID, $status);
|
||||
$cronInfo = $tester->cron->getById($cronID);
|
||||
|
||||
r($result) && p() && e('1'); //更新定时任务状态之后查看返回值
|
||||
r($cronInfo) && p('status') && e('stop'); //更新定时任务状态之后查看状态值
|
||||
|
||||
system('./ztest init');
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->changeStatusRunning();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
更新之后查看返回值是否是1 >> 1
|
||||
更新之后查看状态值是否是running >> running
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$cronID = 4;
|
||||
$lastTime = '0000-00-00 00:00:00';
|
||||
$result = $cron->changeStatusRunningTest($cronID, $lastTime);
|
||||
$cronInfo = $tester->cron->getById($cronID);
|
||||
|
||||
r($result) && p() && e('1'); // 更新之后查看返回值是否是1
|
||||
r($cronInfo) && p('status') && e('running'); // 更新之后查看状态值是否是running
|
||||
|
||||
system('./ztest init');
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->checkChange();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
判断是否存在时间是0000-00-00 00:00:00状态不是stop的定时任务存在 >> 1
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
|
||||
r($cron->checkChangeTest()) && p() && e('1'); //判断是否存在时间是0000-00-00 00:00:00状态不是stop的定时任务存在
|
||||
Executable
+52
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->checkRule();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
定时任务'分'填写不正确情况 >> "分" 填写的不是合法的值
|
||||
定时任务'小时'填写不正确情况 >> "小时" 填写的不是合法的值
|
||||
定时任务'天'填写不正确情况 >> "天" 填写的不是合法的值
|
||||
定时任务'月'填写不正确情况 >> "月" 填写的不是合法的值
|
||||
定时任务'周'填写不正确情况 >> "周" 填写的不是合法的值
|
||||
定时任务'命令'填写不正确情况 >> 『命令』不能为空。
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$cron1 = new stdClass();
|
||||
$cron1->m = '55x';
|
||||
$res1 = $cron->checkRuleTest($cron1);
|
||||
|
||||
$cron1->m = '55';
|
||||
$cron1->h = '23x';
|
||||
$res2 = $cron->checkRuleTest($cron1);
|
||||
|
||||
$cron1->h = '23';
|
||||
$cron1->dom = '30x';
|
||||
$res3 = $cron->checkRuleTest($cron1);
|
||||
|
||||
$cron1->dom = '30';
|
||||
$cron1->mon = '12x';
|
||||
$res4 = $cron->checkRuleTest($cron1);
|
||||
|
||||
$cron1->mon = '12';
|
||||
$cron1->dow = '6x';
|
||||
$res5 = $cron->checkRuleTest($cron1);
|
||||
|
||||
$cron1->dow = '6';
|
||||
$cron1->command = '';
|
||||
$res6 = $cron->checkRuleTest($cron1);
|
||||
|
||||
r($res1) && p() && e('"分" 填写的不是合法的值'); // 定时任务'分'填写不正确情况
|
||||
r($res2) && p() && e('"小时" 填写的不是合法的值'); // 定时任务'小时'填写不正确情况
|
||||
r($res3) && p() && e('"天" 填写的不是合法的值'); // 定时任务'天'填写不正确情况
|
||||
r($res4) && p() && e('"月" 填写的不是合法的值'); // 定时任务'月'填写不正确情况
|
||||
r($res5) && p() && e('"周" 填写的不是合法的值'); // 定时任务'周'填写不正确情况
|
||||
r($res6) && p() && e('『命令』不能为空。'); // 定时任务'命令'填写不正确情况
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->create();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
命令为空时候返回值 >> 『命令』不能为空
|
||||
添加之后对比添加数据信息 >> test comand,zentao
|
||||
添加之后对比添加数据信息 >> 55,23,30,12,6
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$cron1 = new stdClass();
|
||||
$cron1->m = '55';
|
||||
$cron1->h = '23';
|
||||
$cron1->dom = '30';
|
||||
$cron1->mon = '12';
|
||||
$cron1->dow = '6';
|
||||
$cron1->remark = '';
|
||||
$cron1->type = 'zentao' ;
|
||||
$cron1->command = '';
|
||||
$result1 = $cron->createTest($cron1);
|
||||
|
||||
$cron1->command = 'test comand';
|
||||
$result2 = $cron->createTest($cron1);
|
||||
|
||||
r($result1[0]) && p() && e('『命令』不能为空'); //命令为空时候返回值
|
||||
r($result2) && p('command,type') && e('test comand,zentao');//添加之后对比添加数据信息
|
||||
r($result2) && p('m,h,dom,mon,dow') && e('55,23,30,12,6'); //添加之后对比添加数据信息
|
||||
|
||||
system('./ztest init');
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->getById();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取ID为2的定时的命令,备注,分,时 >> moduleName=execution&methodName=computeburn,更新燃尽图,30,23,normal
|
||||
获取ID为16的定时的命令,备注,分,时 >> moduleName=effort&methodName=remindNotRecord,提醒录入日志,30,7,stop
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$cronInfo1 = $cron->getByIdTest(2);
|
||||
$cronInfo2 = $cron->getByIdTest(16);
|
||||
|
||||
r($cronInfo1) && p('command,remark,m,h,status') && e('moduleName=execution&methodName=computeburn,更新燃尽图,30,23,normal'); //获取ID为2的定时的命令,备注,分,时
|
||||
r($cronInfo2) && p('command,remark,m,h,status') && e('moduleName=effort&methodName=remindNotRecord,提醒录入日志,30,7,stop'); //获取ID为16的定时的命令,备注,分,时
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->getConfigID();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查询cron的configID,目前内置的是19 >> 19
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$id = $cron->getConfigIDTest();
|
||||
|
||||
r($id) && p() && e('19'); //查询cron的configID,目前内置的是19
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->getCrons();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
没有筛选条件时候,获取所有定时任务 >> 19
|
||||
有筛选条件时候,获取定时任务 >> 16
|
||||
获取某个定时任务的信息 >> 同步DevOps构建任务状态,moduleName=ci&methodName=checkCompileStatus
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$list = $cron->getCronsTest();
|
||||
$noStopList = $cron->getCronsTest('nostop');
|
||||
|
||||
r(count($list)) && p() && e('19'); // 没有筛选条件时候,获取所有定时任务
|
||||
r(count($noStopList)) && p() && e('16'); // 有筛选条件时候,获取定时任务
|
||||
r($list) && p('12:remark,command') && e('同步DevOps构建任务状态,moduleName=ci&methodName=checkCompileStatus'); // 获取某个定时任务的信息
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->getLastTime();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取最后执行时间进行对比 >> 19
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$lastTime = $cron->getLastTimeTest();
|
||||
|
||||
r(strlen($lastTime)) && p() && e('19'); //获取最后执行时间进行对比
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->getTurnon();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查询定时任务配置是否开启 >> 1
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$value = $cron->getTurnonTest();
|
||||
|
||||
r($value) && p() && e('1'); //查询定时任务配置是否开启
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->logCron();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
调用日志方法查看日志文件该字符串位置 >> 14
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$file = $tester->app->getLogRoot() . 'cron.' . date( 'Ymd') . '.log.php';
|
||||
if(is_file($file)) unlink($file);
|
||||
|
||||
$cron->logCronTest('cronlogtest');
|
||||
$info = file_get_contents($file);
|
||||
$strExists = strpos($info,'cronlogtest');
|
||||
|
||||
r($strExists) && p() && e('14');// 调用日志方法查看日志文件该字符串位置
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->markCronStatus();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
修改配置项之后查看更新信息 >> stop
|
||||
修改配置项之后查看更新信息 >> run
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$id = $tester->cron->getConfigID();
|
||||
$configID = $cron->markCronStatusTest('stop', $id);
|
||||
$config1 = $tester->dao->select('*')->from(TABLE_CONFIG)->where( 'id')->eq($configID)->fetch();
|
||||
|
||||
$tester->dao->delete()->from(TABLE_CONFIG)->where( 'id')->eq($configID)->exec();
|
||||
$configID = $cron->markCronStatusTest('run');
|
||||
$config2 = $tester->dao->select('*')->from(TABLE_CONFIG)->where( 'id')->eq($configID)->fetch();
|
||||
|
||||
$tester->dao->update(TABLE_CONFIG)->set('id')->eq($id)->where( 'id')->eq($configID)->exec();
|
||||
|
||||
r($config1) && p('value') && e('stop'); //修改配置项之后查看更新信息
|
||||
r($config2) && p('value') && e('run'); //修改配置项之后查看更新信息
|
||||
|
||||
system('./ztest init');
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->parseCron();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取id为19的定时任务的定时信息和命令信息 >> moduleName=measurement&methodName=execCrontabQueue
|
||||
获取id为15的定时任务的定时信息和命令信息 >> moduleName=execution&methodName=computeTaskEffort
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$crons = $tester->cron->getCrons('nostop');
|
||||
$parse = $cron->parseCronTest($crons);
|
||||
|
||||
r($parse) && p('19:command') && e('moduleName=measurement&methodName=execCrontabQueue');//获取id为19的定时任务的定时信息和命令信息
|
||||
r($parse) && p('15:command') && e('moduleName=execution&methodName=computeTaskEffort'); //获取id为15的定时任务的定时信息和命令信息
|
||||
|
||||
system('./ztest init');
|
||||
Executable
+43
@@ -0,0 +1,43 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->runable();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
cron配置为空情况 >> 0
|
||||
cron配置存在,执行时间大于最大可执行时间情况 >> 1
|
||||
cron状态为空情况 >> 1
|
||||
cron状态是stop情况 >> 1
|
||||
cron状态存在不是stop情况 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
|
||||
$tester->config->global->cron = 0;
|
||||
$res1 = $cron->runableTest();
|
||||
|
||||
$tester->config->global->cron = 1;
|
||||
$res2 = $cron->runableTest();
|
||||
|
||||
$tester->config->cron->maxRunTime = PHP_INT_MAX;
|
||||
unset($tester->config->cron->run->status);
|
||||
$res3 = $cron->runableTest();
|
||||
|
||||
$tester->config->cron->run->status = 'stop';
|
||||
$res4 = $cron->runableTest();
|
||||
|
||||
$tester->config->cron->run->status = 'running';
|
||||
$res5 = $cron->runableTest();
|
||||
|
||||
r($res1) && p() && e('0'); //cron配置为空情况
|
||||
r($res2) && p() && e('1'); //cron配置存在,执行时间大于最大可执行时间情况
|
||||
r($res3) && p() && e('1'); //cron状态为空情况
|
||||
r($res4) && p() && e('1'); //cron状态是stop情况
|
||||
r($res5) && p() && e('0'); //cron状态存在不是stop情况
|
||||
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/cron.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 cronModel->update();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
命令为空时候返回值 >> 『命令』不能为空
|
||||
更新之后对比更新数据信息 >> test comand,zentao
|
||||
更新之后对比更新数据信息 >> 55,23,30,12,6
|
||||
|
||||
*/
|
||||
|
||||
$cron = new cronTest();
|
||||
$cronID = 1;
|
||||
$cron1 = new stdClass();
|
||||
$cron1->m = '55';
|
||||
$cron1->h = '23';
|
||||
$cron1->dom = '30';
|
||||
$cron1->mon = '12';
|
||||
$cron1->dow = '6';
|
||||
$cron1->remark = '';
|
||||
$cron1->type = 'zentao' ;
|
||||
$cron1->command = '';
|
||||
$result1 = $cron->updateTest($cronID, $cron1);
|
||||
|
||||
$cron1->command = 'test comand';
|
||||
$result2 = $cron->updateTest($cronID, $cron1);
|
||||
|
||||
r($result1[0]) && p() && e('『命令』不能为空'); //命令为空时候返回值
|
||||
r($result2) && p('command,type') && e('test comand,zentao');//更新之后对比更新数据信息
|
||||
r($result2) && p('m,h,dom,mon,dow') && e('55,23,30,12,6'); //更新之后对比更新数据信息
|
||||
|
||||
system('./ztest init');
|
||||
@@ -52,8 +52,6 @@ $moreThanParent['parent'] = '1';
|
||||
$moreThanParent['begin'] = '2018-01-01';
|
||||
$moreThanParent['end'] = '2022-02-10';
|
||||
|
||||
$add_itemset = array('1', '2', '3', '4', '5', '6');
|
||||
|
||||
r($program->create($normalProgram)) && p('name') && e('测试新增项目集一'); // 创建新项目集
|
||||
r($program->create($emptyNameProgram)) && p('message[name]:0') && e('『项目集名称』不能为空。'); // 项目集名称为空时
|
||||
r($program->create($emptyBeginProgram)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 项目集的开始时间为空
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->buildMenuQuery();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
r(strlen($tester->project->buildMenuQuery(11))) && p() && e('231'); // 获取构建的查询项目的sql的字符串长度
|
||||
r(strlen($tester->project->buildMenuQuery(100))) && p() && e('233'); // 获取构建的查询项目的sql的字符串长度
|
||||
@@ -19,4 +19,4 @@ $project = new Project('admin');
|
||||
$getID = array(1, 101);
|
||||
|
||||
r($project->checkHasChildren($getID[0])) && p() && e('1'); //获取id为1的项目是否有子项目
|
||||
r($project->checkHasChildren($getID[1])) && p() && e('0'); //获取id为101的项目是否有子项目
|
||||
r($project->checkHasChildren($getID[1])) && p() && e('0'); //获取id为101的项目是否有子项目
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::create();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
创建新项目 >> 测试新增项目一
|
||||
项目名称为空时 >> 『项目名称』不能为空。
|
||||
项目的开始时间为空 >> 『计划开始』不能为空。
|
||||
项目的完成时间为空 >> 『计划完成』不能为空。
|
||||
项目的计划完成时间大于计划开始时间 >> 『计划完成』应当大于『2022-01-12』。
|
||||
项目的完成日期大于父项目的完成日期(需要实时更新日期) >> 父项目的开始日期:2022-01-16,开始日期不能小于父项目的开始日期
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->app->loadConfig('execution');
|
||||
$project = new Project();
|
||||
|
||||
$data = array(
|
||||
'parent' => 1,
|
||||
'name' => '测试新增项目一',
|
||||
'budget' => '',
|
||||
'budgetUnit' => 'CNY',
|
||||
'begin' => '2022-02-07',
|
||||
'end' => '2022-03-01',
|
||||
'desc' => '测试项目描述',
|
||||
'acl' => 'private',
|
||||
'whitelist' => '',
|
||||
'PM' => '',
|
||||
'products' => array(1)
|
||||
);
|
||||
|
||||
$normalProject = $data;
|
||||
|
||||
$emptyNameProject = $data;
|
||||
$emptyNameProject['name'] = '';
|
||||
|
||||
$emptyBeginProject = $data;
|
||||
$emptyBeginProject['begin'] = '';
|
||||
|
||||
$emptyEndProject = $data;
|
||||
$emptyEndProject['end'] = '';
|
||||
|
||||
$beginGtEndProject = $data;
|
||||
$beginGtEndProject['end'] = '2022-01-10';
|
||||
|
||||
$moreThanParent = $data;
|
||||
$moreThanParent['parent'] = '1';
|
||||
$moreThanParent['begin'] = '2018-01-01';
|
||||
|
||||
r($project->create($normalProject)) && p('name') && e('测试新增项目一'); // 创建新项目
|
||||
r($project->create($emptyNameProject)) && p('message[name]:0') && e('『项目名称』不能为空。'); // 项目名称为空时
|
||||
r($project->create($emptyBeginProject)) && p('message[begin]:0') && e('『计划开始』不能为空。'); // 项目的开始时间为空
|
||||
r($project->create($emptyEndProject)) && p('message[end]:0') && e('『计划完成』不能为空。'); // 项目的完成时间为空
|
||||
r($project->create($beginGtEndProject)) && p('message[end]:0') && e('『计划完成』应当大于『2022-01-12』。'); // 项目的计划完成时间大于计划开始时间
|
||||
r($project->create($moreThanParent)) && p('message:begin;message:end') && e('父项目的开始日期:2022-01-16,开始日期不能小于父项目的开始日期'); // 项目的完成日期大于父项目的完成日期(需要实时更新日期)
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->getBranchesByProject();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$projectIdList = array(11, 12, 13);
|
||||
|
||||
r(count($tester->project->getBranchesByProject(11))) && p('') && e('3'); // 获取id为11的项目的关联产品的分支数组数量,按产品分组
|
||||
r(key($tester->project->getBranchesByProject(11))) && p('') && e('1'); // 获取id为11的项目的关联产品的分支数组,获取第一个数组的键
|
||||
r(count($tester->project->getBranchesByProject(12))) && p('') && e('3'); // 获取id为12的项目的关联产品的分支数组数量,按产品分组
|
||||
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->getBranchGroupByProject();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$productIdList = array(1, 2, 3);
|
||||
|
||||
r(count($tester->project->getBranchGroupByProject(11, $productIdList))) && p('') && e('1'); // 获取id为11的项目的关联产品的分支数组数量,按产品分组
|
||||
r(key($tester->project->getBranchGroupByProject(12, $productIdList))) && p('') && e('2'); // 获取id为11的项目的关联产品的分支数组,获取第一个数组的键
|
||||
r(count($tester->project->getBranchGroupByProject(13, $productIdList))) && p('') && e('1'); // 获取id为12的项目的关联产品的分支数组数量,按产品分组
|
||||
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +12,7 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$t = new Project('admin');
|
||||
/* GetBudgetUnitList(). */
|
||||
r($t->checkBudgetUnitList()) && p() && e('1'); //检查翻译
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
r($tester->project->getBudgetUnitList()) && p('CNY,USD') && e('人民币,美元'); //获取系统中的货币单位
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,17 +22,16 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$t = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$getId = array(11, 0, 1, 0, 101, 0, 131, 0, 161, 0);
|
||||
|
||||
r($t->getProjectByID($getId[0])) && p('code,type') && e('project1,project'); //获取ID等于11的项目
|
||||
r($t->getProjectByID($getId[1])) && p('code,type') && e('0'); //获取不存在的项目
|
||||
r($t->getProgramByID($getId[2])) && p('code,type') && e('program1,program'); //获取ID等于1的项目集
|
||||
r($t->getProgramByID($getId[3])) && p('code,type') && e('0'); //获取不存在的项目集
|
||||
r($t->getSprintByID($getId[4])) && p('code,type') && e('project1,sprint'); //获取ID等于101的冲刺
|
||||
r($t->getSprintByID($getId[5])) && p('code,type') && e('0'); //获取不存在的冲刺
|
||||
r($t->getStageByID($getId[6])) && p('code,type') && e('project31,stage'); //获取ID等于131的阶段
|
||||
r($t->getStageByID($getId[7])) && p('code,type') && e('0'); //获取不存在的阶段
|
||||
r($t->getKanbanByID($getId[8])) && p('code,type') && e('project61,kanban'); //获取ID等于161的阶段
|
||||
r($t->getKanbanByID($getId[9])) && p('code,type') && e('0'); //获取不存在的看板
|
||||
r($tester->project->getByID(11, 'project')) && p('code,type') && e('project1,project'); //获取ID等于11的项目
|
||||
r($tester->project->getByID(0, 'project')) && p('code,type') && e('0'); //获取不存在的项目
|
||||
r($tester->project->getByID(1, 'program')) && p('code,type') && e('program1,program'); //获取ID等于1的项目集
|
||||
r($tester->project->getByID(0, 'program')) && p('code,type') && e('0'); //获取不存在的项目集
|
||||
r($tester->project->getByID(101, 'sprint')) && p('code,type') && e('project1,sprint'); //获取ID等于101的冲刺
|
||||
r($tester->project->getByID(0, 'sprint')) && p('code,type') && e('0'); //获取不存在的冲刺
|
||||
r($tester->project->getByID(131, 'stage')) && p('code,type') && e('project31,stage'); //获取ID等于131的阶段
|
||||
r($tester->project->getByID(0, 'stage')) && p('code,type') && e('0'); //获取不存在的阶段
|
||||
r($tester->project->getByID(161, 'kanban')) && p('code,type') && e('project61,kanban'); //获取ID等于161的阶段
|
||||
r($tester->project->getByID(0, 'kanban')) && p('code,type') && e('0'); //获取不存在的看板
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,8 +13,8 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$t = new Project('admin');
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
$projectIdList = array(11,12,13);
|
||||
|
||||
r(($t->getByIdList($projectIdList, 3))) && p('11:name;12:name;13:name') && e('项目1;项目2;项目3'); //获取projectIdList对应的项目名称
|
||||
r(($tester->project->getByIdList($projectIdList))) && p('11:name;12:name;13:name') && e('项目1;项目2;项目3'); //获取projectIdList对应的项目名称
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,13 +17,17 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$t_status = array('doing', 'wait', 'suspended', 'closed', 'all');
|
||||
$doingProjects = $tester->project->getInfoList('doing');
|
||||
$waitProjects = $tester->project->getInfoList('wait');
|
||||
$suspendedProjects = $tester->project->getInfoList('suspended');
|
||||
$closedProjects = $tester->project->getInfoList('closed');
|
||||
$allProjects = $tester->project->getInfoList('all');
|
||||
|
||||
//var_dump($project->getInfoList('all'));die;
|
||||
r($project->getInfoList($t_status[0])) && p() && e('0'); //查询正在进行的项目
|
||||
r($project->getInfoList($t_status[1])) && p('11:name') && e('项目1'); //查询等待状态的项目
|
||||
r($project->getInfoList($t_status[2])) && p() && e('0'); //查询暂停状态的项目
|
||||
r($project->getInfoList($t_status[3])) && p() && e('0'); //查询关闭状态的项目
|
||||
r($project->getInfoList($t_status[4])) && p('11:name') && e('项目1'); //查询所有状态的项目
|
||||
r(count($doingProjects)) && p() && e('44'); //查询正在进行的项目数量
|
||||
r($waitProjects) && p('11:name') && e('项目1'); //查询wait状态的Id为11的项目名称
|
||||
r(count($suspendedProjects)) && p() && e('11'); //查询暂停状态的项目数量
|
||||
r(count($closedProjects)) && p() && e('11'); //查询关闭状态的项目数量
|
||||
r(count($allProjects)) && p() && e('110'); //查询所有状态的项目数量
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::getInfoList;
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$products1 = $tester->project->getMultiLinkedProducts(1);
|
||||
$products2 = $tester->project->getMultiLinkedProducts(11);
|
||||
|
||||
r(count($products1)) && p() && e('0'); //查询项目1的关联产品数量
|
||||
r(count($products2)) && p() && e('3'); //查询项目11的关联产品数量
|
||||
r($products2) && p('1,91,81') && e('正常产品1,多平台产品91,多平台产品81'); //查询项目11关联的产品名称
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,13 +18,21 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$t = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$P_status = array('wait', 'undone', 11, 10000, 'id_asc', 'name_desc');
|
||||
$byStatus1 = $tester->project->getOverviewList('byStatus', 'wait');
|
||||
$byStatus2 = $tester->project->getOverviewList('byStatus', 'undone');
|
||||
|
||||
r($t->getByStatus($P_status[0])) && p() && e('15'); // 获取未开始的项目
|
||||
r($t->getByStatus($P_status[1])) && p() && e('15'); // 获取状态不为done和closed的项目
|
||||
r($t->getByID($P_status[2])) && p('11:id') && e('11'); // 根据项目ID获取项目详情
|
||||
r($t->getByID($P_status[3])) && p('id') && e('0'); // 获取不存在的项目
|
||||
r($t->getListByOrder($P_status[4])) && p() && e('1'); //按照ID正序获取项目列表
|
||||
r($t->getListByOrder($P_status[5])) && p() && e('1'); // 按照项目名称倒序获取项目列表
|
||||
$byId1 = $tester->project->getOverviewList('byid', '11');
|
||||
$byId2 = $tester->project->getOverviewList('byid', '10000');
|
||||
|
||||
$byOrder1 = $tester->project->getOverviewList('byStatus', 'all', 'id_asc');
|
||||
$byOrder2 = $tester->project->getOverviewList('byStatus', 'all', 'name_desc');
|
||||
|
||||
r(count($byStatus1)) && p() && e('15'); // 获取未开始的项目数量
|
||||
r(count($byStatus2)) && p() && e('15'); // 获取状态不为done和closed的项目数量
|
||||
r(count($byId1)) && p() && e('1'); // 根据项目ID获取项目
|
||||
r(count($byId2)) && p() && e('0'); // 获取不存在的项目
|
||||
r(current($byOrder1)) && p('id,name') && e('11,项目1'); // 按照ID正序获取项目列表,查看排第一个的项目详情
|
||||
r(current($byOrder2)) && p('id,name') && e('100,项目90'); // 按照项目名称倒序获取项目列表,查看排第一个的项目详情
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::getPairsByIdList;
|
||||
title=测试 projectModel->getPairsByIdList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -14,10 +14,9 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
$projectIdList = array(0, 11, 12, 13);
|
||||
|
||||
$findProject = array(0,11,12,13);
|
||||
$findAllPro = array();
|
||||
|
||||
r($project->getByIdListFind($findProject)) && p() && e('3'); //查找ID为0、11、12、13的项目
|
||||
r($project->getByIdListFind($findAllPro)) && p() && e('90'); //查找所有项目
|
||||
r(count($tester->project->getPairsByIdList($projectIdList))) && p() && e('3'); //查找ID为0、11、12、13的项目数量
|
||||
r(count($tester->project->getPairsByIdList(array()))) && p() && e('110'); //查找所有项目数量
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->getPairsByModel();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
r(count($tester->project->getPairsByModel('all', 1))) && p() && e('9'); // 获取项目集1下的所有项目数量
|
||||
r($tester->project->getPairsByModel('all', 1)) && p('21') && e('项目集1 / 项目11'); // 获取项目集1下的项目名称
|
||||
r(count($tester->project->getPairsByModel('waterfall', 1))) && p() && e('3'); // 获取项目集1下的所有瀑布项目数量
|
||||
@@ -1,36 +1,23 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::getPairsByProgram;
|
||||
title=测试 projectModel->getPairsByProgram();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查找管理员可查看的所有项目 >> 90
|
||||
查找独立项目 >> No data.
|
||||
查找管理员可查看的所属项目集ID为1的项目 >> 9
|
||||
查找管理员可查看的所属项目集ID为1且状态为wait的项目 >> 3
|
||||
查找管理员可查看的所属项目集ID为1且状态不为closed的项目 >> 7
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
public function getListByOrder($orderBy)
|
||||
{
|
||||
$projects = $this->project->getPairsByProgram(3, 'doing', $orderBy);
|
||||
return checkOrder($projects, $orderBy);
|
||||
}
|
||||
}*/
|
||||
|
||||
$t = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$t_project = array('', 0, 1, 'wait', 'noclosed');
|
||||
|
||||
r($t->getByProgram($t_project[0])) && p() && e('90'); //查找管理员可查看的所有项目
|
||||
r($t->getByProgram($t_project[1])) && p() && e('No data.'); //查找独立项目
|
||||
r($t->getByProgram($t_project[2])) && p() && e('9'); //查找管理员可查看的所属项目集ID为1的项目
|
||||
r($t->getByStatusPairs($t_project[3])) && p() && e('3'); //查找管理员可查看的所属项目集ID为1且状态为wait的项目
|
||||
r($t->getByStatusPairs($t_project[4])) && p() && e('7'); //查找管理员可查看的所属项目集ID为1且状态不为closed的项目
|
||||
r(count($tester->project->getPairsByProgram('', 'all', true))) && p() && e('110'); // 查找管理员可查看的所有项目数量
|
||||
r(count($tester->project->getPairsByProgram(0))) && p() && e('20'); // 查找独立项目数量
|
||||
r(count($tester->project->getPairsByProgram(1))) && p() && e('9'); // 查找管理员可查看的所属项目集ID为1的项目数量
|
||||
r(count($tester->project->getPairsByProgram(1, 'wait'))) && p() && e('3'); // 查找管理员可查看的所属项目集ID为1且状态为wait的项目数量
|
||||
r(count($tester->project->getPairsByProgram(1, 'noclosed'))) && p() && e('9'); // 查找管理员可查看的所属项目集ID为1且状态不为closed的项目数量
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::getParentName();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取id为11的项目父项目名字 >> 项目集1
|
||||
获取id为1的项目父项目名字 >> 项目集1
|
||||
获取id为0的项目父项目名字 >> 0
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
|
||||
$getName = array(11, 1, 0);
|
||||
|
||||
r($project->getParentName($getName[0])) && p('name') && e('项目集1'); //获取id为11的项目父项目名字
|
||||
r($project->getParentName($getName[1])) && p('name') && e('项目集1'); //获取id为1的项目父项目名字
|
||||
r($project->getParentName($getName[2])) && p('name') && e('0'); //获取id为0的项目父项目名字
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::getParentName();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取id为11的项目父项目名字 >> 项目集1
|
||||
获取id为1的项目父项目名字 >> 项目集1
|
||||
获取id为0的项目父项目名字 >> 0
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$project1 = $tester->project->getById(11);
|
||||
$project2 = $tester->project->getById(1);
|
||||
|
||||
r($tester->project->getParentProgram($project1)) && p('name') && e('项目集1'); // 获取id为11的项目父项目名字
|
||||
r($tester->project->getParentProgram($project2)) && p('name') && e('0'); // 获取id为1的项目父项目名字
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,17 +9,13 @@ title=测试 projectModel::getProjectsConsumed;
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
var_dump(->getConsumed());die; >> 21.0
|
||||
>> 28.0
|
||||
>> 35.0
|
||||
|
||||
*/
|
||||
|
||||
$projects = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$getConsumed = array(11, 12, 13);
|
||||
$projectIdList = array(11, 12, 13);
|
||||
|
||||
//var_dump($projects->getConsumed($getConsumed));die;
|
||||
r($projects->getConsumed($getConsumed)) && p('11:totalConsumed') && e('21.0');
|
||||
r($projects->getConsumed($getConsumed)) && p('12:totalConsumed') && e('28.0');
|
||||
r($projects->getConsumed($getConsumed)) && p('13:totalConsumed') && e('35.0');
|
||||
r($tester->project->getProjectsConsumed($projectIdList)) && p('11:totalConsumed') && e('21.0'); // 批量获取各个项目的总计消耗工时
|
||||
r($tester->project->getProjectsConsumed($projectIdList)) && p('12:totalConsumed') && e('28.0'); // 批量获取各个项目的总计消耗工时
|
||||
r($tester->project->getProjectsConsumed($projectIdList)) && p('13:totalConsumed') && e('35.0'); // 批量获取各个项目的总计消耗工时
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::checkHasContent;
|
||||
title=测试 projectModel->getStatData();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -17,10 +17,11 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
r($project->getStatData(13)) && p('bugCount') && e('3'); //统计id=13的项目bug数量
|
||||
r($project->getStatData(13)) && p('taskCount') && e('13'); //任务数量
|
||||
r($project->getStatData(13)) && p('waitCount') && e('2'); //暂停数量
|
||||
r($project->getStatData(13)) && p('doingCount') && e('2'); //进行的数量
|
||||
r($project->getStatData(13)) && p('finishedCount') && e('0'); //完成的数量
|
||||
r($tester->project->getStatData(13)) && p('bugCount') && e('4'); //统计id=13的项目bug数量
|
||||
r($tester->project->getStatData(13)) && p('taskCount') && e('13'); //任务数量
|
||||
r($tester->project->getStatData(13)) && p('waitCount') && e('2'); //未开始数量
|
||||
r($tester->project->getStatData(13)) && p('doingCount') && e('2'); //进行的数量
|
||||
r($tester->project->getStatData(13)) && p('finishedCount') && e('0'); //完成的数量
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->getStoriesByProject();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$result = $tester->project->getStoriesByProject(11);
|
||||
|
||||
r(count($result)) && p() && e('2'); // 获取项目11关联的所有产品数量
|
||||
r($result[91]) && p('0:project') && e('11'); // 获取项目11关联的产品ID为91的详情
|
||||
@@ -15,6 +15,5 @@ pid=1
|
||||
|
||||
$project = $tester->loadModel('project');
|
||||
|
||||
//var_dump($project->getSwitcher(11, 'project', 'browse'));die;
|
||||
r($project->getSwitcher(11, 'project', 'browse')) && p() && e('0'); //获取项目下拉菜单,项目列表页面没有项目下拉菜单
|
||||
r($project->getSwitcher(11, 'project', 'execution')) && p() && e("<span class='text'>项目1</span>"); //获取项目ID为11的迭代列表页面的项目下拉菜单,查看是否包含项目ID为11的名称
|
||||
r($project->getSwitcher(11, 'project', 'browse')) && p() && e('0'); // 获取项目下拉菜单,项目列表页面没有项目下拉菜单
|
||||
r(strpos($project->getSwitcher(11, 'project', 'execution'), "<span class='text'>项目1</span>")) && p() && e('137'); // 获取项目ID为11的迭代列表页面的项目下拉菜单,查看项目1下拉框出现的位置
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel::getTotalBugByProject;
|
||||
title=测试 projectModel->getTotalBugByProject();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -13,11 +13,10 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$getBug = array(11, 12, 13, 14, 15, 16, 27);
|
||||
$projectIdList = array(11, 12, 13, 14, 15, 16, 27);
|
||||
|
||||
//var_dump($project->getTotalBugBy($getBug, 'active'));die;
|
||||
|
||||
r($project->getTotalBugBy($getBug, 'active')) && p(11) && e('3'); //状态一致时正常打印id为11的项目bug数量
|
||||
r($project->getTotalBugBy($getBug, 'active')) && p(27) && e(''); //在状态status不一致的情况下,打印id为27的项目bug数量
|
||||
r($tester->project->getTotalBugByProject($projectIdList, 'active')) && p('11') && e('4'); //获取id为11的项目下激活的bug数量
|
||||
r($tester->project->getTotalBugByProject($projectIdList, 'active')) && p('27') && e(''); //获取id为27的项目下激活的bug数量
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,10 +9,14 @@ title=测试 projectModel::getTotalStoriesByProject;
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
var_dump($project->getTotalStoriesByProject());die;
|
||||
$productIdList = array(1, 2, 3);
|
||||
$stories1 = $tester->project->getTotalStoriesByProject(11);
|
||||
$stories2 = $tester->project->getTotalStoriesByProject(11, $productIdList);
|
||||
|
||||
r($stories1) && p() && e('0'); // 不传入产品ID列表,获取项目11下的所有需求数量
|
||||
r($stories2) && p() && e('2'); // 传入产品ID列表,获取项目11下的所有需求数量
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->getTotalTaskByProject();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
状态一致时正常打印id为11的项目bug数量 >> 3
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$projectIdList = array(11, 12, 13, 14, 15, 16, 27);
|
||||
|
||||
r($tester->project->getTotalTaskByProject($projectIdList, 'undone')) && p('11') && e('14'); // 获取id为11的项目下激活的task数量
|
||||
r($tester->project->getTotalTaskByProject($projectIdList, 'done')) && p('15') && e('2'); // 获取id为15的项目下完成的task数量
|
||||
r($tester->project->getTotalTaskByProject($projectIdList, 'undone')) && p('27') && e('8'); // 获取id为27的项目下激活的task数量
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 projectModel->getTreeMenu();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
$lastMenu = $tester->project->getTreeMenu(0, array('projectmodel', 'createManageLink'));
|
||||
|
||||
r(strlen($lastMenu)) && p() && e('1596'); // 查看获取到的menu option的字符串数量
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/project.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,8 +14,9 @@ pid=1
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('admin');
|
||||
global $tester;
|
||||
$tester->loadModel('project');
|
||||
|
||||
r($project->getWorkHour(13)) && p('totalEstimate') && e('61.0'); //预计61.0小时
|
||||
r($project->getWorkHour(13)) && p('totalConsumed') && e('95.0'); //消耗95.0小时
|
||||
r($project->getWorkHour(1000)) && p('totalEstimate') && e(''); //测试不存在的项目
|
||||
r($tester->project->getWorkHour(13)) && p('totalEstimate') && e('61.0'); //获取项目ID为13的预计工时,61.0小时
|
||||
r($tester->project->getWorkHour(13)) && p('totalConsumed') && e('95.0'); //获取项目ID为13的消耗工时,95.0小时
|
||||
r($tester->project->getWorkHour(1000)) && p('totalEstimate') && e(''); //测试不存在的项目
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +38,7 @@ $waitProject = $projectModel->getByID(11);
|
||||
$doingProject = $projectModel->getByID(13);
|
||||
$suspendProject = $projectModel->getByID(17);
|
||||
$closedProject = $projectModel->getByID(18);
|
||||
$status = array('start', 'finish', 'close', 'suspend', 'activate', );
|
||||
$status = array('start', 'finish', 'close', 'suspend', 'activate', );
|
||||
|
||||
r($projectModel->isClickable($waitProject, $status[0])) && p() && e('1'); // 检查未开始项目的开始按钮
|
||||
r($projectModel->isClickable($waitProject, $status[1])) && p() && e('1'); // 检查未开始项目的完成按钮
|
||||
@@ -58,4 +59,4 @@ r($projectModel->isClickable($closedProject, $status[0])) && p() && e('0'); //
|
||||
r($projectModel->isClickable($closedProject, $status[1])) && p() && e('0'); // 检查已关闭项目的完成按钮
|
||||
r($projectModel->isClickable($closedProject, $status[2])) && p() && e('0'); // 检查已关闭项目的关闭按钮
|
||||
r($projectModel->isClickable($closedProject, $status[3])) && p() && e('0'); // 检查已关闭项目的暂停按钮
|
||||
r($projectModel->isClickable($closedProject, $status[4])) && p() && e('1'); // 检查已关闭项目的激活按钮
|
||||
r($projectModel->isClickable($closedProject, $status[4])) && p() && e('1'); // 检查已关闭项目的激活按钮
|
||||
|
||||
@@ -9,14 +9,8 @@ title=测试 programModel::saveState;
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
传入存在ID的值14,保存session,返回对应值14 >> 14
|
||||
传入存在ID的值99,保存session,返回第一位默认值11 >> 11
|
||||
|
||||
*/
|
||||
|
||||
$project = new Project('dev1');
|
||||
$project = new Project();
|
||||
|
||||
$projectId = array(14, 99);
|
||||
|
||||
r($project->saveState($projectId[0])) && p() && e('14'); //传入存在ID的值14,保存session,返回对应值14
|
||||
r($project->saveState($projectId[1])) && p() && e('11'); //传入存在ID的值99,保存session,返回第一位默认值11
|
||||
r($project->saveState(99)) && p() && e('11'); //传入存在ID的值99,保存session,返回第一位默认值11
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user