Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -161,7 +161,7 @@ $lang->admin->menuOrder[30] = 'dev';
|
||||
$lang->admin->menuOrder[35] = 'system';
|
||||
|
||||
$lang->admin->menu->message['subMenu'] = new stdclass();
|
||||
$lang->admin->menu->message['subMenu']->message = new stdclass();
|
||||
$lang->admin->menu->message['subMenu']->message = array();
|
||||
$lang->admin->menu->message['subMenu']->mail = array('link' => "{$lang->mail->common}|mail|index", 'subModule' => 'mail');
|
||||
$lang->admin->menu->message['subMenu']->webhook = array('link' => "Webhook|webhook|browse", 'subModule' => 'webhook');
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ $lang->admin->menuOrder[30] = 'dev';
|
||||
$lang->admin->menuOrder[35] = 'system';
|
||||
|
||||
$lang->admin->menu->message['subMenu'] = new stdclass();
|
||||
$lang->admin->menu->message['subMenu']->message = new stdclass();
|
||||
$lang->admin->menu->message['subMenu']->message = array();
|
||||
$lang->admin->menu->message['subMenu']->mail = array('link' => "{$lang->mail->common}|mail|index", 'subModule' => 'mail');
|
||||
$lang->admin->menu->message['subMenu']->webhook = array('link' => "Webhook|webhook|browse", 'subModule' => 'webhook');
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@ $lang->custom->object['user'] = '用户';
|
||||
$lang->custom->object['block'] = '区块';
|
||||
|
||||
$lang->custom->task = new stdClass();
|
||||
$lang->custom->task->fields['priList'] = '优先级';
|
||||
$lang->custom->task->fields['priList'] = '优先级';
|
||||
$lang->custom->task->fields['typeList'] = '类型';
|
||||
|
||||
$lang->custom->story = new stdClass();
|
||||
$lang->custom->story->fields['priList'] = '优先级';
|
||||
|
||||
@@ -25,7 +25,7 @@ public function setMenu($executionID, $buildID = 0, $extra = '')
|
||||
$modulePageNav .= "<ul class='dropdown-menu'>";
|
||||
foreach($kanbanList as $kanbanID => $kanban)
|
||||
{
|
||||
$modulePageNav .= '<li>' . html::a(helper::createLink('execution', $this->app->rawMethod, "execution=$kanban->id"), $kanban->name) . '</li>';
|
||||
$modulePageNav .= '<li>' . html::a(helper::createLink($this->app->rawModule, $this->app->rawMethod, "execution=$kanban->id"), $kanban->name) . '</li>';
|
||||
}
|
||||
$modulePageNav .= "</ul></div></div>";
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#begin, #end, #hours').parent().addClass('required');
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,6 @@
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#begin, #end, #hours').parent().addClass('required');
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,7 @@
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#trip').closest('tr').hide();
|
||||
$('#begin, #end, #hours, #overtime').parent().addClass('required');
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,7 @@
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#trip').closest('tr').hide();
|
||||
$('#begin, #end, #hours, #overtime').parent().addClass('required');
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,6 @@
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#begin, #end, #hours, #leave').parent().addClass('required');
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,6 @@
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#begin, #end, #hours, #leave').parent().addClass('required');
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,6 @@
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#begin, #end, #hours').parent().addClass('required');
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,6 @@
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#begin, #end, #hours').parent().addClass('required');
|
||||
})
|
||||
</script>
|
||||
@@ -36,9 +36,6 @@
|
||||
<tr>
|
||||
<td><?php echo html::a($executionLink, $execution->id);?></td>
|
||||
<td>
|
||||
<?php if(isset($config->maxVersion)):?>
|
||||
<span class='project-type-label label label-info label-outline'><?php echo zget($lang->user->executionTypeList, $execution->type);?></span>
|
||||
<?php endif;?>
|
||||
<?php echo html::a($executionLink, $execution->name);?>
|
||||
</td>
|
||||
<?php if(isset($execution->delay)):?>
|
||||
|
||||
@@ -89,6 +89,7 @@ $lang->doc->diffAction = 'Diff Document';
|
||||
$lang->doc->sort = 'Rank Document';
|
||||
$lang->doc->manageType = 'Manage Category';
|
||||
$lang->doc->editType = 'Edit';
|
||||
$lang->doc->editChildType = 'Edit';
|
||||
$lang->doc->deleteType = 'Delete';
|
||||
$lang->doc->addType = 'Add';
|
||||
$lang->doc->childType = 'Directory';
|
||||
|
||||
@@ -89,6 +89,7 @@ $lang->doc->diffAction = '对比文档';
|
||||
$lang->doc->sort = '文档排序';
|
||||
$lang->doc->manageType = '维护目录';
|
||||
$lang->doc->editType = '编辑目录';
|
||||
$lang->doc->editChildType = '编辑子目录';
|
||||
$lang->doc->deleteType = '删除目录';
|
||||
$lang->doc->addType = '增加目录';
|
||||
$lang->doc->childType = '子目录';
|
||||
|
||||
@@ -2475,7 +2475,7 @@ EOT;
|
||||
{
|
||||
$li .= "<div class='tree-actions'>";
|
||||
if(common::hasPriv('tree', 'edit')) $li .= html::a(helper::createLink('tree', 'edit', "module=$module->id&type=doc"), "<i class='icon icon-edit'></i>", '', "data-toggle='modal' title={$this->lang->doc->editType}");
|
||||
if(common::hasPriv('tree', 'browse')) $li .= html::a(helper::createLink('tree', 'browse', "rootID=$libID&type=doc&module=$module->id", '', 1), "<i class='icon icon-split'></i>", '', "class='iframe' title={$this->lang->doc->editType}");
|
||||
if(common::hasPriv('tree', 'browse')) $li .= html::a(helper::createLink('tree', 'browse', "rootID=$libID&type=doc&module=$module->id", '', 1), "<i class='icon icon-split'></i>", '', "class='iframe' title={$this->lang->doc->editChildType}");
|
||||
$li .= '</div>';
|
||||
}
|
||||
$li .= '</div>';
|
||||
|
||||
@@ -41,21 +41,23 @@
|
||||
<?php $vars = "userID={$user->id}&storyType=$storyType&type=$type&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}"; ?>
|
||||
<thead>
|
||||
<tr class='colhead'>
|
||||
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='w-pri' title='<?php echo $lang->pri;?>'><?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th class='c-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class='c-pri' title='<?php echo $lang->pri;?>'><?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<?php if($this->config->vision == 'lite'):?>
|
||||
<th class='w-200px'><?php common::printOrderLink('product', $orderBy, $vars, $lang->story->project);?></th>
|
||||
<th class='c-product'><?php common::printOrderLink('product', $orderBy, $vars, $lang->story->project);?></th>
|
||||
<?php else:?>
|
||||
<th class='w-200px'><?php common::printOrderLink('product', $orderBy, $vars, $lang->story->product);?></th>
|
||||
<th class='c-product'><?php common::printOrderLink('product', $orderBy, $vars, $lang->story->product);?></th>
|
||||
<?php endif;?>
|
||||
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->story->title);?></th>
|
||||
<?php if($storyType != 'requirement' and $this->config->vision != 'lite'):?>
|
||||
<th class='w-150px'><?php common::printOrderLink('plan', $orderBy, $vars, $lang->story->plan);?></th>
|
||||
<th class='c-plan'><?php common::printOrderLink('plan', $orderBy, $vars, $lang->story->plan);?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-openedBy'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
<th class='c-estimate text-right'><?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimateAB);?></th>
|
||||
<th class='c-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
<?php if($this->config->vision != 'lite'):?>
|
||||
<th class='c-stage'> <?php common::printOrderLink('stage', $orderBy, $vars, $lang->story->stageAB);?></th>
|
||||
<?php endif;?>
|
||||
<th class='w-90px'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
<th class='w-80px text-right'><?php common::printOrderLink('estimate', $orderBy, $vars, $lang->story->estimateAB);?></th>
|
||||
<th class='w-status'><?php common::printOrderLink('status', $orderBy, $vars, $lang->statusAB);?></th>
|
||||
<th class='w-100px'> <?php common::printOrderLink('stage', $orderBy, $vars, $lang->story->stageAB);?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -72,7 +74,9 @@
|
||||
<td><?php echo zget($users, $story->openedBy);?></td>
|
||||
<td class='estimate text-right' title="<?php echo $story->estimate . ' ' . $lang->hourCommon;?>"><?php echo $story->estimate . $config->hourUnit;?></td>
|
||||
<td class='story-<?php echo $story->status;?>'><?php echo $this->processStatus('story', $story);?></td>
|
||||
<?php if($this->config->vision != 'lite'):?>
|
||||
<td><?php echo $lang->story->stageList[$story->stage];?></td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
|
||||
@@ -1012,7 +1012,7 @@ class executionTest
|
||||
}
|
||||
}
|
||||
|
||||
public function fixFirstTest($executionID, $count, $param = array())
|
||||
public function fixFirstTest($executionID, $param = array())
|
||||
{
|
||||
global $tester;
|
||||
$date = date('Y-m-d');
|
||||
@@ -1028,10 +1028,6 @@ class executionTest
|
||||
$error = dao::getError();
|
||||
return $error;
|
||||
}
|
||||
elseif($count == "1")
|
||||
{
|
||||
return count($object);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(empty($object))
|
||||
@@ -1062,4 +1058,231 @@ class executionTest
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function processBurnDataTest($executionID, $itemCounts, $begin, $end, $count)
|
||||
{
|
||||
global $tester;
|
||||
$sets = $tester->dao->select('execution, `date` as name, `left` as value')->from(TABLE_BURN)->where('execution')->eq($executionID)->fetchAll('name');
|
||||
$object = $this->objectModel->processBurnData($sets, $itemCounts, $begin, $end);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error;
|
||||
}
|
||||
elseif($count == "1")
|
||||
{
|
||||
return count($object);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function summaryTest($executionID)
|
||||
{
|
||||
global $tester;
|
||||
$execution = $tester->dbh->query("select * from zt_project where id = $executionID")->fetch();
|
||||
$executions = array($executionID => $execution->name);
|
||||
$page = 'NULL';
|
||||
$tasks = $this->objectModel->getTasks('0', $executionID, $executions,'all', '0', '0', 'status,id_desc', $page);
|
||||
$object = $this->objectModel->summary($tasks);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function isClickableTest($execution, $action)
|
||||
{
|
||||
$object = $this->objectModel->isClickable($execution, $action);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if($object == true)
|
||||
{
|
||||
return "检查通过";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "检查不通过";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getDateListTest($begin, $end, $type, $count, $interval = 0)
|
||||
{
|
||||
$object = $this->objectModel->getDateList($begin, $end, $type, $interval);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
elseif($count == "1")
|
||||
{
|
||||
return count($object[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(empty($object[0]))
|
||||
{
|
||||
return '无数据';
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getTotalEstimateTest($executionID)
|
||||
{
|
||||
$object = $this->objectModel->getTotalEstimate($executionID);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function fixOrderTest()
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel->fixOrder();
|
||||
$object = $tester->dao->select('id,`order`')->from(TABLE_EXECUTION)->fetchAll('id');
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function getKanbanTasksTest($executionID, $count)
|
||||
{
|
||||
$object = $this->objectModel->getKanbanTasks($executionID);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error;
|
||||
}
|
||||
elseif($count == 1)
|
||||
{
|
||||
return count($object);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function getKanbanSettingTest($count)
|
||||
{
|
||||
$object = $this->objectModel->getKanbanSetting();
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error;
|
||||
}
|
||||
elseif($count == 1)
|
||||
{
|
||||
return count($object->colorList);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function getKanbanColumnsTest($count)
|
||||
{
|
||||
$kanbanSetting = $this->objectModel->getKanbanSetting();
|
||||
$object = $this->objectModel->getKanbanColumns($kanbanSetting);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error;
|
||||
}
|
||||
elseif($count == 1)
|
||||
{
|
||||
return count($object);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function getKanbanStatusMapTest($count)
|
||||
{
|
||||
$kanbanSetting = $this->objectModel->getKanbanSetting();
|
||||
$object = $this->objectModel->getKanbanStatusMap($kanbanSetting);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error;
|
||||
}
|
||||
elseif($count == 1)
|
||||
{
|
||||
return count($object);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function getKanbanStatusListTest($count)
|
||||
{
|
||||
$kanbanSetting = $this->objectModel->getKanbanSetting();
|
||||
$object = $this->objectModel->getKanbanStatusList($kanbanSetting);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error;
|
||||
}
|
||||
elseif($count == 1)
|
||||
{
|
||||
return count($object);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
public function getKanbanColorListTest($count)
|
||||
{
|
||||
$kanbanSetting = $this->objectModel->getKanbanSetting();
|
||||
$object = $this->objectModel->getKanbanColorList($kanbanSetting);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error;
|
||||
}
|
||||
elseif($count == 1)
|
||||
{
|
||||
return count($object);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,14 @@ class taskTest
|
||||
$this->objectModel = $tester->loadModel('task');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create a task.
|
||||
*
|
||||
* @param array $param
|
||||
* @param int $executionID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function createObject($param = array(), $executionID = '')
|
||||
{
|
||||
$assignedTo = array('');
|
||||
@@ -39,6 +47,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update a task.
|
||||
*
|
||||
* @param int $objectID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array|string
|
||||
*/
|
||||
public function updateObject($objectID, $param = array())
|
||||
{
|
||||
global $tester;
|
||||
@@ -70,6 +86,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch create tasks.
|
||||
*
|
||||
* @param array $param
|
||||
* @param int $executionID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function batchCreateObject($param = array(), $executionID = '')
|
||||
{
|
||||
$modul = array('','','');
|
||||
@@ -110,6 +134,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch update tasks.
|
||||
*
|
||||
* @param array $param
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function batchUpdateObject($param = array(), $taskID = '')
|
||||
{
|
||||
$taskIDList = array($taskID => $taskID);
|
||||
@@ -149,6 +181,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch change module.
|
||||
*
|
||||
* @param array $taskIDList
|
||||
* @param int $moduleID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function batchChangeModuleTest($taskIDList, $moduleID)
|
||||
{
|
||||
$object = $this->objectModel->batchChangeModule($taskIDList, $moduleID);
|
||||
@@ -180,6 +220,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test record estimate and left of task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function recordEstimateTest($taskID, $param = array())
|
||||
{
|
||||
$todate = date("Y-m-d");
|
||||
@@ -203,6 +251,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test activate a task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function activateTest($taskID, $param = array())
|
||||
{
|
||||
$createFields = array('status' => 'doing', 'comment' => '单元测试','assignedTo' => '', 'left' => '3');
|
||||
@@ -221,6 +277,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test assign a task to a user again.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function assignTest($taskID, $param = array())
|
||||
{
|
||||
$createFields = array('assignedTo' => '', 'status' => '', 'comment' => '');
|
||||
@@ -238,6 +302,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test cancel a task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function cancelTest($taskID, $param = array())
|
||||
{
|
||||
$createFields = array('status' => 'cancel', 'comment' => '单元测试');
|
||||
@@ -256,6 +328,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test close a task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function closeTest($taskID, $param = array())
|
||||
{
|
||||
$createFields = array('status' => 'closed', 'comment' => '单元测试');
|
||||
@@ -274,6 +354,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test finish a task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function finishTest($taskID, $param = array())
|
||||
{
|
||||
$todate = date("Y-m-d h:i:s");
|
||||
@@ -295,6 +383,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get task info by Id.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByIdTest($taskID)
|
||||
{
|
||||
$object = $this->objectModel->getById($taskID);
|
||||
@@ -309,6 +404,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get task info by Id List.
|
||||
*
|
||||
* @param int|array|string $taskID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getByListTest($taskID)
|
||||
{
|
||||
$object = $this->objectModel->getByList($taskID);
|
||||
@@ -323,6 +425,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get execution tasks pairs..
|
||||
*
|
||||
* @param int $executionID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getExecutionTaskPairsTest($executionID)
|
||||
{
|
||||
$object = $this->objectModel->getExecutionTaskPairs($executionID);
|
||||
@@ -337,6 +446,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get tasks of a execution.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getExecutionTasksTest($executionID,$count)
|
||||
{
|
||||
$object = $this->objectModel->getExecutionTasks($executionID);
|
||||
@@ -355,6 +471,15 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get tasks list of a execution.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @param array $moduleIdList
|
||||
* @param int $count
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getTasksByModuleTest($executionID, $moduleIdList, $count)
|
||||
{
|
||||
$object = $this->objectModel->getTasksByModule($executionID, $moduleIdList);
|
||||
@@ -373,6 +498,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get tasks of a user.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param string $assignedTo
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserTasksTest($taskID, $assignedTo)
|
||||
{
|
||||
$createFields = array('assignedTo' => $assignedTo, 'status' => 'doing', 'comment' => '');
|
||||
@@ -390,6 +523,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test pause a task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function pauseTest($taskID, $param = array())
|
||||
{
|
||||
$createFields = array('status' => 'pause', 'comment' => '单元测试');
|
||||
@@ -408,6 +549,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get tasks pairs of a user.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param string $assignedTo
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserTaskPairsTest($taskID, $assignedTo)
|
||||
{
|
||||
$createFields = array('assignedTo' => $assignedTo, 'status' => 'doing', 'comment' => '');
|
||||
@@ -425,6 +574,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get suspended tasks of a user.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param string $assignedTo
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUserSuspendedTasksTest($taskID, $assignedTo)
|
||||
{
|
||||
$createFields = array('assignedTo' => $assignedTo, 'status' => 'doing', 'comment' => '');
|
||||
@@ -442,6 +599,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get task pairs of a story.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @param int $count
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getStoryTasksTest($storyID, $count)
|
||||
{
|
||||
$object = $this->objectModel->getStoryTasks($storyID);
|
||||
@@ -460,6 +625,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get counts of some stories' tasks.
|
||||
*
|
||||
* @param array $storyIDList
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function getStoryTaskCountsTest($storyIDList)
|
||||
{
|
||||
$object = $this->objectModel->getStoryTaskCounts($storyIDList);
|
||||
@@ -474,6 +646,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get task estimate.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getTaskEstimateTest($taskID)
|
||||
{
|
||||
$object = $this->objectModel->getTaskEstimate($taskID);
|
||||
@@ -488,6 +667,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get estimate by id.
|
||||
*
|
||||
* @param int $estimateID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getEstimateByIdTest($estimateID)
|
||||
{
|
||||
$object = $this->objectModel->getEstimateById($estimateID);
|
||||
@@ -502,6 +688,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update estimate.
|
||||
*
|
||||
* @param int $estimateID
|
||||
* @param array $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function updateEstimateTest($estimateID, $param = array())
|
||||
{
|
||||
$createFields = array('date' => '0000-00-00', 'consumed' => '1', 'left' => '1', 'work' => '这里是工作内容1');
|
||||
@@ -519,6 +713,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test delete estimate.
|
||||
*
|
||||
* @param int $estimateID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function deleteEstimateTest($estimateID)
|
||||
{
|
||||
$object = $this->objectModel->deleteEstimate($estimateID);
|
||||
@@ -533,6 +734,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create task from gitlab issue.
|
||||
*
|
||||
* @param array $task
|
||||
* @param int $executionID
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function createTaskFromGitlabIssueTest($task, $executionID)
|
||||
{
|
||||
$objectID = $this->objectModel->createTaskFromGitlabIssue($task, $executionID);
|
||||
@@ -548,6 +757,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get project id by execution id.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectIDTest($executionID)
|
||||
{
|
||||
$object = $this->objectModel->getProjectID($executionID);
|
||||
@@ -562,6 +778,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get story comments.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getStoryCommentsTest($storyID)
|
||||
{
|
||||
$object = $this->objectModel->getStoryComments($storyID);
|
||||
@@ -576,6 +799,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test compute parent task working hours.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function computeWorkingHoursTest($taskID)
|
||||
{
|
||||
$result = $this->objectModel->computeWorkingHours($taskID);
|
||||
@@ -592,6 +822,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test compute begin and end for parent task.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function computeBeginAndEndTest($taskID)
|
||||
{
|
||||
$result = $this->objectModel->computeBeginAndEnd($taskID);
|
||||
@@ -615,6 +852,16 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test compute hours for multiple task.
|
||||
*
|
||||
* @param object $oldTask
|
||||
* @param object $task
|
||||
* @param array $team
|
||||
* @param bool $autoStatus
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function computeHours4MultipleTest($oldTask, $task = null, $team = array(), $autoStatus = true)
|
||||
{
|
||||
$result = $this->objectModel->computeHours4Multiple($oldTask, $task, $team, $autoStatus);
|
||||
@@ -645,6 +892,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test process a task, judge it's status.
|
||||
*
|
||||
* @param object $task
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function processTaskTest($task)
|
||||
{
|
||||
$task->deadline = $task->deadline == '-1day' ? date('Y-m-d',strtotime('-1 day')) : date('Y-m-d',strtotime('+1 day'));
|
||||
@@ -660,6 +914,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch process tasks.
|
||||
*
|
||||
* @param int $executionID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function processTasksTest($executionID)
|
||||
{
|
||||
global $tester;
|
||||
@@ -699,6 +960,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test process data for report.
|
||||
*
|
||||
* @param bool $children
|
||||
* @param array $field
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function processData4ReportTest($children, $field)
|
||||
{
|
||||
global $tester;
|
||||
@@ -747,6 +1016,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per execution.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerExecutionTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerExecution();
|
||||
@@ -761,6 +1036,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per module.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerModuleTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerModule();
|
||||
@@ -775,6 +1056,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per assignedto.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerAssignedToTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerAssignedTo();
|
||||
@@ -789,6 +1076,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per type.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerTypeTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerType();
|
||||
@@ -803,6 +1096,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per priority.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerPriTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerPri();
|
||||
@@ -817,6 +1116,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per deadline.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerDeadlineTest($dateID)
|
||||
{
|
||||
$dateList = array(date('Y-m-d',strtotime('+1 day')), date('Y-m-d',strtotime('+2 day')), date('Y-m-d',strtotime('+3 day')), date('Y-m-d',strtotime('+4 day')), date('Y-m-d',strtotime('-1 day')), date('Y-m-d',strtotime('-2 day')), date('Y-m-d',strtotime('-3 day')), date('Y-m-d',strtotime('-4 day')));
|
||||
@@ -832,6 +1137,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per estimate.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerEstimateTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerEstimate();
|
||||
@@ -846,6 +1157,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per left.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerLeftTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerLeft();
|
||||
@@ -860,6 +1177,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per consumed.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerConsumedTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerConsumed();
|
||||
@@ -874,6 +1197,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per finishedBy.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerFinishedByTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerFinishedBy();
|
||||
@@ -888,6 +1217,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per closed reason.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerClosedReasonTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerClosedReason();
|
||||
@@ -902,6 +1237,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of finished tasks per day.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOffinishedTasksPerDayTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOffinishedTasksPerDay();
|
||||
@@ -916,6 +1257,12 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get report data of tasks per status.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDataOfTasksPerStatusTest()
|
||||
{
|
||||
$object = $this->objectModel->getDataOfTasksPerStatus();
|
||||
@@ -930,6 +1277,15 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update parent status by taskID.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param int $parentID
|
||||
* @param bool $createAction
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function updateParentStatusTest($taskID, $parentID = 0, $createAction = true)
|
||||
{
|
||||
$object = $this->objectModel->updateParentStatus($taskID, $parentID, $createAction);
|
||||
@@ -945,6 +1301,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test judge an action is clickable or not.
|
||||
*
|
||||
* @param object $task
|
||||
* @param string $action
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function isClickableTest($task, $action)
|
||||
{
|
||||
$object = $this->objectModel->isClickable($task, $action);
|
||||
@@ -959,6 +1323,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test add task estimate.
|
||||
*
|
||||
* @param object $data
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function addTaskEstimateTest($data)
|
||||
{
|
||||
$data->date = date("Y-m-d");
|
||||
@@ -978,6 +1349,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get toList and ccList.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @param bool $skipMailto
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getToAndCcListTest($taskID, $skipMailto = false)
|
||||
{
|
||||
$task = $this->objectModel->getByID($taskID);
|
||||
@@ -998,6 +1377,14 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get next user.
|
||||
*
|
||||
* @param array $users
|
||||
* @param string $current
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getNextUserTest($users, $current)
|
||||
{
|
||||
$object = $this->objectModel->getNextUser($users, $current);
|
||||
@@ -1012,6 +1399,13 @@ class taskTest
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get task's team member pairs.
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getMemberPairsTest($taskID)
|
||||
{
|
||||
$task = $this->objectModel->getByID($taskID);
|
||||
@@ -1029,4 +1423,25 @@ class taskTest
|
||||
return $object;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test check whether need update status of bug.
|
||||
*
|
||||
* @param object $task
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function needUpdateBugStatusTest($task)
|
||||
{
|
||||
$object = $this->objectModel->needUpdateBugStatus($task);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $object ? 1 : 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,430 @@
|
||||
<?php
|
||||
class userTest
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel = $tester->loadModel('user');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user list.
|
||||
*
|
||||
* @param bool $count
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getListTest($count = false)
|
||||
{
|
||||
$objects = $this->objectModel->getList();
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $count ? count($objects) : $objects;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user information by accounts.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @param bool $count
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getListByAccountsTest($accounts = array(), $count = false)
|
||||
{
|
||||
$objects = $this->objectModel->getListByAccounts($accounts);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $count ? count($objects) : $objects;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test user get pairs.
|
||||
*
|
||||
* @param string $params
|
||||
* @param string $usersToAppended
|
||||
* @param int $maxCount
|
||||
* @param array $accounts
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getPairsTest($params = '', $usersToAppended = '', $maxCount = 0, $accounts = array())
|
||||
{
|
||||
$objects = $this->objectModel->getPairs($params, $usersToAppended, $maxCount, $accounts);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get avatar pairs.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getAvatarPairsTest()
|
||||
{
|
||||
$objects = $this->objectModel->getAvatarPairs();
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user commiters.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getCommitersTest()
|
||||
{
|
||||
$objects = $this->objectModel->getCommiters();
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user realname and emails.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getRealNameAndEmailsTest($accounts)
|
||||
{
|
||||
$objects = $this->objectModel->getRealNameAndEmails($accounts);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user roles.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @param bool $needRole
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getUserRolesTest($accounts, $needRole = false)
|
||||
{
|
||||
$objects = $this->objectModel->getUserRoles($accounts, $needRole);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user display infos.
|
||||
*
|
||||
* @param int $accounts
|
||||
* @param int $deptID
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getUserDisplayInfosTest($accounts, $deptID = 0, $type = 'inside')
|
||||
{
|
||||
$objects = $this->objectModel->getUserDisplayInfos($accounts, $deptID, $type);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user by id.
|
||||
*
|
||||
* @param int|string $userID
|
||||
* @param string $field
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getByIdTest($userID, $field = 'account')
|
||||
{
|
||||
$objects = $this->objectModel->getById($userID, $field);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user by query.
|
||||
*
|
||||
* @param string $browseType
|
||||
* @param string $query
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getByQueryTest($browseType = 'inside', $query = '', $orderBy = 'id')
|
||||
{
|
||||
$objects = $this->objectModel->getByQuery($browseType, $query, null, $orderBy);
|
||||
if(dao::isError())
|
||||
{
|
||||
$error = dao::getError();
|
||||
return $error[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create a user.
|
||||
*
|
||||
* @param array $params
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createUserTest($params = array())
|
||||
{
|
||||
$_POST = $params;
|
||||
$_POST['verifyPassword'] = 'e79f8fb9726857b212401e42e5b7e18b';
|
||||
|
||||
$userID = $this->objectModel->create();
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->objectModel->getByID($userID, 'id');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch create users.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchCreateUserTest($params = array())
|
||||
{
|
||||
$_POST = $params;
|
||||
$_POST['verifyPassword'] = 'e79f8fb9726857b212401e42e5b7e18b';
|
||||
|
||||
$userIDList = $this->objectModel->batchCreate();
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
$users = array();
|
||||
foreach($userIDList as $userID) $users[] = $this->objectModel->getByID($userID, 'id');
|
||||
|
||||
return $users;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test edit a user.
|
||||
*
|
||||
* @param int $userID
|
||||
* @param array $params
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateUserTest($userID, $params = array())
|
||||
{
|
||||
$_POST = $params;
|
||||
$_POST['verifyPassword'] = 'e79f8fb9726857b212401e42e5b7e18b';
|
||||
|
||||
$this->objectModel->update($userID);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->objectModel->getByID($userID, 'id');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test batch edit users.
|
||||
*
|
||||
* @param array $params
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function batchEditUserTest($params = array())
|
||||
{
|
||||
$_POST = $params;
|
||||
$_POST['verifyPassword'] = 'e79f8fb9726857b212401e42e5b7e18b';
|
||||
|
||||
$this->objectModel->batchEdit($params);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
$users = array();
|
||||
$userIDList = array_keys($params['account']);
|
||||
foreach($userIDList as $userID)
|
||||
{
|
||||
$user = $this->objectModel->getByID($userID, 'id');
|
||||
$users[$user->id] = $user;
|
||||
}
|
||||
|
||||
return $users;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Test edit a user password.
|
||||
*
|
||||
* @param int $userID
|
||||
* @param array $params
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updatePasswordTest($userID, $params = array())
|
||||
{
|
||||
$_POST = $params;
|
||||
|
||||
$this->objectModel->updatePassword($userID);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->objectModel->getByID($userID, 'id');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset user password.
|
||||
*
|
||||
* @param array $params
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function resetPasswordTest($params = array())
|
||||
{
|
||||
$_POST = $params;
|
||||
|
||||
$this->objectModel->resetPassword();
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
$account = $params['account'];
|
||||
return $this->objectModel->getByID($account, 'account');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check user password.
|
||||
*
|
||||
* @param array $params
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkPasswordTest($params = array())
|
||||
{
|
||||
$_POST = $params;
|
||||
|
||||
$this->objectModel->checkPassword();
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
return '无报错';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Identify user.
|
||||
*
|
||||
* @param string $account
|
||||
* @param string $password
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function identifyTest($account, $password)
|
||||
{
|
||||
$_POST = $params;
|
||||
|
||||
$user = $this->objectModel->identify($account, $password);
|
||||
unset($_POST);
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
+11
-3
@@ -49,12 +49,20 @@ fields:
|
||||
note: "昵称"
|
||||
- field: commiter
|
||||
note: "源代码帐号"
|
||||
fields:
|
||||
- field: commiter1
|
||||
range: admin,user{99},test{100},dev{100},pm{100},po{100},td{100},pd{100},qd{100},top{100},outside{100},others{100},a,bb,ccc,qwuiadsd?!2as@#%$aasd~aj1!@#1
|
||||
- field: commiter2
|
||||
range: [],1-99,1-100,1-100,1-100,1-100,1-100,1-100,1-100,1-100,1-100,1-100,[]{4}
|
||||
- field: avatar
|
||||
note: ""
|
||||
range: 0
|
||||
fields:
|
||||
- field: avatar1
|
||||
range: /home/z/tmp/,/home/z/user/
|
||||
- field: avatar2
|
||||
range: 1-10,10-20
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
postfix: ".png"
|
||||
format: ""
|
||||
- field: birthday
|
||||
note: "生日"
|
||||
|
||||
@@ -154,7 +154,7 @@ class Processor
|
||||
$parentID = implode(',', $parentIDList);
|
||||
|
||||
$this->dao->update(TABLE_TASK)->set('parent')->eq(-1)->where('id')->in($parentID)->andWhere('deleted')->eq(0)->exec();
|
||||
$this->dao->update(TABLE_TASK)->set('assignedTo')->eq('po82')->set('mailto')->eq('user1,user2,user3')->where('id')->eq(1)->andWhere('deleted')->eq(0)->exec();
|
||||
$this->dao->update(TABLE_TASK)->set('assignedTo')->eq('po82')->set('mailto')->eq('user1,user2,user3')->set('frombug')->eq('1')->where('id')->eq(1)->andWhere('deleted')->eq(0)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,6 +26,6 @@ $withLeft = array('estimate' => '21', 'withLeft' => '1');
|
||||
$waterfallEstimate = array('estimate' => '17', 'withLeft' => '1');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->fixFirstTest($executionIDList[0], $scrumEstimate)) && p('0:estimate') && e('26'); // 敏捷执行更新首日工时
|
||||
r($execution->fixFirstTest($executionIDList[0], $scrumEstimate)) && p('0:estimate') && e('26'); // 不传入withLeft
|
||||
r($execution->fixFirstTest($executionIDList[0], $withLeft)) && p('0:estimate') && e('26'); // 敏捷执行更新首日剩余工时
|
||||
r($execution->fixFirstTest($executionIDList[1], $waterfallEstimate)) && p('0:left') && e('17'); // 瀑布执行更新首日剩余工时
|
||||
|
||||
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/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->fixOrderTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->fixOrderTest()) && p('101:order') && e('15'); // 重置order
|
||||
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/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->getDateListTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$start = array('2022-01-01', '2025-01-01');
|
||||
$end = array('2022-01-07', '2025-01-07');
|
||||
$count = array('0', '1');
|
||||
$type = array('noweekend', 'week');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->getDateListTest($start[0], $end[0], $type[0] ,$count[0])) && p('0:0') && e('01/03/2022'); // 去除工作日日期列表
|
||||
r($execution->getDateListTest($start[0], $end[0], $type[0] ,$count[1])) && p() && e('5'); // 去除工作日日期列表统计
|
||||
r($execution->getDateListTest($start[0], $end[0], $type[1] ,$count[0])) && p('0:0') && e('01/01/2022'); // 未去除工作日日期列表
|
||||
r($execution->getDateListTest($start[0], $end[0], $type[1] ,$count[1])) && p() && e('7'); // 未去除工作日日期列表统计
|
||||
r($execution->getDateListTest($start[1], $end[0], $type[1] ,$count[0])) && p() && e('无数据'); // 日期输入错误查询
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->getKanbanColorListTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$count = array('0', '1');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->getKanbanColorListTest($count[0])) && p('wait') && e('#7EC5FF'); // 看板状态颜色查询
|
||||
r($execution->getKanbanColorListTest($count[1])) && p() && e('6'); // 看板状态颜色数量统计
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->getKanbanColumnsTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$count = array('0', '1');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->getKanbanColumnsTest($count[0])[0]) && p() && e('wait'); // 看板列查询
|
||||
r($execution->getKanbanColumnsTest($count[1])) && p() && e('6'); // 看板列查询统计
|
||||
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/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->getKanbanGroupDataTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$executionIDList = array('101', '131', '161');
|
||||
$count = array('0', '1');
|
||||
|
||||
$execution = new executionTest();
|
||||
var_dump($execution->getKanbanGroupDataTest($executionIDList[0], $count[0]));die;
|
||||
r($execution->getKanbanGroupDataTest($executionIDList[0], $count[0])) && p('906:name,execution') && e('子任务6,101'); // 敏捷执行查询
|
||||
r($execution->getKanbanGroupDataTest($executionIDList[1], $count[0])) && p('693:name,execution') && e('更多任务93,131'); // 瀑布执行查询
|
||||
r($execution->getKanbanGroupDataTest($executionIDList[2], $count[0])) && p('61:name,execution') && e('开发任务71,161'); // 看板执行查询
|
||||
r($execution->getKanbanGroupDataTest($executionIDList[0], $count[1])) && p() && e('11'); // 敏捷执行查询统计
|
||||
r($execution->getKanbanGroupDataTest($executionIDList[1], $count[1])) && p() && e('4'); // 瀑布执行查询统计
|
||||
r($execution->getKanbanGroupDataTest($executionIDList[2], $count[1])) && p() && e('4'); // 看板执行查询统计
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->getKanbanSettingTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$count = array('0', '1');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->getKanbanSettingTest($count[0])) && p('colorList:wait') && e('#7EC5FF'); // 看板设置查询
|
||||
r($execution->getKanbanSettingTest($count[1])) && p() && e('6'); // 看板设置查询统计
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->getKanbanStatusListTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$count = array('0', '1');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->getKanbanStatusListTest($count[0])) && p('wait') && e('未开始');// 看板状态列表查询
|
||||
r($execution->getKanbanStatusListTest($count[1])) && p() && e('7'); // 看板状态列表数量统计
|
||||
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/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->getKanbanStatusMapTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$count = array('0', '1');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->getKanbanStatusMapTest($count[0])["task"]) && p('wait:doing') && e('start'); // 看板tesk查询
|
||||
r($execution->getKanbanStatusMapTest($count[0])["bug"]) && p('wait:done') && e('resolve'); // 看板bug查询
|
||||
r($execution->getKanbanStatusMapTest($count[1])) && p() && e('2'); // 看板统计
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->getKanbanTasksTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$executionIDList = array('101', '131', '161');
|
||||
$count = array('0', '1');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->getKanbanTasksTest($executionIDList[0], $count[0])) && p('906:name,execution') && e('子任务6,101'); // 敏捷执行查询
|
||||
r($execution->getKanbanTasksTest($executionIDList[1], $count[0])) && p('693:name,execution') && e('更多任务93,131'); // 瀑布执行查询
|
||||
r($execution->getKanbanTasksTest($executionIDList[2], $count[0])) && p('61:name,execution') && e('开发任务71,161'); // 看板执行查询
|
||||
r($execution->getKanbanTasksTest($executionIDList[0], $count[1])) && p() && e('11'); // 敏捷执行查询统计
|
||||
r($execution->getKanbanTasksTest($executionIDList[1], $count[1])) && p() && e('4'); // 瀑布执行查询统计
|
||||
r($execution->getKanbanTasksTest($executionIDList[2], $count[1])) && p() && e('4'); // 看板执行查询统计
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->getTotalEstimateTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$executionIDList = array('101', '131', '161');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->getTotalEstimateTest($executionIDList[0])) && p() && e('48'); // 敏捷执行预计工时统计
|
||||
r($execution->getTotalEstimateTest($executionIDList[1])) && p() && e('17'); // 瀑布执行预计工时统计
|
||||
r($execution->getTotalEstimateTest($executionIDList[2])) && p() && e('20'); // 看板执行预计工时统计
|
||||
r($execution->getTotalEstimateTest('')) && p() && e('0'); // 无执行预计工时统计
|
||||
Executable
+58
@@ -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';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->isClickableTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$waitExecution = new stdclass();
|
||||
$doingExecution = new stdclass();
|
||||
$suspendedExecution = new stdclass();
|
||||
$closedExecution = new stdclass();
|
||||
|
||||
$waitExecution->status = 'wait';
|
||||
$doingExecution->status = 'doing';
|
||||
$suspendedExecution->status = 'suspended';
|
||||
$closedExecution->status = 'closed';
|
||||
|
||||
$actionList = array('start', 'close', 'suspend', 'putoff', 'activate', 'delete');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->isClickableTest($waitExecution, $actionList[0])) && p() && e('检查通过'); // wait状态执行start按钮检查
|
||||
r($execution->isClickableTest($waitExecution, $actionList[1])) && p() && e('检查通过'); // wait状态执行close按钮检查
|
||||
r($execution->isClickableTest($waitExecution, $actionList[2])) && p() && e('检查通过'); // wait状态执行suspend按钮检查
|
||||
r($execution->isClickableTest($waitExecution, $actionList[3])) && p() && e('检查通过'); // wait状态执行putoff按钮检查
|
||||
r($execution->isClickableTest($waitExecution, $actionList[4])) && p() && e('检查不通过'); // wait状态执行activate按钮检查
|
||||
r($execution->isClickableTest($waitExecution, $actionList[5])) && p() && e('检查通过'); // wait状态执行delete按钮检查
|
||||
r($execution->isClickableTest($doingExecution, $actionList[0])) && p() && e('检查不通过'); // doing状态执行start按钮检查
|
||||
r($execution->isClickableTest($doingExecution, $actionList[1])) && p() && e('检查通过'); // doing状态执行close按钮检查
|
||||
r($execution->isClickableTest($doingExecution, $actionList[2])) && p() && e('检查通过'); // doing状态执行suspend按钮检查
|
||||
r($execution->isClickableTest($doingExecution, $actionList[3])) && p() && e('检查通过'); // doing状态执行putoff按钮检查
|
||||
r($execution->isClickableTest($doingExecution, $actionList[4])) && p() && e('检查不通过'); // doing状态执行activate按钮检查
|
||||
r($execution->isClickableTest($doingExecution, $actionList[5])) && p() && e('检查通过'); // doing状态执行delete按钮检查
|
||||
r($execution->isClickableTest($suspendedExecution, $actionList[0])) && p() && e('检查不通过'); // suspended状态执行start按钮检查
|
||||
r($execution->isClickableTest($suspendedExecution, $actionList[1])) && p() && e('检查通过'); // suspended状态执行close按钮检查
|
||||
r($execution->isClickableTest($suspendedExecution, $actionList[2])) && p() && e('检查不通过'); // suspended状态执行suspend按钮检查
|
||||
r($execution->isClickableTest($suspendedExecution, $actionList[3])) && p() && e('检查不通过'); // suspended状态执行putoff按钮检查
|
||||
r($execution->isClickableTest($suspendedExecution, $actionList[4])) && p() && e('检查通过'); // suspended状态执行activate按钮检查
|
||||
r($execution->isClickableTest($suspendedExecution, $actionList[5])) && p() && e('检查不通过'); // suspended状态执行delete按钮检查
|
||||
r($execution->isClickableTest($closedExecution, $actionList[0])) && p() && e('检查不通过'); // closed状态执行start按钮检查
|
||||
r($execution->isClickableTest($closedExecution, $actionList[1])) && p() && e('检查不通过'); // closed状态执行close按钮检查
|
||||
r($execution->isClickableTest($closedExecution, $actionList[2])) && p() && e('检查不通过'); // closed状态执行suspend按钮检查
|
||||
r($execution->isClickableTest($closedExecution, $actionList[3])) && p() && e('检查不通过'); // closed状态执行putoff按钮检查
|
||||
r($execution->isClickableTest($closedExecution, $actionList[4])) && p() && e('检查通过'); // closed状态执行activate按钮检查
|
||||
r($execution->isClickableTest($closedExecution, $actionList[5])) && p() && e('检查不通过'); // closed状态执行delete按钮检查
|
||||
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/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->processBurnDataTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$executionIDList = array('101', '131', '161');
|
||||
$itemCounts = array('30', '60', '100');
|
||||
$begin = array('2022-01-15','2022-03-22');
|
||||
$end = array('2022-03-22','2022-01-15');
|
||||
$count = array('0','1');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->processBurnDataTest($executionIDList[0], $itemCounts[0], $begin[0], $end[0], $count[1])) && p() && e('29'); // 敏捷执行查询统计
|
||||
r($execution->processBurnDataTest($executionIDList[1], $itemCounts[1], $begin[0], $end[0], $count[1])) && p() && e('60'); // 瀑布执行查询统计
|
||||
r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[0], $end[0], $count[1])) && p() && e('60'); // 看板执行查询统计
|
||||
r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[1], $end[1], $count[1])) && p() && e('0'); // 错误时间查询统计
|
||||
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/execution.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试executionModel->summaryTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
敏捷执行关联用例 >> 101,1,1
|
||||
瀑布执行关联用例 >> 131,43,169
|
||||
看板执行关联用例 >> 161,68,269
|
||||
敏捷执行关联用例统计 >> 4
|
||||
瀑布执行关联用例统计 >> 4
|
||||
看板执行关联用例统计 >> 4
|
||||
|
||||
*/
|
||||
|
||||
$executionIDList = array('101', '131', '161');
|
||||
|
||||
$execution = new executionTest();
|
||||
r($execution->summaryTest($executionIDList[0])) && p() && e('本页共 <strong>14</strong> 个任务,未开始 <strong>4</strong>,进行中 <strong>3</strong>,总预计 <strong>3</strong> 工时,已消耗 <strong>15</strong> 工时,剩余 <strong>3</strong> 工时。'); // 敏捷执行任务统计
|
||||
r($execution->summaryTest($executionIDList[1])) && p() && e('本页共 <strong>4</strong> 个任务,未开始 <strong>2</strong>,进行中 <strong>1</strong>,总预计 <strong>17</strong> 工时,已消耗 <strong>15</strong> 工时,剩余 <strong>17</strong> 工时。'); // 瀑布执行任务统计
|
||||
r($execution->summaryTest($executionIDList[2])) && p() && e('本页共 <strong>4</strong> 个任务,未开始 <strong>2</strong>,进行中 <strong>1</strong>,总预计 <strong>20</strong> 工时,已消耗 <strong>15</strong> 工时,剩余 <strong>20</strong> 工时。'); // 看板执行任务统计
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/task.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=taskModel->needUpdateBugStatus();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
计算不来源于bug的任务是否需要更新bug状态 >> 2
|
||||
计算来源于bug的任务是否需要更新bug状态 bug状态active >> 1
|
||||
计算来源于bug的任务是否需要更新bug状态 bug状态resolved >> 2
|
||||
|
||||
*/
|
||||
|
||||
$task1 = new stdclass();
|
||||
$task1->fromBug = 0;
|
||||
|
||||
$task2 = new stdclass();
|
||||
$task2->fromBug = 1;
|
||||
|
||||
$task3 = new stdclass();
|
||||
$task3->fromBug = 51;
|
||||
|
||||
$task = new taskTest();
|
||||
r($task->needUpdateBugStatusTest($task1)) && p() && e('2'); //计算不来源于bug的任务是否需要更新bug状态
|
||||
r($task->needUpdateBugStatusTest($task2)) && p() && e('1'); //计算来源于bug的任务是否需要更新bug状态 bug状态active
|
||||
r($task->needUpdateBugStatusTest($task3)) && p() && e('2'); //计算来源于bug的任务是否需要更新bug状态 bug状态resolved
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->batchCreateTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
密码较弱的情况 >> 您的密码强度小于系统设定。
|
||||
Visions为空的情况 >> 『版本类型』不能为空。
|
||||
用户名为空的情况 >> 『用户名』不能为空。
|
||||
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
|
||||
两次密码不相同的情况 >> 两次密码应该相同。
|
||||
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
|
||||
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
|
||||
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$normalUser = array();
|
||||
$normalUser['account'] = array(1 => 'newtestuser1', 2 => 'newtestuser2', 3 => 'newtestuser3');
|
||||
$normalUser['realname'] = array(1 => '新测试用户1', 2 => '新测试用户2', 3 => '新测试用户3');
|
||||
$normalUser['visions'] = array(1 => 'rnd', 2 => 'rnd,lite', 3 => 'lite');
|
||||
$normalUser['role'] = array(1 => 'qa', 2 => 'dev', 3 => 'pm');
|
||||
$normalUser['email'] = array(1 => 'testasd@163.com', 2 => '', 3 => '11773@qq.com');
|
||||
$normalUser['password'] = array(1 => 'e10adc3949ba59abbe56e057f20f883e', 2 => 'e10adc3949ba59abbe56e057f20f883e', 3 => 'e10adc3949ba59abbe56e057f20f883e');
|
||||
|
||||
r($user->batchCreateUserTest($normalUser)) && p('0:account') && e('newtestuser1'); //获取插入的第一个用户的account
|
||||
r($user->batchCreateUserTest($normalUser)) && p('2:realname') && e('新测试用户3'); //获取插入的最后一个用户的realname
|
||||
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->batchEditTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
密码较弱的情况 >> 您的密码强度小于系统设定。
|
||||
Visions为空的情况 >> 『版本类型』不能为空。
|
||||
用户名为空的情况 >> 『用户名』不能为空。
|
||||
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
|
||||
两次密码不相同的情况 >> 两次密码应该相同。
|
||||
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
|
||||
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
|
||||
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$normalUser = array();
|
||||
$normalUser['account'] = array(998 => 'newtestuser1', 999 => 'newtestuser2', 1000 => 'newtestuser3');
|
||||
$normalUser['realname'] = array(998 => '新测试用户1', 999 => '新测试用户2', 1000 => '新测试用户3');
|
||||
$normalUser['visions'] = array(998 => 'rnd', 999 => 'rnd,lite', 1000 => 'lite');
|
||||
$normalUser['role'] = array(998 => 'qa', 999 => 'dev', 1000 => 'pm');
|
||||
$normalUser['email'] = array(998 => 'testasd@163.com', 999 => '', 1000 => '11773@qq.com');
|
||||
$normalUser['password'] = array(998 => 'e10adc3949ba59abbe56e057f20f883e', 999 => 'e10adc3949ba59abbe56e057f20f883e', 1000 => 'e10adc3949ba59abbe56e057f20f883e');
|
||||
|
||||
r($user->batchEditUserTest($normalUser)) && p('998:account') && e('newtestuser1'); //获取编辑后的第一个用户的account
|
||||
r($user->batchEditUserTest($normalUser)) && p('1000:realname') && e('新测试用户3'); //获取编辑的最后一个用户的真实姓名
|
||||
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,44 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->checkPasswordTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
密码较弱的情况 >> 您的密码强度小于系统设定。
|
||||
Visions为空的情况 >> 『版本类型』不能为空。
|
||||
用户名为空的情况 >> 『用户名』不能为空。
|
||||
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
|
||||
两次密码不相同的情况 >> 两次密码应该相同。
|
||||
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
|
||||
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
|
||||
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$normalUser = array();
|
||||
$normalUser['password1'] = 'Adsd@#!%qaz';
|
||||
$normalUser['password2'] = 'Adsd@#!%qaz';
|
||||
$normalUser['passwordStrength'] = 1;
|
||||
|
||||
$weakPassword = $normalUser;
|
||||
$weakPassword['passwordStrength'] = '0';
|
||||
|
||||
$differentPassword = $normalUser;
|
||||
$differentPassword['password2'] = '!@#!@#asfasf';
|
||||
|
||||
$simplePassword = $normalUser;
|
||||
$simplePassword['password1'] = '123456';
|
||||
$simplePassword['password2'] = '123456';
|
||||
|
||||
r($user->checkPasswordTest($normalUser)) && p('password') && e('无报错'); //正常的用户密码
|
||||
r($user->checkPasswordTest($differentPassword)) && p('password:0') && e('两次密码应该相同。'); //两次密码不相同的情况
|
||||
r($user->checkPasswordTest($weakPassword)) && p('password1:0') && e('您的密码强度小于系统设定。'); //密码强度小于系统设定
|
||||
r($user->checkPasswordTest($simplePassword)) && p('password1:0') && e('密码不能使用【123456,password,12345,12345678,qwerty,123456789,1234,1234567,abc123,111111,123123】这些常用弱口令。'); //使用常见简单密码,给出错误提示
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->createUserTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
密码较弱的情况 >> 您的密码强度小于系统设定。
|
||||
Visions为空的情况 >> 『版本类型』不能为空。
|
||||
用户名为空的情况 >> 『用户名』不能为空。
|
||||
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
|
||||
两次密码不相同的情况 >> 两次密码应该相同。
|
||||
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
|
||||
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
|
||||
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$normalUser = array();
|
||||
$normalUser['account'] = 'newtestuser';
|
||||
$normalUser['realname'] = '新的测试用户';
|
||||
$normalUser['password1'] = 'e10adc3949ba59abbe56e057f20f883e';
|
||||
$normalUser['password2'] = 'e10adc3949ba59abbe56e057f20f883e';
|
||||
$normalUser['type'] = 'inside';
|
||||
$normalUser['passwordStrength'] = 1;
|
||||
$normalUser['visions'] = 'rnd';
|
||||
|
||||
$weakPassword = $normalUser;
|
||||
$weakPassword['passwordStrength'] = 0;
|
||||
|
||||
$emptyVisions = $normalUser;
|
||||
unset($emptyVisions['visions']);
|
||||
|
||||
$emptyAccount = $normalUser;
|
||||
unset($emptyAccount['account']);
|
||||
|
||||
$specialAccount = $normalUser;
|
||||
$specialAccount['account'] = 'sa!@#asdf';
|
||||
|
||||
$differentPassword = $normalUser;
|
||||
$differentPassword['password2'] = 'asfjhjkahf9012asd123';
|
||||
|
||||
$existUser = $normalUser;
|
||||
$existUser['account'] = 'admin';
|
||||
|
||||
r($user->createUserTest($weakPassword)) && p('password1:0') && e('您的密码强度小于系统设定。'); //密码较弱的情况
|
||||
r($user->createUserTest($emptyVisions)) && p('visions:0') && e('『版本类型』不能为空。'); //Visions为空的情况
|
||||
r($user->createUserTest($emptyAccount)) && p('account:0') && e('『用户名』不能为空。'); //用户名为空的情况
|
||||
r($user->createUserTest($specialAccount)) && p('account:0') && e('『用户名』只能是字母、数字或下划线的组合三位以上。'); //用户名特殊的情况
|
||||
r($user->createUserTest($differentPassword)) && p('password:0') && e('两次密码应该相同。'); //两次密码不相同的情况
|
||||
r($user->createUserTest($existUser)) && p('account:0') && e('『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); //插入重复的用户名,返回报错信息
|
||||
r($user->createUserTest($normalUser)) && p('id,realname') && e('1001,新的测试用户'); //正常插入用户,返回新插入的ID、真实姓名
|
||||
r($user->createUserTest($normalUser)) && p('realname') && e('新的测试用户'); //正常插入用户,返回新插入的真实姓名
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
所有用户头像的数量 >> 999
|
||||
查找account为"user99"的用户的头像路径 >> /home/z/user/15.png
|
||||
|
||||
*/
|
||||
$user = new userTest();
|
||||
|
||||
r(count($user->getAvatarPairsTest())) && p() && e('999'); //所有用户头像的数量
|
||||
r($user->getAvatarPairsTest()) && p('user99') && e('/home/z/user/15.png'); //查找account为"user99"的用户的头像路径
|
||||
+11
-14
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
@@ -10,19 +10,16 @@ title=测试 userModel::getById();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
通过id获取存在的用户 >> account1
|
||||
使用account字段获取存在的用户 >> account1
|
||||
通过默认字段获取存在的用户 >> account1
|
||||
通过id获取存在的用户 >> admin
|
||||
使用account字段获取存在的用户 >> admin
|
||||
通过默认字段获取存在的用户 >> admin
|
||||
|
||||
*/
|
||||
$user = $tester->loadModel('user');
|
||||
$user = new userTest();
|
||||
|
||||
r($user->getById(1, 'id')) && p('account') && e('admin'); // 通过id获取存在的用户
|
||||
r($user->getByID('admin', 'account')) && p('account') && e('admin'); // 使用account字段获取存在的用户
|
||||
r($user->getByID('admin')) && p('account') && e('admin'); // 通过默认字段获取存在的用户
|
||||
|
||||
/*
|
||||
r($user->getByID(1)) && p('account') && e(''); // 通过默认字段获取不存在的用户
|
||||
r($user->getByID(100000, 'id')) && p('account') && e(''); // 通过id字段获取不存在的用户
|
||||
r($user->getByID('error', 'account')) && p('account') && e(''); // 通过默认字段获取不存在的用户
|
||||
*/
|
||||
r($user->getByIDTest(1, 'id')) && p('account') && e('admin'); // 通过id获取存在的用户
|
||||
r($user->getByIDTest('admin', 'account')) && p('account') && e('admin'); // 使用account字段获取存在的用户
|
||||
r($user->getByIDTest('admin')) && p('account') && e('admin'); // 通过默认字段获取存在的用户
|
||||
r($user->getByIDTest(1)) && p('account') && e(''); // 通过默认字段获取不存在的用户
|
||||
r($user->getByIDTest(100000, 'id')) && p('account') && e(''); // 通过id字段获取不存在的用户
|
||||
r($user->getByIDTest('error', 'account')) && p('account') && e(''); // 通过默认字段获取不存在的用户
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel::getById();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
对比获取到的内部用户的数量 >> 303
|
||||
按ID倒序查询内部用户,获取最后一个用户的account >> admin
|
||||
获取第一个外部用户的真实姓名 >> 用户1
|
||||
|
||||
*/
|
||||
$user = new userTest();
|
||||
$insideQAUsers = $user->getByQueryTest('inside', "`role` = 'qa'", 'id desc');
|
||||
$outsideUsers = $user->getByQueryTest('outside');
|
||||
|
||||
r(count($insideQAUsers)) && p() && e('303'); //对比获取到的内部用户的数量
|
||||
r($insideQAUsers) && p('302:account') && e('admin'); //按ID倒序查询内部用户,获取最后一个用户的account
|
||||
r($outsideUsers) && p('0:realname') && e('用户1'); //获取第一个外部用户的真实姓名
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取源代码账号为qd100的用户真实姓名 >> 高层管理100
|
||||
获取系统中源代码账号不为空的用户数量 >> 1000
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$commiters = $user->getCommitersTest();
|
||||
|
||||
r($commiters) && p('qd100') && e('高层管理100'); //获取源代码账号为qd100的用户真实姓名
|
||||
r(count($commiters)) && p() && e('1000'); //获取系统中源代码账号不为空的用户数量
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查找系统中第二个未删除的、内部用户真实姓名,根据account正序排 >> 开发1
|
||||
查找系统中未删除的、根据account正序排的最后一个用户的姓名 >> 测试99
|
||||
查找系统中所有未删除的、内部用户的数量 >> 999
|
||||
查找系统中不存在的用户,输出错误提示 >> Error: Cannot get index 1000
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
a($user->getListTest());die;
|
||||
r($user->getListTest()) && p('1:realname') && e('开发1'); //查找系统中第二个未删除的、内部用户真实姓名,根据account正序排
|
||||
r($user->getListTest()) && p('998:realname') && e('测试99'); //查找系统中未删除的、根据account正序排的最后一个用户的姓名
|
||||
r($user->getListTest(true)) && p() && e('999'); //查找系统中所有未删除的、内部用户的数量
|
||||
r($user->getListTest()) && p('1000:realname') && e('Error: Cannot get index 1000'); //查找系统中不存在的用户,输出错误提示
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getListByAccountsTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
按照给定的用户名列表查询用户信息,获取用户ID为1的用户真实姓名和角色 >> admin,qa
|
||||
按照给定的用户名列表查询用户信息,获取查询出的用户列表数量 >> 3
|
||||
按照给定的用户名列表查询用户信息,获取用户ID为0的用户信息 >> Error: Cannot get index 0.
|
||||
|
||||
*/
|
||||
$accounts = array('admin', 'program1whitelist', 'user10', 'ccsdqq@!');
|
||||
$count = array(0 => false, 1 => true);
|
||||
|
||||
$user = new userTest();
|
||||
r($user->getListByAccountsTest($accounts, $count[0])) && p('1:realname,role') && e('admin,qa'); //按照给定的用户名列表查询用户信息,获取用户ID为1的用户真实姓名和角色
|
||||
r($user->getListByAccountsTest($accounts, $count[1])) && p() && e('3'); //按照给定的用户名列表查询用户信息,获取查询出的用户列表数量
|
||||
r($user->getListByAccountsTest($accounts, $count[0])) && p('0:realname') && e('Error: Cannot get index 0.'); //按照给定的用户名列表查询用户信息,获取用户ID为0的用户信息
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查找带有Closed用户的外部用户键值对 >> Closed
|
||||
查找带有首字母的外部用户键值对 >> O:用户1
|
||||
查找不带首字母的外部用户键值对 >> 用户1
|
||||
按照给定的用户名查找用户键值对,返回值中不带有Closed用户 >> 1
|
||||
按照给定的用户名查找用户键值对,返回值中带有Closed用户 >> 2
|
||||
使用limit参数来限制最多获取2个用户键值对 >> 2
|
||||
使用limit参数来限制最多获取50个用户键值对 >> 50
|
||||
使用pofirst参数来将系统中的产品经理用户放到返回值前列 >> P:测试主管58
|
||||
使用pmfirst参数来将系统中的项目经理用户放到返回值前列 >> O:其他100
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$accounts = array('tesrasd1asd#@!#$', 'ASD123中文', 'user10', 'ccsdqq@!');
|
||||
$outsideUsersWithClosed = $user->getPairsTest('outside');
|
||||
$outsideUsersWithLetter = $user->getPairsTest('outside|noclosed');
|
||||
$outsideUsersNoLetter = $user->getPairsTest('outside|noclosed|noletter');
|
||||
$usersInAccountsNoclosed = $user->getPairsTest('noempty|noclosed', '', 0, $accounts);
|
||||
$usersInAccountsWithclosed = $user->getPairsTest('noempty', '', 0, $accounts);
|
||||
$limit2Users = $user->getPairsTest('noempty|noclosed', '', 2);
|
||||
$limit50Users = $user->getPairsTest('noempty|noclosed', '', 50);
|
||||
$POFirstUsers = $user->getPairsTest('noempty|noclosed|pofirst');
|
||||
$PMFirstUsers = $user->getPairsTest('noempty|noclosed|pmfirst');
|
||||
$firstPO = array_slice($POFirstUsers, 0, 1);
|
||||
$firstPM = array_slice($PMFirstUsers, 0, 1);
|
||||
|
||||
r($outsideUsersWithClosed) && p('closed') && e('Closed'); //查找带有Closed用户的外部用户键值对
|
||||
r($outsideUsersWithLetter) && p('outside1') && e('O:用户1'); //查找带有首字母的外部用户键值对
|
||||
r($outsideUsersNoLetter) && p('outside1') && e('用户1'); //查找不带首字母的外部用户键值对
|
||||
r(count($usersInAccountsNoclosed)) && p() && e('1'); //按照给定的用户名查找用户键值对,返回值中不带有Closed用户
|
||||
r(count($usersInAccountsWithclosed)) && p() && e('2'); //按照给定的用户名查找用户键值对,返回值中带有Closed用户
|
||||
r(count($limit2Users)) && p() && e('2'); //使用limit参数来限制最多获取2个用户键值对
|
||||
r(count($limit50Users)) && p() && e('50'); //使用limit参数来限制最多获取50个用户键值对
|
||||
r($firstPO) && p('pd58') && e('P:测试主管58'); //使用pofirst参数来将系统中的产品经理用户放到返回值前列
|
||||
r($firstPM) && p('outside100') && e('O:其他100'); //使用pmfirst参数来将系统中的项目经理用户放到返回值前列
|
||||
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取admin的邮箱 >> 833482@qq.com
|
||||
从accounts中获取到的用户邮箱数量 >> 2
|
||||
|
||||
*/
|
||||
|
||||
$accounts = array('tesrasd1asd#@!#$', 'ASD123中文', 'user10', 'ccsdqq@!', 'admin');
|
||||
$user = new userTest();
|
||||
$emails = $user->getRealNameAndEmailsTest($accounts);
|
||||
|
||||
r($emails['admin']) && p('email') && e('833482@qq.com'); //获取admin的邮箱
|
||||
r(count($emails)) && p() && e('2'); //从accounts中获取到的用户邮箱数量
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查找获取到的用户名为dev33的真实姓名 >> 项目经理33
|
||||
查找获取到的用户名为user10的头像 >> /home/z/tmp/10.png
|
||||
查找获取到的用户名为outside1的外部用户的头像信息 >> /home/z/tmp/18.png
|
||||
查找获取到的用户名为cccfff的真实姓名 >> Error: Cannot get index cccfff.
|
||||
|
||||
*/
|
||||
|
||||
$accounts = array('!asd12d', '中文用户名', 'user10', 'dev33', 'cccfff', 'outside1');
|
||||
$user = new userTest();
|
||||
|
||||
r($user->getUserDisplayInfosTest($accounts)) && p('dev33:realname') && e('项目经理33'); //查找获取到的用户名为dev33的真实姓名
|
||||
r($user->getUserDisplayInfosTest($accounts)) && p('user10:avatar') && e('/home/z/tmp/10.png'); //查找获取到的用户名为user10的头像
|
||||
r($user->getUserDisplayInfosTest($accounts, 0, 'outside')) && p('outside1:avatar') && e('/home/z/tmp/18.png'); //查找获取到的用户名为outside1的外部用户的头像信息
|
||||
r($user->getUserDisplayInfosTest($accounts)) && p('cccfff:realname') && e('Error: Cannot get index cccfff.'); //查找获取到的用户名为cccfff的真实姓名
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
获取用户名和职位Key的键值对 >> dev
|
||||
获取用户名和职位Value的键值对 >> 研发
|
||||
|
||||
*/
|
||||
|
||||
$accounts = array('!asd12d', '中文用户名', 'user10', 'dev33', 'cccfff');
|
||||
$user = new userTest();
|
||||
|
||||
r($user->getUserRolesTest($accounts, true)) && p('dev33') && e('dev'); //获取用户名和职位Key的键值对
|
||||
r($user->getUserRolesTest($accounts, false)) && p('dev33') && e('研发'); //获取用户名和职位Value的键值对
|
||||
r(count($user->getUserRolesTest($accounts, true))) && p() && e(2); //从指定accounts中获取到的键值对数量
|
||||
r(count($user->getUserRolesTest($accounts, false))) && p() && e(2); //从指定accounts中获取到的键值对数量
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->identifyTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$user->identifyTest('admin', '78302615c8b79cac8df6d2607f8a83ee');
|
||||
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->resetPasswordTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
密码较弱的情况 >> 您的密码强度小于系统设定。
|
||||
Visions为空的情况 >> 『版本类型』不能为空。
|
||||
用户名为空的情况 >> 『用户名』不能为空。
|
||||
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
|
||||
两次密码不相同的情况 >> 两次密码应该相同。
|
||||
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
|
||||
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
|
||||
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$normalUser = array();
|
||||
$normalUser['account'] = 'admin';
|
||||
$normalUser['password1'] = 'Adsd@#!%qaz';
|
||||
$normalUser['password2'] = 'Adsd@#!%qaz';
|
||||
$normalUser['passwordStrength'] = 1;
|
||||
|
||||
$weakPassword = $normalUser;
|
||||
$weakPassword['passwordStrength'] = 0;
|
||||
|
||||
$differentPassword = $normalUser;
|
||||
$differentPassword['password2'] = '!@#!@#asfasf';
|
||||
|
||||
$simplePassword = $normalUser;
|
||||
$simplePassword['password1'] = '123456';
|
||||
$simplePassword['password2'] = '123456';
|
||||
|
||||
r($user->resetPasswordTest($normalUser)) && p('password') && e('367ef140036b0feb2f90d70d33255eea'); //重设用户密码,返回重设后的加密后的密码
|
||||
r($user->resetPasswordTest($differentPassword)) && p('password:0') && e('两次密码应该相同。'); //两次密码不相同的情况
|
||||
r($user->resetPasswordTest($weakPassword)) && p('password1:0') && e('您的密码强度小于系统设定。'); //密码强度小于系统设定
|
||||
r($user->resetPasswordTest($simplePassword)) && p('password1:0') && e('密码不能使用【123456,password,12345,12345678,qwerty,123456789,1234,1234567,abc123,111111,123123】这些常用弱口令。'); //使用常见简单密码,给出错误提示
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,47 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->updateUserTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
密码较弱的情况 >> 您的密码强度小于系统设定。
|
||||
Visions为空的情况 >> 『版本类型』不能为空。
|
||||
用户名为空的情况 >> 『用户名』不能为空。
|
||||
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
|
||||
两次密码不相同的情况 >> 两次密码应该相同。
|
||||
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
|
||||
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
|
||||
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$normalUser = array();
|
||||
$normalUser['account'] = 'newtestuser4';
|
||||
$normalUser['realname'] = '新的测试用户';
|
||||
$normalUser['password1'] = 'e10adc3949ba59abbe56e057f20f883e';
|
||||
$normalUser['password2'] = 'e10adc3949ba59abbe56e057f20f883e';
|
||||
$normalUser['type'] = 'inside';
|
||||
$normalUser['passwordStrength'] = 1;
|
||||
$normalUser['visions'] = 'rnd';
|
||||
|
||||
$existUser = $normalUser;
|
||||
$existUser['account'] = 'adminasdasd';
|
||||
|
||||
$differentPassword = $normalUser;
|
||||
$differentPassword['password2'] = 'asfjsdklj1234jkljsdklfj19';
|
||||
|
||||
$specialUser = $normalUser;
|
||||
$specialUser['account'] = '!@#Asdsd中文';
|
||||
|
||||
r($user->updateUserTest(1000, $normalUser)) && p('account') && e('newtestuser4'); //编辑用户,返回新的用户名
|
||||
r($user->updateUserTest(1000, $existUser)) && p('account:0') && e('『用户名』已经有『newtestuser4』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。');//编辑用户,有重名用户的情况
|
||||
r($user->updateUserTest(1000, $differentPassword)) && p('password:0') && e('两次密码应该相同。'); //两次密码不相同的情况
|
||||
r($user->updateUserTest(1000, $specialUser)) && p('account:0') && e('『用户名』只能是字母、数字或下划线的组合三位以上。'); //用户名包含特殊字符的情况
|
||||
system("./ztest init");
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->updatePasswordTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
密码较弱的情况 >> 您的密码强度小于系统设定。
|
||||
Visions为空的情况 >> 『版本类型』不能为空。
|
||||
用户名为空的情况 >> 『用户名』不能为空。
|
||||
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
|
||||
两次密码不相同的情况 >> 两次密码应该相同。
|
||||
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
|
||||
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
|
||||
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$normalUser = array();
|
||||
$normalUser['originalPassword'] = 'e79f8fb9726857b212401e42e5b7e18b';
|
||||
$normalUser['password1'] = 'dcf859ce8dd8f998bdfe4ae6c22c329e';
|
||||
$normalUser['password2'] = 'dcf859ce8dd8f998bdfe4ae6c22c329e';
|
||||
$normalUser['passwordStrength'] = 1;
|
||||
|
||||
$weakPassword = $normalUser;
|
||||
$weakPassword['passwordStrength'] = 0;
|
||||
|
||||
$differentPassword = $normalUser;
|
||||
$differentPassword['password2'] = 'asdasfasf!@#!@#asfasf';
|
||||
|
||||
r($user->updatePasswordTest(1000, $normalUser)) && p('password') && e('dcf859ce8dd8f998bdfe4ae6c22c329e'); //编辑用户密码,返回编辑后的密码
|
||||
r($user->updatePasswordTest(1000, $differentPassword)) && p('password:0') && e('两次密码应该相同。'); //两次密码不相同的情况
|
||||
r($user->updatePasswordTest(1000, $weakPassword)) && p('password1:0') && e('您的密码强度小于系统设定。'); //密码小于设定强度的情况
|
||||
|
||||
system("./ztest init");
|
||||
@@ -34,6 +34,9 @@ switch($argv[1])
|
||||
case 'execution':
|
||||
ztfRun('model/execution');
|
||||
break;
|
||||
case 'user':
|
||||
ztfRun('model/user');
|
||||
break;
|
||||
case 'model':
|
||||
ztfRun('model');
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user