Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into tianshujie_fixbug

This commit is contained in:
tianshujie
2023-01-29 16:15:27 +08:00
36 changed files with 747 additions and 123 deletions
+1 -1
View File
@@ -1930,7 +1930,7 @@
23560 项目-测试用例列表有报错
2022-06-02 17.0
修复的bug
修复的Bug
22948 执行需求列表中列名称显示遮挡
22898 项目关闭导致该项目下执行所属项目自动变更了
22904 导入测试用例模板没有区分必填项
+3 -33
View File
@@ -83,41 +83,14 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
</td>
</tr>
<?php $showExecution = (strpos(",$showFields,", ',execution,') !== false);?>
<tr class='bug-type'>
<th><?php echo $showExecution ? $lang->bug->project : $lang->bug->type;?></th>
<?php if(!$showExecution):?>
<?php $showOS = strpos(",$showFields,", ',os,') !== false;?>
<?php $showBrowser = strpos(",$showFields,", ',browser,') !== false;?>
<td>
<div class='input-group' id='bugTypeInputGroup'>
<?php echo html::select('type', $lang->bug->typeList, $type, "class='form-control'");?>
<?php if($showOS):?>
<div class='table-col'>
<div class='input-group'>
<span class='input-group-addon fix-border'><?php echo $lang->bug->os?></span>
<?php echo html::select('os[]', $lang->bug->osList, $os, "class='form-control chosen' multiple");?>
</div>
</div>
<?php endif;?>
<?php if($showBrowser):?>
<div class='table-col'>
<div class='input-group'>
<span class='input-group-addon fix-border'><?php echo $lang->bug->browser?></span>
<?php echo html::select('browser[]', $lang->bug->browserList, $browser, "class='form-control chosen' multiple");?>
</div>
</div>
<?php endif;?>
</div>
</td>
<?php endif;?>
<?php if($showExecution):?>
<tr>
<th><?php echo $lang->bug->project?></th>
<td>
<div class='table-row'>
<div class='table-col' id='projectBox'>
<?php echo html::select('project', $projects, $projectID, "class='form-control chosen' onchange='loadProductExecutions({$productID}, this.value)'");?>
</div>
<?php $executionClass = ($execution and !$execution->multiple) ? 'hidden' : '';?>
<?php $executionClass = !$showExecution ? 'hidden' : '';?>
<div class="table-col executionBox <?php echo $executionClass;?>">
<div class='input-group' id='executionIdBox'>
<span class='input-group-addon fix-border' id='executionBox'><?php echo $projectModel == 'kanban' ? $lang->bug->kanban : $lang->bug->execution;?></span>
@@ -126,7 +99,6 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
</div>
</div>
</td>
<?php endif;?>
<td>
<div class='input-group' id='buildBox'>
<span class="input-group-addon"><?php echo $lang->bug->openedBuild?></span>
@@ -177,7 +149,6 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
</td>
</tr>
<?php endif;?>
<?php if($showExecution):?>
<?php $showOS = strpos(",$showFields,", ',os,') !== false;?>
<?php $showBrowser = strpos(",$showFields,", ',browser,') !== false;?>
<tr class='bug-type'>
@@ -206,7 +177,6 @@ if($this->app->tab == 'project') js::set('objectID', $projectID);
</div>
</td>
</tr>
<?php endif;?>
<?php if(isset($executionType) and $executionType == 'kanban'):?>
<tr>
<th><?php echo $lang->kanbancard->region;?></th>
+2
View File
@@ -251,6 +251,8 @@ class custom extends control
}
$this->custom->deleteItems("lang=$lang&module=$module&section=$field&vision={$this->config->vision}");
if($lang == 'all') $this->custom->deleteItems("lang=$currentLang&module=$module&section=$field&vision={$this->config->vision}");
$data = fixer::input('post')->get();
$emptyKey = false;
foreach($data->keys as $index => $key)
+4 -4
View File
@@ -36,7 +36,7 @@
<?php foreach($apis as $api):?>
<div class='detail'>
<?php
$methodName = $api['name'];
$methodName = zget($api, 'name', '');
$params = array();
if(isset($api['param']))
{
@@ -46,12 +46,12 @@
?>
<div class='detail-title'>
<?php
echo $api['post'] ? 'GET/POST' : 'GET';
echo '&nbsp;&nbsp;' . $this->createLink($selectedModule, $api['name'], $params, 'json');
echo !empty($api['post']) ? 'GET/POST' : 'GET';
echo '&nbsp;&nbsp;' . $this->createLink($selectedModule, $methodName, $params, 'json');
?>
</div>
<div class='detail-content'>
<?php echo $api['desc'];?>
<?php echo zget($api, 'desc', '');?>
<table class='table table-bordered'>
<tr>
<th><?php echo $lang->dev->params?></th>
-2
View File
@@ -1531,8 +1531,6 @@ class execution extends control
}
$dateList = date::getDateList($begin, $end, 'Y-m-d', $withWeekend == 'false'? 'noweekend' : '');
//list($cycleTimeAvg, $throughput) = $this->execution->getCFDStatistics($executionID, $dateList, $type);
$chartData = $this->execution->buildCFDData($executionID, $dateList, $type);
if(isset($chartData['line'])) $chartData['line'] = array_reverse($chartData['line']);
+1 -39
View File
@@ -2283,7 +2283,7 @@ class executionModel extends model
$productType = 'normal';
$productNum = count($products);
$productPairs = array(0 => '');
$branches = $this->loadModel('project')->getBranchesByProject($execution->id);
$branches = empty($execution) ? array() : $this->loadModel('project')->getBranchesByProject($execution->id);
foreach($products as $product)
{
@@ -3763,44 +3763,6 @@ class executionModel extends model
return $data;
}
/**
* Get CFD statistics.
*
* @param int $executionID
* @param array $dateList
* @param string $type
* @access public
* @return void
*/
public function getCFDStatistics($executionID, $dateList, $type)
{
$kanbanData = $this->loadModel('kanban')->getRDKanban($executionID, $type);
$kanbanData = array_shift($kanbanData);
$cycleTime = array();
foreach($kanbanData->groups as $group)
{
foreach($group->lanes as $lane)
{
if(!isset($lane->items['closed'])) continue;
foreach($lane->items['closed'] as $item)
{
$diffTime = $type == 'story' ? strtotime($item['lastEditedDate']) - strtotime($item['openedDate']) : strtotime($item['closedDate']) - strtotime($item['openedDate']);
$day = round($diffTime / (3600 * 24), 1);
if($day > 0) $cycleTime[$item['id']] = $day;
}
}
}
$itemCount = count($cycleTime);
if(!$itemCount) return array('', '');
$cycleTimeAvg = round(array_sum($cycleTime) / $itemCount, 1);
$throughput = round(($itemCount * 7) / $cycleTimeAvg, 1) . "{$this->lang->execution->kanbanCardsUnit}/" . $this->lang->execution->week;
return array($cycleTimeAvg, $throughput);
}
/**
* Get taskes by search.
*
+2 -1
View File
@@ -72,7 +72,8 @@
</td>
<?php $params = "testcaseID=$caseID&version=$case->version";?>
<?php if($type == 'assigntome') $params .= "&from=testtask&taskID=$case->task";?>
<td class='c-title text-left' title="<?php echo $case->title?>"><?php echo html::a($this->createLink('testcase', 'view', $params, '', '', $case->project), $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'");?></td>
<?php $autoIcon = $case->auto == 'auto' ? " <i class='icon icon-draft-edit'></i>" : '';?>
<td class='c-title text-left' title="<?php echo $case->title?>"><?php echo html::a($this->createLink('testcase', 'view', $params, '', '', $case->project), $case->title . $autoIcon, null, "style='color: $case->color' data-app='{$this->app->tab}'");?></td>
<td><span class='label-pri <?php echo 'label-pri-' . $case->pri?>' title='<?php echo zget($lang->testcase->priList, $case->pri, $case->pri);?>'><?php echo zget($lang->testcase->priList, $case->pri, $case->pri)?></span></td>
<td><?php echo zget($lang->testcase->typeList, $case->type);?></td>
<td>
+6 -1
View File
@@ -357,7 +357,12 @@ js::set('vision', $this->config->vision);
<?php foreach($stories as $story):?>
<tr data-id='<?php echo $story->id?>' data-estimate='<?php echo $story->estimate?>' <?php if(!empty($story->children)) echo "data-children=" . count($story->children);?> data-cases='<?php echo zget($storyCases, $story->id, 0);?>'>
<?php $story->from = $from;?>
<?php if(!empty($branchOptions) and isset($branchOptions[$story->product])) $branchOption = $branchOptions[$story->product];?>
<?php
if(!empty($branchOptions))
{
$branchOption = isset($branchOptions[$story->product]) ? $branchOptions[$story->product] : array();
}
?>
<?php if($this->app->getViewType() == 'xhtml'):?>
<?php
foreach($setting as $key => $value)
+1
View File
@@ -2044,6 +2044,7 @@ class project extends control
/* Delete the execution under the project. */
$executionIdList = $this->loadModel('execution')->getPairs($projectID);
$this->dao->update(TABLE_BUG)->set('execution')->eq(0)->where('execution')->in(array_keys($executionIdList))->exec();
/* Delete shadow product.*/
$project = $this->project->getByID($projectID);
@@ -112,7 +112,6 @@ $closedCount = 0;
foreach($setting as $value)
{
if($value->id == 'status' and strpos(',all,bysearch,undone,', ",$browseType,") === false) $value->show = false;
if($value->id == 'teamCount' and $browseType == 'all') $value->show = false;
if(commonModel::isTutorialMode() && ($value->id == 'PM' || $value->id == 'budget' || $value->id == 'teamCount')) $value->show = false;
if($value->show) $this->datatable->printHead($value, $orderBy, $vars, $canBatchEdit);
}
+3 -1
View File
@@ -37,8 +37,10 @@ class screen extends control
* @access public
* @return void
*/
public function view($screenID, $year = 2022, $dept = 0, $account = '')
public function view($screenID, $year = 0, $dept = 0, $account = '')
{
if(empty($year)) $year = date('Y');
if($screenID == 3) $this->locate($this->createLink('report', 'annualData'));
$screen = $this->screen->getByID($screenID, $year, $dept, $account);
+32 -4
View File
@@ -142,24 +142,52 @@ class stage extends control
public function setType($lang2Set = '')
{
$this->loadModel('custom');
$lang = $this->app->getClientLang();
if(empty($lang2Set)) $lang2Set = $this->app->getClientLang();
$currentLang = $this->app->getClientLang();
$fieldList = zget($this->lang->stage, 'typeList', '');
if($lang2Set == 'all')
{
$fieldList = array();
$items = $this->custom->getItems("lang=all&module=stage&section=typeList&vision={$this->config->vision}");
foreach($items as $key => $item) $fieldList[$key] = $item->value;
}
/* Check whether the current language has been customized. */
$dbFields = $this->custom->getItems("lang=$lang2Set&module=stage&section=typeList&vision={$this->config->vision}");
if(empty($dbFields)) $dbFields = $this->custom->getItems("lang=" . ($lang2Set == $currentLang ? 'all' : $currentLang) . "&module=stage&section=typeList");
if($dbFields)
{
$dbField = reset($dbFields);
if($lang2Set != $dbField->lang)
{
$lang2Set = $dbField->lang;
foreach($fieldList as $key => $value)
{
if(isset($dbFields[$key]) and $value != $dbFields[$key]->value) $fieldList[$key] = $dbFields[$key]->value;
}
}
}
if($_POST)
{
$data = fixer::input('post')->get();
$this->custom->deleteItems("lang={$data->lang}&module=stage&section=typeList");
if($data->lang == 'all') $this->custom->deleteItems("lang=$currentLang&module=stage&section=typeList");
foreach($data->keys as $index => $key)
{
$value = $data->values[$index];
if(!$value or !$key) continue;
$this->custom->setItem("all.stage.typeList.{$key}", $value);
$this->custom->setItem("{$data->lang}.stage.typeList.{$key}", $value);
}
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('stage', 'settype', "lang2Set=$data->lang")));
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('stage', 'settype', "lang2Set=" . ($data->lang == 'all' ? 'all' : ''))));
}
$this->view->title = $this->lang->stage->common . $this->lang->colon . $this->lang->stage->setType;
$this->view->currentLang = $lang;
$this->view->currentLang = $currentLang;
$this->view->lang2Set = !empty($lang2Set) ? $lang2Set : $lang;
$this->view->fieldList = $fieldList;
$this->display();
}
+1 -1
View File
@@ -50,7 +50,7 @@ EOT;
</tr>
</thead>
<tbody>
<?php foreach($lang->stage->typeList as $key => $value):?>
<?php foreach($fieldList as $key => $value):?>
<tr class='text-center'>
<td class='w-70px'>
<?php echo $key;?>
+1 -1
View File
@@ -6,7 +6,7 @@ body {margin-bottom: 25px;}
#caseForm table tbody tr td {overflow: hidden; white-space: nowrap;}
#caseForm .setting {height: 25px;}
#caseForm table tbody .c-name {overflow: hidden; padding-right: 65px;}
#caseForm table tbody .c-name a:first-child {overflow: hidden; display: inline-block; width: 100%;}
#caseForm table tbody .c-name a:first-child {overflow: hidden; display: inline-block; max-width: 100%;}
.dropdown-menu.with-search {padding: 0; min-width: 150px; overflow: hidden; max-height: 302px;}
.dropdown-menu > .menu-search .input-group {width: 100%;}
+6 -1
View File
@@ -2106,7 +2106,12 @@ class testcaseModel extends model
$autoIcon = $case->auto == 'auto' ? " <i class='icon icon-draft-edit'></i>" : '';
if(isset($branches[$case->branch]) and $showBranch) echo "<span class='label label-outline label-badge'>{$branches[$case->branch]}</span> ";
if($modulePairs and $case->module and isset($modulePairs[$case->module])) echo "<span class='label label-gray label-badge'>{$modulePairs[$case->module]}</span> ";
echo $canView ? ($fromCaseID ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'") . html::a(helper::createLink('testcase', 'view', "caseID=$fromCaseID"), "[<i class='icon icon-share' title='{$this->lang->testcase->fromCaselib}'></i>#$fromCaseID]" . $autoIcon, '', "data-app='{$this->app->tab}'") : html::a($caseLink, $case->title . $autoIcon, null, "style='color: $case->color' data-app='{$this->app->tab}'")) : "<span style='color: $case->color'>$case->title</span>";
echo $canView ? html::a($caseLink, $case->title, null, "style='color: $case->color' data-app='{$this->app->tab}'")
: "<span style='color: $case->color'>$case->title</span>";
$fromLink = ($fromCaseID and $canView) ? helper::createLink('testcase', 'view', "caseID=$fromCaseID") : '#';
$title = $fromCaseID ? "[<i class='icon icon-share' title='{$this->lang->testcase->fromCaselib}'></i>#$fromCaseID]$autoIcon" : $autoIcon;
if($case->auto == 'auto') echo html::a($fromLink, $title, '', "data-app='{$this->app->tab}'");
break;
case 'branch':
echo $branches[$case->branch];
+1 -1
View File
@@ -862,7 +862,7 @@ class userModel extends model
$_POST['password1'] = trim($_POST['password1']);
$_POST['password2'] = trim($_POST['password2']);
if(!$canNoPassword and empty($_POST['password1'])) dao::$errors['password1'][] = sprintf($this->lang->error->notempty, $this->lang->user->password) . '<br/>';
if($this->post->password1 != false)
if(!$canNoPassword and $this->post->password1 != false)
{
if(isset($this->config->safe->mode) and ($this->post->passwordStrength < $this->config->safe->mode)) dao::$errors['password1'][] = zget($this->lang->user->placeholder->passwordStrengthCheck, $this->config->safe->mode, $this->lang->user->weakPassword) . '<br/>';
+6 -4
View File
@@ -6,12 +6,14 @@ $('#hostList tr[data-status="wait"]').hover(function(){
if(showFeature)
{
$.apps.close('help');
$.apps.open('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao', 'help');
var encodedHelpPageUrl = encodeURIComponent('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao');
var urlForNewTab = window.location.origin + '#app=help&url=' + encodedHelpPageUrl;
window.open(urlForNewTab)
}
$('#helpTab').click(function()
{
$.apps.close('help');
$.apps.open('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao', 'help');
var encodedHelpPageUrl = encodeURIComponent('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao');
var urlForNewTab = window.location.origin + '#app=help&url=' + encodedHelpPageUrl;
window.open(urlForNewTab)
})
+2 -3
View File
@@ -73,7 +73,6 @@ class zanode extends control
*/
public function list($hostID, $orderBy = 'id_desc')
{
$this->view->title = $this->lang->zanode->common;
$this->view->nodeList = $this->loadModel("zanode")->getListByHost($hostID, $orderBy);
$this->view->orderBy = $orderBy;
@@ -292,14 +291,14 @@ class zanode extends control
$error = $this->zanode->destroy($nodeID);
if($error)
if(!empty($error))
{
return print(js::alert($error));
}
else
{
if(isonlybody()) return print(js::alert($this->lang->zanode->actionSuccess) . js::reload('parent.parent'));
return print(js::alert($this->lang->zanode->actionSuccess) . js::reload('parent'));
return print(js::alert($this->lang->zanode->actionSuccess) . js::locate($this->createLink('zanode', 'browse'), 'parent'));
}
}
+6 -4
View File
@@ -1,11 +1,13 @@
if(showFeature)
{
$.apps.close('help');
$.apps.open('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao', 'help');
var encodedHelpPageUrl = encodeURIComponent('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao');
var urlForNewTab = window.location.origin + '#app=help&url=' + encodedHelpPageUrl;
window.open(urlForNewTab)
}
$('#helpTab').click(function()
{
$.apps.close('help');
$.apps.open('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao', 'help');
var encodedHelpPageUrl = encodeURIComponent('https://www.zentao.net/book/zentaopms/978.html?fullScreen=zentao');
var urlForNewTab = window.location.origin + '#app=help&url=' + encodedHelpPageUrl;
window.open(urlForNewTab)
})
+1 -1
View File
@@ -47,7 +47,7 @@ function checkServiceStatus(){
}
else if(key == "node")
{
if(nodeStatus != resultData.data[key])
if(nodeStatus != resultData.data[key] && resultData.data[key])
{
window.location.reload();
}
+2 -3
View File
@@ -212,11 +212,10 @@ class zanodemodel extends model
public function destroy($id)
{
$node = $this->getNodeByID($id);
$req = array( 'name' => $node->name );
if($node)
{
$req = array( 'name' => $node->name );
$agnetUrl = 'http://' . $node->ip . ':' . $node->hzap;
$result = commonModel::http($agnetUrl . '/api/v1/kvm/remove', json_encode($req), array(), array("Authorization:$node->tokenSN"));
+1 -1
View File
@@ -36,7 +36,7 @@
<tbody>
<?php foreach ($nodeList as $node) : ?>
<tr>
<td title='<?php echo $node->name ?>'><?php echo html::a($this->inlink('view', "id=$node->id"), $node->name, '', ""); ?></td>
<td title='<?php echo $node->name ?>'><?php echo html::a($this->inlink('view', "id=$node->id"), $node->name, '_blank', ""); ?></td>
<td><?php echo zget($config->zanode->os->cpuCores, $node->cpuCores); ?></td>
<td><?php echo $node->memory . $this->lang->zahost->unitList['GB']; ?></td>
<td><?php echo $node->diskSize . $this->lang->zahost->unitList['GB']; ?></td>
+143 -9
View File
@@ -11,7 +11,26 @@ class executionTest
{
global $tester;
$this->executionModel = $tester->loadModel('execution');
$this->treeModel = $tester->loadModel('tree');
$this->treeModel = $tester->loadModel('tree');
$this->productModel = $tester->loadModel('product');
}
/**
* Compute cfd of a execution.
*
* @param int|string|array $executionID
* @access public
* @return array
*/
public function computeCFDTest($executionID = 0)
{
$this->executionModel->computeCFD($executionID);
$today = helper::today();
return $this->executionModel->dao->select('*')->from(TABLE_CFD)
->where('date')->eq($today)
->beginIF(!empty($executionID))->andWhere('execution')->in($executionID)->fi()
->fetchAll('id');
}
/**
@@ -730,12 +749,13 @@ class executionTest
* function getTree test execution
*
* @param string $executionID
* @param string $count
* @access public
* @return array
*/
public function getTreeTest($executionID, $count)
public function getTreeTest($executionID)
{
global $app;
$app->moduleName = 'task';
$object = $this->executionModel->getTree($executionID);
if(dao::isError())
@@ -743,13 +763,9 @@ class executionTest
$error = dao::getError();
return $error;
}
elseif($count == "1")
{
return count($object);
}
else
{
return $object;
return $object[0] ? count($object[0]->children) : 0;
}
}
@@ -1793,6 +1809,31 @@ class executionTest
}
}
/**
* Function getBurnData test by execution.
*
* @param int $executionID
* @access public
* @return int
*/
public function getBurnDataTest($executionID = 0)
{
$execution = $this->executionModel->getByID($executionID);
if(empty($execution)) return '0';
$object = $this->executionModel->getBurnData(array($executionID => $execution));
if(dao::isError())
{
$error = dao::getError();
return $error;
}
else
{
return $object;
}
}
/**
* function processBurnData test by execution
*
@@ -2692,7 +2733,7 @@ class executionTest
* @param int $executionID
* @param int $queryID
* @access public
* @return void
* @return int
*/
public function buildTaskSearchFormTest($executionID, $queryID)
{
@@ -2700,4 +2741,97 @@ class executionTest
return $_SESSION['tasksearchParams']['queryID'];
}
/**
* Test build bug search form.
*
* @param int $productID
* @param int $queryID
* @access public
* @return int
*/
public function buildBugSearchFormTest($productID, $queryID)
{
$product = $this->productModel->getByID($productID);
if(empty($product)) return '0';
$this->executionModel->loadModel('bug');
$this->executionModel->buildBugSearchForm(array($productID => $product), $queryID, 'searchBug');
return $_SESSION['executionBugsearchParams']['queryID'];
}
/**
* Test build story search form.
*
* @param int $executionID
* @param int $queryID
* @access public
* @return int
*/
public function buildStorySearchFormTest($executionID, $queryID)
{
$execution = $this->executionModel->getByID($executionID);
if(empty($execution)) return '0';
$this->executionModel->loadModel('story');
$products = $this->productModel->getProducts($executionID);
$branchGroups = $this->executionModel->loadModel('branch')->getByProducts(array_keys($products));
$this->executionModel->buildStorySearchForm($products, $branchGroups, array(), $queryID, 'searchStory', 'executionStory', $execution);
return $_SESSION['executionStorysearchParams']['queryID'];
}
/**
* Test get CFD data.
*
* @param int $executionID
* @access public
* @return array
*/
public function getCFDDataTest($executionID = 0)
{
$begin = strtotime('2022-01-12');
$end = strtotime('2022-02-12');
$dateList = array();
for($date = $begin; $date <= $end; $date += 24 * 3600) $dateList[] = date('Y-m-d', $date);
return $this->executionModel->getCFDData($executionID, $dateList);
}
/**
* Test build CFD data.
*
* @param int $executionID
* @access public
* @return array
*/
public function buildCFDDataTest($executionID = 0)
{
$begin = strtotime('2022-01-12');
$end = strtotime('2022-02-12');
$dateList = array();
for($date = $begin; $date <= $end; $date += 24 * 3600) $dateList[] = date('Y-m-d', $date);
return $this->executionModel->buildCFDData($executionID, $dateList, 'task');
}
/**
* Test check CFD data.
*
* @param int $executionID
* @param string $date
* @access public
* @return array
*/
public function checkCFDDataTest($executionID, $date)
{
$this->executionModel->checkCFDData($executionID, $date);
return $this->executionModel->dao->select("date, `count` AS value, `name`")->from(TABLE_CFD)
->where('execution')->eq((int)$executionID)
->andWhere('date')->eq($date)
->orderBy('date DESC, id asc')->fetchGroup('name', 'date');
}
}
@@ -0,0 +1,78 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3');
$execution->type->range('project{2},sprint,stage,kanban');
$execution->status->range('doing');
$execution->parent->range('0,0,1,1,2');
$execution->project->range('0,0,1,1,2');
$execution->grade->range('2{2},1{3}');
$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(',');
$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
$product = zdTable('product');
$product->id->range('1-3');
$product->name->range('1-3')->prefix('产品');
$product->code->range('1-3')->prefix('product');
$product->type->range('normal');
$product->status->range('normal');
$product->gen(3);
$task = zdTable('task');
$task->id->range('1-10');
$task->name->range('1-10')->prefix('任务');
$task->execution->range('3-5');
$task->type->range('test,devel');
$task->status->range('wait,doing');
$task->estimate->range('1-10');
$task->left->range('1-10');
$task->consumed->range('1-10');
$task->gen(10);
$bug = zdTable('bug');
$bug->id->range('1-4');
$bug->title->range('1-4')->prefix('Bug');
$bug->project->range('1,2,1');
$bug->execution->range('3,4,5');
$bug->task->range('1-10');
$bug->status->range('wait,doing');
$bug->gen(4);
$query = zdTable('userquery');
$query->id->range('1');
$query->account->range('admin');
$query->module->range('bug');
$query->title->range('搜索条件1');
$query->form->range('`a:59:{s:9:"fieldname";s:0:"";s:11:"fieldstatus";s:0:"";s:9:"fielddesc";s:0:"";s:15:"fieldassignedTo";s:0:"";s:8:"fieldpri";s:1:"0";s:14:"fieldexecution";s:0:"";s:11:"fieldmodule";s:4:"ZERO";s:13:"fieldestimate";s:0:"";s:9:"fieldleft";s:0:"";s:13:"fieldconsumed";s:0:"";s:9:"fieldtype";s:0:"";s:12:"fieldfromBug";s:0:"";s:17:"fieldclosedReason";s:0:"";s:13:"fieldopenedBy";s:0:"";s:15:"fieldfinishedBy";s:0:"";s:13:"fieldclosedBy";s:0:"";s:15:"fieldcanceledBy";s:0:"";s:17:"fieldlastEditedBy";s:0:"";s:11:"fieldmailto";s:0:"";s:15:"fieldopenedDate";s:0:"";s:13:"fielddeadline";s:0:"";s:15:"fieldestStarted";s:0:"";s:16:"fieldrealStarted";s:0:"";s:17:"fieldassignedDate";s:0:"";s:17:"fieldfinishedDate";s:0:"";s:15:"fieldclosedDate";s:0:"";s:17:"fieldcanceledDate";s:0:"";s:19:"fieldlastEditedDate";s:0:"";s:18:"fieldactivatedDate";s:0:"";s:7:"fieldid";s:0:"";s:6:"andOr1";s:3:"AND";s:6:"field1";s:4:"name";s:9:"operator1";s:7:"include";s:6:"value1";s:3:"Bug";s:6:"andOr2";s:3:"and";s:6:"field2";s:2:"id";s:9:"operator2";s:1:"=";s:6:"value2";s:0:"";s:6:"andOr3";s:3:"and";s:6:"field3";s:6:"status";s:9:"operator3";s:1:"=";s:6:"value3";s:0:"";s:10:"groupAndOr";s:3:"and";s:6:"andOr4";s:3:"AND";s:6:"field4";s:4:"desc";s:9:"operator4";s:7:"include";s:6:"value4";s:0:"";s:6:"andOr5";s:3:"and";s:6:"field5";s:10:"assignedTo";s:9:"operator5";s:1:"=";s:6:"value5";s:0:"";s:6:"andOr6";s:3:"and";s:6:"field6";s:3:"pri";s:9:"operator6";s:1:"=";s:6:"value6";s:1:"0";s:6:"module";s:4:"task";s:9:"actionURL";s:41:"/execution-task-3-bySearch-myQueryID.html";s:10:"groupItems";s:1:"3";s:8:"formType";s:4:"lite";}`');
$query->sql->range("`(( 1 AND `name` LIKE '%Bug%' ) AND ( 1 )) AND deleted = '0'`");
$query->gen(1);
su('admin');
/**
title=测试executionModel->buildBugSearchForm();
cid=1
pid=1
正确的产品,正确的queryID >> 1
错误的产品,正确的queryID >> 0
正确的产品,错误的queryID >> 0
错误的产品,错误的queryID >> 0
*/
$productIDList = array('1', '0');
$queryIDList = array('0', '1');
$execution = new executionTest();
r($execution->buildBugSearchFormTest($productIDList[0], $queryIDList[1])) && p() && e('1'); // 正确的产品,正确的queryID
r($execution->buildBugSearchFormTest($productIDList[1], $queryIDList[1])) && p() && e('0'); // 错误的产品,正确的queryID
r($execution->buildBugSearchFormTest($productIDList[0], $queryIDList[0])) && p() && e('0'); // 正确的产品,错误的queryID
r($execution->buildBugSearchFormTest($productIDList[1], $queryIDList[0])) && p() && e('0'); // 错误的产品,错误的queryID
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
zdTable('user')->gen(5);
su('admin');
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('项目集1,项目1,看板1,看板2,看板3');
$execution->type->range('program,project,,kanban{3}');
$execution->parent->range('0,1,2{3}');
$execution->status->range('wait{3},closed,doing');
$execution->openedBy->range('admin,user1');
$execution->begin->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->end->range('20220212 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
$kanbanCell = zdTable('kanbancell');
$kanbanCell->id->range('1-9');
$kanbanCell->kanban->range('3{3},4{3},5{3}');
$kanbanCell->lane->range('1-9');
$kanbanCell->column->range('1-9');
$kanbanCell->type->range('task,bug,story');
$kanbanCell->cards->range('`,1,2,3,`{3},`,4,5,`{3},6{3}');
$kanbanCell->gen(9);
$kanbanColumn = zdTable('kanbancolumn');
$kanbanColumn->id->range('1-9');
$kanbanColumn->name->range('1-9')->prefix('看板列');
$kanbanColumn->type->range('1-9')->prefix('column');
$kanbanColumn->gen(9);
$CFD = zdTable('cfd');
$CFD->id->range('1-5');
$CFD->execution->range('3');
$CFD->count->range('1');
$CFD->type->range('task,bug,story');
$CFD->date->range('20220122 000000:0')->type('timestamp')->format('YY/MM/DD');
$CFD->name->range('1-5')->prefix('看板列');
$CFD->gen(5);
/**
title=测试executionModel->buildCFDData();
cid=1
pid=1
不存在执行的累计流图信息 >> 0
存在的执行的累计流图信息 >> 2
*/
$executionTester = new executionTest();
r(count($executionTester->buildCFDDataTest())) && p() && e('0'); // 不存在执行的累计流图信息
$CFDData = $executionTester->buildCFDDataTest(3);
r(count($CFDData['line'])) && p() && e('2'); // 存在的执行的累计流图信息
@@ -0,0 +1,96 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3');
$execution->type->range('project{2},sprint,stage,kanban');
$execution->status->range('doing');
$execution->parent->range('0,0,1,1,2');
$execution->project->range('0,0,1,1,2');
$execution->grade->range('2{2},1{3}');
$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(',');
$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
$task = zdTable('task');
$task->id->range('1-10');
$task->execution->range('3');
$task->name->range('1-10')->prefix('任务');
$task->type->range('design,devel,test,study,discuss,ui,affair,misc');
$task->status->range('wait,doing,done,closed');
$task->gen(10);
$product = zdTable('product');
$product->id->range('1-2');
$product->name->range('正常产品1,多分支产品1');
$product->type->range('normal,branch');
$product->status->range('normal');
$product->createdBy->range('admin,user1');
$product->gen(2);
$branch = zdTable('branch');
$branch->id->range('1-2');
$branch->product->range('2');
$branch->name->range('分支1,分支2');
$branch->status->range('active');
$branch->gen(2);
$story = zdTable('story');
$story->id->range('1-10');
$story->name->range('1-10')->prefix('需求');
$story->type->range('story');
$story->product->range('1');
$story->status->range('active');
$story->staged->range('projected');
$story->version->range('1');
$story->gen(10);
$projectStory = zdTable('projectstory');
$projectStory->project->range('3');
$projectStory->product->range('1,2');
$projectStory->story->range('1-10');
$projectStory->version->range('1');
$projectStory->gen(10);
$projectproduct = zdTable('projectproduct');
$projectproduct->project->range('1-5');
$projectproduct->product->range('1-2');
$projectproduct->plan->range('0');
$projectproduct->gen(5);
$query = zdTable('userquery');
$query->id->range('1');
$query->account->range('admin');
$query->module->range('story');
$query->title->range('搜索条件1');
$query->form->range('`a:59:{s:9:"fieldname";s:0:"";s:11:"fieldstatus";s:0:"";s:9:"fielddesc";s:0:"";s:15:"fieldassignedTo";s:0:"";s:8:"fieldpri";s:1:"0";s:14:"fieldexecution";s:0:"";s:11:"fieldmodule";s:4:"ZERO";s:13:"fieldestimate";s:0:"";s:9:"fieldleft";s:0:"";s:13:"fieldconsumed";s:0:"";s:9:"fieldtype";s:0:"";s:12:"fieldfromBug";s:0:"";s:17:"fieldclosedReason";s:0:"";s:13:"fieldopenedBy";s:0:"";s:15:"fieldfinishedBy";s:0:"";s:13:"fieldclosedBy";s:0:"";s:15:"fieldcanceledBy";s:0:"";s:17:"fieldlastEditedBy";s:0:"";s:11:"fieldmailto";s:0:"";s:15:"fieldopenedDate";s:0:"";s:13:"fielddeadline";s:0:"";s:15:"fieldestStarted";s:0:"";s:16:"fieldrealStarted";s:0:"";s:17:"fieldassignedDate";s:0:"";s:17:"fieldfinishedDate";s:0:"";s:15:"fieldclosedDate";s:0:"";s:17:"fieldcanceledDate";s:0:"";s:19:"fieldlastEditedDate";s:0:"";s:18:"fieldactivatedDate";s:0:"";s:7:"fieldid";s:0:"";s:6:"andOr1";s:3:"AND";s:6:"field1";s:4:"name";s:9:"operator1";s:7:"include";s:6:"value1";s:2:"需求";s:6:"andOr2";s:3:"and";s:6:"field2";s:2:"id";s:9:"operator2";s:1:"=";s:6:"value2";s:0:"";s:6:"andOr3";s:3:"and";s:6:"field3";s:6:"status";s:9:"operator3";s:1:"=";s:6:"value3";s:0:"";s:10:"groupAndOr";s:3:"and";s:6:"andOr4";s:3:"AND";s:6:"field4";s:4:"desc";s:9:"operator4";s:7:"include";s:6:"value4";s:0:"";s:6:"andOr5";s:3:"and";s:6:"field5";s:10:"assignedTo";s:9:"operator5";s:1:"=";s:6:"value5";s:0:"";s:6:"andOr6";s:3:"and";s:6:"field6";s:3:"pri";s:9:"operator6";s:1:"=";s:6:"value6";s:1:"0";s:6:"module";s:4:"task";s:9:"actionURL";s:41:"/execution-task-3-bySearch-myQueryID.html";s:10:"groupItems";s:1:"3";s:8:"formType";s:4:"lite";}`');
$query->sql->range("`(( 1 AND `name` LIKE '%需求%' ) AND ( 1 )) AND deleted = '0'`");
$query->gen(1);
su('admin');
/**
title=测试executionModel->buildStorySearchForm();
cid=1
pid=1
正确的执行,正确的queryID >> 1
错误的执行,正确的queryID >> 0
正确的执行,错误的queryID >> 0
错误的执行,错误的queryID >> 0
*/
$executionIDList = array('3', '0');
$queryIDList = array('0', '1');
$execution = new executionTest();
r($execution->buildStorySearchFormTest($executionIDList[0], $queryIDList[1])) && p() && e('1'); // 正确的执行,正确的queryID
r($execution->buildStorySearchFormTest($executionIDList[1], $queryIDList[1])) && p() && e('0'); // 错误的执行,正确的queryID
r($execution->buildStorySearchFormTest($executionIDList[0], $queryIDList[0])) && p() && e('0'); // 正确的执行,错误的queryID
r($execution->buildStorySearchFormTest($executionIDList[1], $queryIDList[0])) && p() && e('0'); // 错误的执行,错误的queryID
+1 -2
View File
@@ -52,11 +52,10 @@ pid=1
*/
$executionIDList = array('3', '0');
$queryIDList = array('0', '1');
$queryIDList = array('0', '1');
$execution = new executionTest();
r($execution->buildTaskSearchFormTest($executionIDList[0], $queryIDList[1])) && p() && e('1'); // 正确的执行,正确的queryID
r($execution->buildTaskSearchFormTest($executionIDList[1], $queryIDList[1])) && p() && e('1'); // 错误的执行,正确的queryID
r($execution->buildTaskSearchFormTest($executionIDList[0], $queryIDList[0])) && p() && e('0'); // 正确的执行,错误的queryID
r($execution->buildTaskSearchFormTest($executionIDList[1], $queryIDList[0])) && p() && e('0'); // 错误的执行,错误的queryID
+58
View File
@@ -0,0 +1,58 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
zdTable('user')->gen(5);
su('admin');
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('项目集1,项目1,看板1,看板2,看板3');
$execution->type->range('program,project,,kanban{3}');
$execution->parent->range('0,1,2{3}');
$execution->status->range('wait{3},closed,doing');
$execution->openedBy->range('admin,user1');
$execution->begin->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->end->range('20220212 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
$kanbanCell = zdTable('kanbancell');
$kanbanCell->id->range('1-9');
$kanbanCell->kanban->range('3{3},4{3},5{3}');
$kanbanCell->lane->range('1-9');
$kanbanCell->column->range('1-9');
$kanbanCell->type->range('task,bug,story');
$kanbanCell->cards->range('`,1,2,3,`{3},`,4,5,`{3},6{3}');
$kanbanCell->gen(9);
$kanbanColumn = zdTable('kanbancolumn');
$kanbanColumn->id->range('1-9');
$kanbanColumn->name->range('1-9')->prefix('看板列');
$kanbanColumn->type->range('1-9')->prefix('column');
$kanbanColumn->gen(9);
$CFD = zdTable('cfd');
$CFD->id->range('1-5');
$CFD->execution->range('3');
$CFD->count->range('1');
$CFD->type->range('task,bug,story');
$CFD->date->range('20220122 000000:0')->type('timestamp')->format('YY/MM/DD');
$CFD->name->range('1-5')->prefix('看板列');
$CFD->gen(5);
/**
title=测试executionModel->checkCFDData();
cid=1
pid=1
已有日期的情况 >> 5
未来日期的情况 >> 0
*/
$executionTester = new executionTest();
$dateList = array('2022-01-22', '2099-01-01');
r(count($executionTester->checkCFDDataTest(3, $dateList[0]))) && p() && e('5'); // 已有日期的情况
r(count($executionTester->checkCFDDataTest(3, $dateList[1]))) && p() && e('0'); // 未来日期的情况
+54
View File
@@ -0,0 +1,54 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
zdTable('user')->gen(5);
su('admin');
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('项目集1,项目1,看板1,看板2,看板3');
$execution->type->range('program,project,,kanban{3}');
$execution->parent->range('0,1,2{3}');
$execution->status->range('wait{3},closed,doing');
$execution->openedBy->range('admin,user1');
$execution->begin->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->end->range('20220212 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
$kanbanCell = zdTable('kanbancell');
$kanbanCell->id->range('1-9');
$kanbanCell->kanban->range('3{3},4{3},5{3}');
$kanbanCell->lane->range('1-9');
$kanbanCell->column->range('1-9');
$kanbanCell->type->range('task,bug,story');
$kanbanCell->cards->range('`,1,2,3,`{3},`,4,5,`{3},6{3}');
$kanbanCell->gen(9);
$kanbanColumn = zdTable('kanbancolumn');
$kanbanColumn->id->range('1-9');
$kanbanColumn->name->range('1-9')->prefix('看板列');
$kanbanColumn->type->range('1-9')->prefix('column');
$kanbanColumn->gen(9);
$CFD = zdTable('cfd');
$CFD->id->range('1');
$CFD->gen(0);
/**
title=测试executionModel->computeCFD();
cid=1
pid=1
获取所有看板执行的累计卡片个数 >> 6
获取看板1的累计流图信息 >> 3,task
*/
$executionTester = new executionTest();
$allExecutionCFDList = $executionTester->computeCFDTest();
$singleExecutionCFDList = $executionTester->computeCFDTest(3);
r(count($allExecutionCFDList)) && p() && e('6'); // 获取所有看板执行的累计卡片个数
r(current($singleExecutionCFDList)) && p('execution,type') && e('3,task'); // 获取看板1的累计流图信息
+4 -3
View File
@@ -44,6 +44,7 @@ $product->parent->range('0,1{9}');
$product->type->range('task');
$product->gen(10);
zdTable('team')->gen(0);
su('admin');
/**
@@ -53,7 +54,7 @@ cid=1
pid=1
敏捷执行查询 >> 产品1
瀑布执行查询 >> 产品1
瀑布执行查询 >> 产品2
看板执行查询 >> 产品1
错误执行查询 >> 0
@@ -63,6 +64,6 @@ $executionIDList = array('0', '3', '4', '5');
$execution = new executionTest();
r($execution->fillTasksInTreeTest($executionIDList[1])) && p('name') && e('产品1'); // 敏捷执行查询
r($execution->fillTasksInTreeTest($executionIDList[2])) && p('name') && e('产品1'); // 瀑布执行查询
r($execution->fillTasksInTreeTest($executionIDList[2])) && p('name') && e('产品2'); // 瀑布执行查询
r($execution->fillTasksInTreeTest($executionIDList[3])) && p('name') && e('产品1'); // 看板执行查询
r($execution->fillTasksInTreeTest($executionIDList[0])) && p() && e('0'); // 错误执行查询
r($execution->fillTasksInTreeTest($executionIDList[0])) && p() && e('0'); // 错误执行查询
+55
View File
@@ -0,0 +1,55 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
zdTable('user')->gen(5);
su('admin');
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('项目集1,项目1,迭代1,阶段1,看板1');
$execution->type->range('program,project,sprint,stage,kanban');
$execution->code->range('1-5')->prefix('code');
$execution->parent->range('0,1,2{3}');
$execution->status->range('wait{3},suspended,closed,doing');
$execution->openedBy->range('admin,user1');
$execution->begin->range('20220110 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->end->range('20220220 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
$burn = zdTable('burn');
$burn->execution->range('3{5},4{5},5{5}');
$burn->date->range('20220111 000000:1D')->type('timestamp')->format('YY/MM/DD');
$burn->estimate->range('94.3,56.3,55.3,37.8,33.8');
$burn->left->range('95.3,68.5,73.9,40.2,36,3');
$burn->consumed->range('20.1,33.4,41,56.55,59.55');
$burn->storyPoint->range('0,16.5,16,11.5,9');
$burn->gen(15);
$task = zdTable('task');
$task->id->range('1-10');
$task->execution->range('3');
$task->status->range('wait,doing');
$task->estimate->range('1-10');
$task->left->range('1-10');
$task->consumed->range('1-10');
$task->gen(10);
/**
title=测试executionModel->getBurnDataTest();
cid=1
pid=1
敏捷执行查询统计 >> 36
瀑布执行查询统计 >> 40.2
看板执行查询统计 >> 3
*/
$executionIDList = array(3, 4, 5);
$execution = new executionTest();
r(current($execution->getBurnDataTest($executionIDList[0]))) && p('2022-01-22:value') && e('36'); // 敏捷执行查询统计
r(current($execution->getBurnDataTest($executionIDList[1]))) && p('2022-01-22:value') && e('40.2'); // 瀑布执行查询统计
r(current($execution->getBurnDataTest($executionIDList[2]))) && p('2022-01-22:value') && e('3'); // 看板执行查询统计
+57
View File
@@ -0,0 +1,57 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
zdTable('user')->gen(5);
su('admin');
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('项目集1,项目1,看板1,看板2,看板3');
$execution->type->range('program,project,,kanban{3}');
$execution->parent->range('0,1,2{3}');
$execution->status->range('wait{3},closed,doing');
$execution->openedBy->range('admin,user1');
$execution->begin->range('20220112 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->end->range('20220212 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
$kanbanCell = zdTable('kanbancell');
$kanbanCell->id->range('1-9');
$kanbanCell->kanban->range('3{3},4{3},5{3}');
$kanbanCell->lane->range('1-9');
$kanbanCell->column->range('1-9');
$kanbanCell->type->range('task,bug,story');
$kanbanCell->cards->range('`,1,2,3,`{3},`,4,5,`{3},6{3}');
$kanbanCell->gen(9);
$kanbanColumn = zdTable('kanbancolumn');
$kanbanColumn->id->range('1-9');
$kanbanColumn->name->range('1-9')->prefix('看板列');
$kanbanColumn->type->range('1-9')->prefix('column');
$kanbanColumn->gen(9);
$CFD = zdTable('cfd');
$CFD->id->range('1-5');
$CFD->execution->range('3');
$CFD->count->range('1');
$CFD->type->range('task,bug,story');
$CFD->date->range('20220122 000000:0')->type('timestamp')->format('YY/MM/DD');
$CFD->name->range('1-5')->prefix('看板列');
$CFD->gen(5);
/**
title=测试executionModel->getCFDData();
cid=1
pid=1
不存在执行的累计流图信息 >> 0
存在的执行的累计流图信息 >> 看板列3
*/
$executionTester = new executionTest();
r(count($executionTester->getCFDDataTest())) && p() && e('0'); // 不存在执行的累计流图信息
r(current($executionTester->getCFDDataTest(3))) && p('2022-01-22:name') && e('看板列3'); // 存在的执行的累计流图信息
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
su('admin');
$execution = zdTable('project');
$execution->id->range('1-5');
$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3');
$execution->type->range('project{2},sprint,stage,kanban');
$execution->status->range('doing');
$execution->parent->range('0,0,1,1,2');
$execution->project->range('0,0,1,1,2');
$execution->grade->range('2{2},1{3}');
$execution->openedVersion->range('18.0');
$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(',');
$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD');
$execution->gen(5);
$task = zdTable('task');
$task->id->range('1-10');
$task->name->range('1-10')->prefix('任务');
$task->execution->range('3-5');
$task->type->range('test,devel');
$task->status->range('wait,doing');
$task->estimate->range('1-10');
$task->left->range('1-10');
$task->consumed->range('1-10');
$task->gen(10);
$product = zdTable('product');
$product->id->range('1-3');
$product->name->range('1-3')->prefix('产品');
$product->code->range('1-3')->prefix('product');
$product->type->range('normal');
$product->status->range('normal');
$product->gen(3);
$product = zdTable('module');
$product->id->range('1-10');
$product->name->range('1-10')->prefix('模块');
$product->root->range('1-3');
$product->parent->range('0,1{9}');
$product->type->range('task');
$product->gen(10);
/**
title=测试 executionModel::getTree();
cid=1
pid=1
查看返回子任务数 >> 4
*/
$executionTester = new executionTest();
r($executionTester->getTreeTest(3)) && p() && e('4'); // 查看返回子任务数
-1
View File
@@ -25,7 +25,6 @@ $task->left->range('3');
$task->consumed->range('3');
$task->gen(10);
$bug = zdTable('bug');
$bug->id->range('1-3,273');
$bug->title->range('1-4')->prefix('Bug');
+1 -1
View File
@@ -26,6 +26,6 @@ pid=1
*/
$programTester = new programTest();
$programs1 = $programTester->getTreeMenuTest(1);
$programs1 = preg_replace('/\s*/', '', strip_tags($programs1));
$programs1 = preg_replace('/\s*/', '', strip_tags($programs1));
r($programs1) && p() && e('项目集1项目集2'); // 查看返回的字符个数