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

This commit is contained in:
tanghucheng
2022-05-09 08:40:54 +08:00
286 changed files with 10400 additions and 276 deletions
+6 -6
View File
@@ -29,9 +29,9 @@ class feedbackEntry extends Entry
$feedback->publicStatus = $feedback->public;
$feedback->productName = $data->data->product;
$feedback->moduleName = $data->data->modulePath[0]->name ? $data->data->modulePath[0]->name : '/';
$feedback->moduleName = isset($data->data->modulePath[0]->name) ? $data->data->modulePath[0]->name : '/';
$feedback->resultType = $data->data->type;
if($feedback->resultInfo->deleted == 0) $feedback->resultStatus = $this->loadModel('feedback')->processStatus($feedback->resultType, $feedback->resultInfo);
if(isset($feedback->resultInfo) and $feedback->resultInfo->deleted == 0) $feedback->resultStatus = $this->loadModel('feedback')->processStatus($feedback->resultType, $feedback->resultInfo);
if(!$data or !isset($data->status)) return $this->send400('error');
if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message);
@@ -69,14 +69,14 @@ class feedbackEntry extends Entry
/**
* DELETE method.
*
* @param int $productID
* @param int $feedbackID
* @access public
* @return void
*/
public function delete($productID)
public function delete($feedbackID)
{
$control = $this->loadController('product', 'delete');
$control->delete($productID, 'yes');
$control = $this->loadController('feedback', 'delete');
$control->delete($feedbackID, 'yes');
$this->getData();
$this->sendSuccess(200, 'success');
+16 -56
View File
@@ -512,62 +512,36 @@ class router extends baseRouter
if($this->config->requestType != 'GET')
{
/* e.g. $this->URI = /$module-close-1.html. */
$params = explode($this->config->requestFix, $this->URI); // $params = array($module, 'close', 1);
$params = explode($this->config->requestFix, $this->URI); // $params = array($module, 'close', 1);
/* Remove module and method. */
$params = array_slice($params, 2); // $params = array(1);
$params = array_slice($params, 2); // $params = array(1);
/* Prepend other params. */
if($methodName == 'operate') array_unshift($params, $this->rawMethod); // $params = array('close', 1);
if($methodName == 'batchOperate') array_unshift($params, $this->rawMethod); // $params = array('close', 1);
if($methodName == 'browse')
{
if(!(isset($params[0]) and $params[0] == 'bysearch')) array_unshift($params, 'browse');
}
array_unshift($params, $methodName); // $params = array('operate', 1);
array_unshift($params, $moduleName); // $params = array('flow', 'operate', 1);
array_unshift($params, $this->rawModule); // $params = array($module, 'close', 1);
array_unshift($params, $methodName); // $params = array('operate', $module, 'close', 1);
array_unshift($params, $moduleName); // $params = array('flow', 'operate', $module, 'close', 1);
$this->URI = implode($this->config->requestFix, $params); // $this->URI = flow-operate-$module-close-1.html;
$this->URI = implode($this->config->requestFix, $params); // $this->URI = flow-operate-1.html;
}
else
{
/* Extract $path and $query from $params. */
/* e.g. $tshi->URI = /index.php?m=$module&f=browse&mode=search&label=1. */
$params = parse_url($this->URI); // $params = array('path' => '/index.php', 'query' => m=$module&f=browse&mode=search&label=1;
extract($params); // $path = '/index.php'; $query = 'm=$module&f=browse&mode=search&label=1';
parse_str($query, $params); // $params = array('m' => $module, 'f' => 'browse', 'mode' = 'search', 'label' => 1);
$params = array_reverse($params); // $params = array('label' => 1, 'mode' => 'search');
if($methodName == 'operate') $params['action'] = $params[$this->config->methodVar];
if($methodName == 'batchOperate') $params['action'] = $params[$this->config->methodVar];
/* e.g. $tshi->URI = /index.php?m=$module&f=close&id=1. */
$params = parse_url($this->URI); // $params = array('path' => '/index.php', 'query' => m=$module&f=close&id=1;
extract($params); // $path = '/index.php'; $query = 'm=$module&f=close&id=1';
parse_str($query, $params); // $params = array('m' => $module, 'f' => 'close', 'id' => 1);
/* Remove module and method. */
unset($params[$this->config->moduleVar]); // $params = array('f' => 'browse', 'mode' => 'search', 'label' => 1);
unset($params[$this->config->methodVar]); // $params = array('mode' => 'search', 'label' => 1);
unset($params[$this->config->moduleVar]); // $params = array('f' => 'close', 'id' => 1);
unset($params[$this->config->methodVar]); // $params = array('id' => 1);
/* Prepend other params. */
if($methodName == 'browse')
{
if(!(isset($params['mode']) and $params['mode'] == 'bysearch')) $params['mode'] = 'browse';
}
$params = array_reverse($params); // $params = array('id' => 1);
$params['module'] = $this->rawModule; // $param = array('label' => 1, 'mode' => 'search', 'module' => $module);
$params[$this->config->methodVar] = $methodName; // $param = array('label' => 1, 'mode' => 'search', 'module' => $module, 'f' => 'browse');
$params[$this->config->moduleVar] = $moduleName; // $param = array('label' => 1, 'mode' => 'search', 'module' => $module, 'f' => 'browse', 'm' => 'flow');
$params[$this->config->methodVar] = $methodName; // $param = array('id' => 1, 'f' => 'operate');
$params[$this->config->moduleVar] = $moduleName; // $param = array('id' => 1, 'f' => 'operate', 'm' => 'flow');
$params = array_reverse($params); // $params = array('m' => 'flow', 'f' => 'browse', 'module' => $module, 'mode' => 'search', 'label' => 1);
$params = array_reverse($params); // $params = array('m' => 'flow', 'f' => 'operate', 'id' => 1);
/* Reset $_GET for setParamsByGET. */
$get = $params;
foreach($_GET as $key => $value)
{
if(!isset($get[$key])) $get[$key] = $value;
}
$_GET = $get;
$this->URI = $path . '?' . http_build_query($params); // $this->URI = '/index.php?m=flow&f=browse&module=$module&mode=search&label=1';
$this->URI = $path . '?' . http_build_query($params); // $this->URI = '/index.php?m=flow&f=operate&id=1';
}
}
@@ -632,20 +606,6 @@ class router extends baseRouter
{
if(isset($_GET['project'])) $this->session->set('project', $_GET['project']);
/* If the isFlow is true, reset the passed params. */
if($this->isFlow)
{
$passedParams = array_reverse($passedParams);
/* 如果请求的方法名不是browse、create、edit、view、delete、export中的任何一个,则需要添加action参数来传递请求的方法名。 */
/* If the requested method name is not any of browse, create, edit, view, delete, or export, you need to add an action parameter to pass the requested method name. */
if(isset($this->config->workflowaction->default->actions) and !in_array($this->rawMethod, $this->config->workflowaction->default->actions)) $passedParams['action'] = $this->rawMethod;
/* 添加module参数来传递请求的模块名。 */
/* Add the module parameter to pass the requested module name. */
$passedParams['module'] = $this->rawModule;
$passedParams = array_reverse($passedParams);
}
/* display参数用来标记请求是否来自禅道客户端的卡片展示页面,此处应该删掉以避免对方法调用产生影响。 */
/* The display parameter is used to mark whether the request comes from the card display page of the ZenTao client. It should be deleted here to avoid affecting the method call. */
+1 -1
View File
@@ -1196,7 +1196,7 @@ class docModel extends model
{
$libs = array();
$docLibs = array();
if($type == 'product' or $type == 'extension')
if($type == 'product' or $type == 'execution')
{
$nonzeroLibs = array();
if(strpos($this->config->doc->custom->showLibs, 'zero') === false)
+4 -101
View File
@@ -194,7 +194,6 @@ class gitModel extends model
$commits += count($logs);
}
}
}
$this->repo->updateCommitCount($repo->id, $commits);
@@ -296,6 +295,8 @@ class gitModel extends model
*/
public function getRepoTags($repo)
{
if(empty($repo->client) or empty($repo->path) or !isset($repo->account) or !isset($repo->password) or !isset($repo->encoding)) return false;
$scm = $this->app->loadClass('scm');
$scm->setEngine($repo);
return $scm->tags('');
@@ -311,6 +312,8 @@ class gitModel extends model
*/
public function getRepoLogs($repo, $fromRevision)
{
if(empty($repo->client) or empty($repo->path) or !isset($repo->account) or !isset($repo->password) or !isset($repo->encoding)) return false;
$scm = $this->app->loadClass('scm');
$scm->setEngine($repo);
$logs = $scm->log('', $fromRevision);
@@ -371,106 +374,6 @@ class gitModel extends model
return $parsedLog;
}
/**
* Diff a url.
*
* @param string $path
* @param int $revision
* @access public
* @return string|bool
*/
public function diff($path, $revision)
{
$repo = $this->getRepoByURL($path);
if(!$repo) return false;
$this->setClient($repo);
if(empty($this->client)) return false;
putenv('LC_CTYPE=en_US.UTF-8');
chdir($repo->path);
exec("{$this->client} config core.quotepath false");
$subPath = substr($path, strlen($repo->path));
if($subPath[0] == '/' or $subPath[0] == '\\') $subPath = substr($subPath, 1);
$encodings = explode(',', $this->config->git->encodings);
foreach($encodings as $encoding)
{
$encoding = trim($encoding);
if($encoding == 'utf-8') continue;
$subPath = helper::convertEncoding($subPath, 'utf-8', $encoding);
if($subPath) break;
}
exec("$this->client rev-list -n 2 $revision -- $subPath", $lists);
if(count($lists) == 2) list($nowRevision, $preRevision) = $lists;
$cmd = "$this->client diff $preRevision $nowRevision -- $subPath 2>&1";
$diff = `$cmd`;
$encoding = isset($repo->encoding) ? $repo->encoding : 'utf-8';
if($encoding and $encoding != 'utf-8') $diff = helper::convertEncoding($diff, $encoding);
return $diff;
}
/**
* Cat a url.
*
* @param string $path
* @param int $revision
* @access public
* @return string|bool
*/
public function cat($path, $revision)
{
$repo = $this->getRepoByURL($path);
if(!$repo) return false;
$this->setClient($repo);
if(empty($this->client)) return false;
putenv('LC_CTYPE=en_US.UTF-8');
$subPath = substr($path, strlen($repo->path));
if($subPath[0] == '/' or $subPath[0] == '\\') $subPath = substr($subPath, 1);
$encodings = explode(',', $this->config->git->encodings);
foreach($encodings as $encoding)
{
$encoding = trim($encoding);
if($encoding == 'utf-8') continue;
$subPath = helper::convertEncoding($subPath, 'utf-8', $encoding);
if($subPath) break;
}
chdir($repo->path);
exec("{$this->client} config core.quotepath false");
$cmd = "$this->client show $revision:$subPath 2>&1";
$code = `$cmd`;
$encoding = isset($repo->encoding) ? $repo->encoding : 'utf-8';
if($encoding and $encoding != 'utf-8') $code = helper::convertEncoding($code, $encoding);
return $code;
}
/**
* Get repo by url.
*
* @param string $url
* @access public
* @return object|bool
*/
public function getRepoByURL($url)
{
foreach($this->config->git->repos as $repo)
{
if(empty($repo['path'])) continue;
if(strpos($url, $repo['path']) !== false) return (object)$repo;
}
return false;
}
/**
* Pring log.
*
+8 -3
View File
@@ -74,6 +74,8 @@ class holidayModel extends model
->batchCheck($this->config->holiday->require->create, 'notempty')
->check('end', 'ge', $holiday->begin)
->exec();
$lastInsertID = $this->dao->lastInsertID();
if(dao::isError()) return false;
$beginDate = $this->post->begin;
@@ -87,7 +89,7 @@ class holidayModel extends model
$this->updateTaskPlanDuration($beginDate, $endDate);
$this->updateTaskRealDuration($beginDate, $endDate);
return $this->dao->lastInsertID();
return $lastInsertID;
}
/**
@@ -172,13 +174,16 @@ class holidayModel extends model
->andWhere('end')->ge($begin)
->fetchAll('id');
$naturalDays = $this->getDaysBetween($begin, $end);
$workingDays = array();
foreach($records as $record)
{
$dates = $this->getDaysBetween($record->begin, $record->end);
$dates = $this->getDaysBetween($record->begin, $record->end);
$workingDays = array_merge($workingDays, $dates);
}
return $workingDays;
return array_intersect($naturalDays, $workingDays);
}
/**
+1 -1
View File
@@ -486,7 +486,7 @@ class jobModel extends model
}
/**
* Exec jenkins pipeline.
* Exec jenkins pipeline.
*
* @param object $job
* @param object $repo
+7 -2
View File
@@ -77,8 +77,7 @@ class settingModel extends model
$item->section = $section;
$item->key = $key;
$item->value = $value;
if($vision) $item->vision = $vision;
$item->vision = empty($vision) ? '' : $vision;
$this->dao->replace(TABLE_CONFIG)->data($item)->exec();
}
@@ -164,6 +163,12 @@ class settingModel extends model
*/
public function createDAO($params, $method = 'select')
{
$params['vision'] = isset($params['vision']) ? $params['vision'] : '';
$params['owner'] = isset($params['owner']) ? $params['owner'] : '';
$params['module'] = isset($params['module']) ? $params['module'] : '';
$params['section'] = isset($params['section']) ? $params['section'] : '';
$params['key'] = isset($params['key']) ? $params['key'] : '';
return $this->dao->$method('*')->from(TABLE_CONFIG)->where('1 = 1')
->beginIF($params['vision'])->andWhere('vision')->in($params['vision'])->fi()
->beginIF($params['owner'])->andWhere('owner')->in($params['owner'])->fi()
+2
View File
@@ -15,6 +15,7 @@ $config->upgrade->maxVersion['max2_7'] = '16_3';
$config->upgrade->maxVersion['max2_8'] = '16_4';
$config->upgrade->maxVersion['max3_0_beta1'] = '16_5_beta1';
$config->upgrade->maxVersion['max3_0'] = '16_5';
$config->upgrade->maxVersion['max3_1_beta1'] = '17_0_beta1';
$config->upgrade->bizVersion = array();
$config->upgrade->bizVersion['biz1_0'] = '9_5_1';
@@ -68,6 +69,7 @@ $config->upgrade->bizVersion['biz6_3'] = '16_3';
$config->upgrade->bizVersion['biz6_4'] = '16_4';
$config->upgrade->bizVersion['biz6_5_beta1'] = '16_5_beta1';
$config->upgrade->bizVersion['biz6_5'] = '16_5';
$config->upgrade->bizVersion['biz7_0_beta1'] = '17_0_beta1';
$config->upgrade->proVersion = array();
$config->upgrade->proVersion['pro1_0'] = '3_1';
+23 -4
View File
@@ -101,7 +101,7 @@ class upgradeModel extends model
$this->saveLogs("Execute $openVersion");
$this->execSQL($this->getUpgradeFile(str_replace('_', '.', $openVersion)));
$this->executeOpen($openVersion, $fromEdition, $executedXuanxuan);
$this->executeOpen($openVersion, $fromEdition, $executedXuanxuan, $fromVersion);
/* Execute pro. */
foreach($chargedVersions['pro'] as $proVersion)
@@ -147,10 +147,11 @@ class upgradeModel extends model
* @param string $openVersion
* @param string $fromEdition
* @param bool $executedXuanxuan
* @param string $fromVersion
* @access public
* @return void
*/
public function executeOpen($openVersion, $fromEdition, $executedXuanxuan)
public function executeOpen($openVersion, $fromEdition, $executedXuanxuan, $fromVersion)
{
switch($openVersion)
{
@@ -497,7 +498,7 @@ class upgradeModel extends model
break;
case '16_5':
$this->updateProjectStatus();
$this->updateStoryReviewer();
$this->updateStoryReviewer($fromVersion);
break;
}
@@ -6174,11 +6175,29 @@ class upgradeModel extends model
/**
* Update the story reviewer when 12 version to 15.
*
* @param string $fromVersion
* @access public
* @return void
*/
public function updateStoryReviewer()
public function updateStoryReviewer($fromVersion)
{
$isOldVersion = false;
$fromVersion = str_replace('_', '.', $fromVersion);
if(is_numeric($fromVersion[0]) and version_compare($fromVersion, '12.5.3', '<='))
{
$isOldVersion = true;
}
elseif($fromVersion[0] == 'p' and version_compare($fromVersion, 'pro9.0.3', '<='))
{
$isOldVersion = true;
}
elseif($fromVersion[0] == 'b' and version_compare($fromVersion, 'biz4.1.3', '<='))
{
$isOldVersion = true;
}
if(!$isOldVersion) return;
$stories = $this->dao->select('t1.*,t2.PO,t2.createdBy')->from(TABLE_STORY)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.deleted')->eq('0')
+1 -1
View File
@@ -343,7 +343,7 @@ class weeklyModel extends model
$monday = $this->getThisMonday($date);
$nextMonday = date('Y-m-d', strtotime("$monday +7 days"));
$executions = $this->loadModel('execution')->getList($status = 'all', $limit = 0, $productID = 0, $branch = 0, $project);
$executions = $this->loadModel('execution')->getList($project);
$executionIdList = array_keys($executions);
return $this->dao->select('*')
+1 -1
View File
@@ -129,4 +129,4 @@ r($admin->put($modifyBug2)) && c(200) && p($fields) && e('Bug3');
/* Test delete*/
r($admin->delete($bug->id)) && c(201) && p() && e('');
r($admin->get($bug->id)) && c(200) && p('bug:deleted') && e('true');
r($admin->get($bug->id)) && c(200) && p('bug:deleted') && e('true');
+551
View File
@@ -0,0 +1,551 @@
<?php
class blockTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('block');
}
public function saveTest($id, $source, $type, $module = 'my')
{
$objects = $this->objectModel->save($id, $source, $type, $module = 'my');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get block by ID.
*
* @param int $blockID
* @access public
* @return void
*/
public function getByIDTest($blockID)
{
$objects = $this->objectModel->getByID($blockID);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get saved block config.
*
* @param int $id
* @access public
* @return object
*/
public function getBlockTest($id)
{
$objects = $this->objectModel->getBlock($id);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get last key.
*
* @param string $appName
* @access public
* @return int
*/
public function getLastKeyTest($module = 'my')
{
$objects = $this->objectModel->getLastKey($module);
$objects[$module] = $objects;
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get block list for account.
*
* @param string $appName
* @access public
* @return void
*/
public function getBlockListTest($module = 'my', $type = '')
{
$objects = $this->objectModel->getBlockList($module, $type);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get hidden blocks
*
* @access public
* @return array
*/
public function getHiddenBlocksTest($module = 'my')
{
$objects = $this->objectModel->getHiddenBlocks($module);
if(dao::isError()) return dao::getError();
if(empty($objects))
{
$objects['code'] = 'fail';
$objects['message'] = '未获取到隐藏的区块';
}
return $objects;
}
public function getWelcomeBlockDataTest()
{
$objects = $this->objectModel->getWelcomeBlockData();
if(dao::isError()) return dao::getError();
return $objects;
}
public function initBlockTest($module, $type = '')
{
$objects = $this->objectModel->initBlock($module, $type = '');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get block list.
*
* @param string $module
* @param string $dashboard
* @param object $model
*
* @access public
* @return string
*/
public function getAvailableBlocksTest($module = '', $dashboard = '', $model = '')
{
$objects = json_decode($this->objectModel->getAvailableBlocks($module, $dashboard, $model));
if(dao::isError()) return dao::getError();
return $objects;
}
public function getListParamsTest($module = '')
{
$objects = json_decode($this->objectModel->getListParams($module));
if(dao::isError()) return dao::getError();
return $objects;
}
public function getTodoParamsTest($module = '')
{
$objects = $this->objectModel->getTodoParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getTaskParamsTest($module = '')
{
$objects = $this->objectModel->getTaskParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get Bug Params.
*
* @access public
* @return json
*/
public function getBugParamsTest($module = '')
{
$objects = json_decode($this->objectModel->getBugParams($module));
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get case params.
*
* @access public
* @return json
*/
public function getCaseParamsTest($module = '')
{
$objects = json_decode($this->objectModel->getCaseParams($module));
if(dao::isError()) return dao::getError();
return $objects;
}
public function getTesttaskParamsTest($module = '')
{
$objects = $this->objectModel->getTesttaskParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getStoryParamsTest($module = '')
{
$objects = $this->objectModel->getStoryParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getPlanParamsTest()
{
$objects = $this->objectModel->getPlanParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getReleaseParamsTest()
{
$objects = $this->objectModel->getReleaseParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getProjectParamsTest()
{
$objects = $this->objectModel->getProjectParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getProjectTeamParamsTest()
{
$objects = $this->objectModel->getProjectTeamParams();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get Build params.
*
* @access public
* @return json
*/
public function getBuildParamsTest()
{
$objects = json_decode($this->objectModel->getBuildParams());
if(dao::isError()) return dao::getError();
return $objects;
}
public function getProductParamsTest()
{
$objects = $this->objectModel->getProductParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getStatisticParamsTest($module = 'product')
{
$objects = $this->objectModel->getStatisticParams($module = 'product');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getProductStatisticParamsTest()
{
$objects = $this->objectModel->getProductStatisticParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getProjectStatisticParamsTest()
{
$objects = $this->objectModel->getProjectStatisticParams();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get execution statistic params.
*
* @access public
* @return void
*/
public function getExecutionStatisticParamsTest()
{
$objects = json_decode($this->objectModel->getExecutionStatisticParams());
if(dao::isError()) return dao::getError();
return $objects;
}
public function getQaStatisticParamsTest()
{
$objects = $this->objectModel->getQaStatisticParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getRecentProjectParamsTest()
{
$objects = $this->objectModel->getRecentProjectParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getOverviewParamsTest()
{
$objects = $this->objectModel->getOverviewParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getWaterfallReportParamsTest()
{
$objects = $this->objectModel->getWaterfallReportParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getWaterfallEstimateParamsTest()
{
$objects = $this->objectModel->getWaterfallEstimateParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getWaterfallGanttParamsTest()
{
$objects = $this->objectModel->getWaterfallGanttParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getWaterfallProgressParamsTest()
{
$objects = $this->objectModel->getWaterfallProgressParams();
if(dao::isError()) return dao::getError();
return $objects;
}
public function getWaterfallIssueParamsTest($module = '')
{
$objects = $this->objectModel->getWaterfallIssueParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getWaterfallRiskParamsTest($module = '')
{
$objects = $this->objectModel->getWaterfallRiskParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get execution params.
*
* @access public
* @return json
*/
public function getExecutionParamsTest()
{
$objects = json_decode($this->objectModel->getExecutionParams());
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get assign to me params.
*
* @access public
* @return json
*/
public function getAssignToMeParamsTest()
{
$objects = json_decode($this->objectModel->getAssignToMeParams());
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get closed block pairs.
*
* @param string $closedBlock
* @access public
* @return array
*/
public function getClosedBlockPairsTest($closedBlock)
{
$objects = $this->objectModel->getClosedBlockPairs($closedBlock);
if(dao::isError()) return dao::getError();
if(empty($objects))
{
$objects['code'] = 'fail';
$objects['message'] = '未获取到关闭的区域';
}
return $objects;
}
public function appendCountParamsTest($params = '')
{
$objects = $this->objectModel->appendCountParams($params = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function isLongBlockTest($block)
{
$objects = $this->objectModel->isLongBlock($block);
if(dao::isError()) return dao::getError();
return $objects;
}
public function checkAPITest($hash)
{
$objects = $this->objectModel->checkAPI($hash);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getScrumTestParamsTest($module = '')
{
$objects = $this->objectModel->getScrumTestParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getScrumListParamsTest($module = '')
{
$objects = $this->objectModel->getScrumListParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getScrumOverviewParamsTest($module = '')
{
$objects = $this->objectModel->getScrumOverviewParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getScrumRoadMapParamsTest($module = '')
{
$objects = $this->objectModel->getScrumRoadMapParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getScrumProductParamsTest($module = '')
{
$objects = $this->objectModel->getScrumProductParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getProjectDynamicParamsTest($module = '')
{
$objects = $this->objectModel->getProjectDynamicParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getSprintParamsTest($module = '')
{
$objects = $this->objectModel->getSprintParams($module = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function getStorysEstimateHoursTest($storyID)
{
$objects = $this->objectModel->getStorysEstimateHours($storyID);
if(dao::isError()) return dao::getError();
return $objects;
}
}
+118
View File
@@ -0,0 +1,118 @@
<?php
class ciTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('ci');
}
/**
* Set menu.
*
* @access public
* @return array
*/
public function setMenuTest()
{
$_SESSION['repoID'] = 1;
$this->objectModel->setMenu();
global $lang;
return $lang->devops->menu->code;
}
public function getCompileByID($compileID)
{
global $tester;
return $tester->dao->select('compile.*, job.engine,job.pipeline, pipeline.name as jenkinsName,job.server,pipeline.url,pipeline.account,pipeline.token,pipeline.password')
->from(TABLE_COMPILE)->alias('compile')
->leftJoin(TABLE_JOB)->alias('job')->on('compile.job=job.id')
->leftJoin(TABLE_PIPELINE)->alias('pipeline')->on('job.server=pipeline.id')
->where('compile.id')->eq($compileID)
->fetch();
}
/**
* Sync compile status.
*
* @param int $jobID
* @access public
* @return string|object
*/
public function syncCompileStatusTest($jobID)
{
global $tester;
$tester->loadModel('job')->exec($jobID);
$compileID = $tester->dao->select('id')->from(TABLE_COMPILE)->orderBy('id_desc')->fetch('id');
$notCompileMR = $tester->dao->select('id,jobID')
->from(TABLE_MR)
->where('jobID')->gt(0)
->andWhere('compileStatus')->eq('created')
->fetchPairs();
$compile = $this->getCompileByID($compileID);
$this->objectModel->syncCompileStatus($compile, $notCompileMR);
$compile = $tester->loadModel('compile')->getByID($compileID);
if(dao::isError()) return dao::getError();
return $compile;
}
/**
* Sync gitlab task status.
*
* @param int $jobID
* @access public
* @return string|bool
*/
public function syncGitlabTaskStatusTest($jobID)
{
global $tester;
$tester->loadModel('job')->exec($jobID);
$compileID = $tester->dao->select('id')->from(TABLE_COMPILE)->orderBy('id_desc')->fetch('id');
$compile = $this->getCompileByID($compileID);
$this->objectModel->syncGitlabTaskStatus($compile);
if(dao::isError()) return dao::getError();
return true;
}
/**
* Update build status.
*
* @param int $compileID
* @param string $status
* @access public
* @return string|object
*/
public function updateBuildStatusTest($compileID, $status)
{
$compile = $this->getCompileByID($compileID);
$this->objectModel->updateBuildStatus($compile, $status);
if(dao::isError()) return dao::getError();
global $tester;
$compile = $tester->loadModel('compile')->getByID($compileID);
return $compile;
}
/**
* Send request.
*
* @param string $url
* @param array $data
* @param string $userPWD
* @access public
* @return string
*/
public function sendRequestTest($url, $data, $userPWD)
{
$return = $this->objectModel->sendRequest($url, $data, $userPWD);
return $return ? 1 : 0;
}
}
+44
View File
@@ -0,0 +1,44 @@
<?php
class datatableTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('datatable');
}
public function getFieldListTest($module, $method)
{
$module = zget($this->objectModel->config->datatable->moduleAlias, "$module-$method", $module);
$result = $this->objectModel->getFieldList($module);
return $result;
}
public function getSettingTest($module, $method)
{
$this->objectModel->app->methodName = $method;
$result = $this->objectModel->getSetting($module);
return $result;
}
public function printHeadTest($data)
{
ob_start();
$this->objectModel->printHead($data['cols'], $data['orderBy'], $data['vars'], $data['checkBox']);
$head = ob_get_clean();
$isTh = strpos($head, '<th data-flex') !== false ? true : false;
$order = $data['orderBy'] ? (strpos($head, "class='sort-") !== false ? true : false) : true;
$vars = $data['vars'] ? (strpos($head, $data['vars']) !== false ? true : false) : true;
$check = $data['checkBox'] ? (strpos($head, 'checkbox-primary') !== false ? true : false) : true;
$result = ($isTh and $order and $vars and $check) ? true : false;
return $result;
}
public function setFixedFieldWidthTest($setting)
{
$result = $this->objectModel->setFixedFieldWidth($setting);
return $result;
}
}
+574
View File
@@ -0,0 +1,574 @@
<?php
class docTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('doc');
}
/**
* Function createLib test by doc
*
* @param array $param
* @access public
* @return object
*/
public function createLibTest($param)
{
$createFields = array('type' => '', 'name' => '', 'acl' => '');
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
$objectID = $this->objectModel->createLib();
unset($_POST);
if(dao::isError()) return dao::getError();
$objects = $this->objectModel->getLibById($objectID);
return $objects;
}
/**
* Function createApiLib test by doc
*
* @param array $param
* @access public
* @return object
*/
public function createApiLibTest($param)
{
global $tester;
$tester->app->loadConfig('api');
$tester->app->loadLang('doclib');
$createFields = array('name' => '', 'baseUrl' => '', 'acl' => '', 'desc' => '测试详情');
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
$objectID = $this->objectModel->createApiLib();
unset($_POST);
if(dao::isError()) return dao::getError();
$objects = $this->objectModel->getLibById($objectID);
return $objects;
}
/**
* Function updateApiLib test by doc
*
* @param int $id
* @param array $param
* @access public
* @return void
*/
public function updateApiLibTest($id, $param)
{
global $tester;
$tester->app->loadConfig('api');
$tester->app->loadLang('doclib');
$oldDoc = $this->objectModel->getLibById($id);
$data = new stdClass;
foreach($param as $key => $value) $data->$key = $value;
$objects = $this->objectModel->updateApiLib($id, $oldDoc, $data);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Function updateLib test by doc
*
* @param int $libID
* @param array $param
* @access public
* @return array
*/
public function updateLibTest($libID, $param)
{
global $tester;
$tester->app->loadConfig('doc');
foreach($param as $key => $value) $_POST[$key] = $value;
$objects = $this->objectModel->updateLib($libID);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Function getDocsByBrowseType test by doc
*
* @param string $browseType
* @param array $moduleID
* @param string $sort
* @param mixed $pager
* @access public
* @return array
*/
public function getDocsByBrowseTypeTest($browseType, $moduleID, $sort = 'id_desc', $pager = null)
{
global $tester;
$tester->app->loadConfig('doc');
$objects = $this->objectModel->getDocsByBrowseType($browseType, $queryID = '', $moduleID, $sort, $pager);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Function create test by doc
*
* @param array $param
* @access public
* @return array
*/
public function createTest($param)
{
global $tester;
$tester->app->loadConfig('api');
$tester->app->loadLang('doclib');
$labels = array();
$files = array();
$createFields = array('lib' => '', 'module' => '', 'title' => '', 'keywords' => '', 'type' => '', 'content' => '', 'contentMarkdown' => '', 'contentType' => '',
'url' => '', 'labels' => $labels, 'files' => $files, 'contactListMenu' => '', 'acl' => '');
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
$this->objectModel->create();
if(dao::isError()) return dao::getError();
$objects = $tester->dao->select('*')->from(TABLE_DOC)->where('title')->eq($_POST['title'])->andwhere('lib')->eq($_POST['lib'])->fetchAll();
unset($_POST);
return $objects;
}
/**
* Function update test by doc
*
* @param int $docID
* @param array $param
* @access public
* @return array
*/
public function updateTest($docID, $param)
{
global $tester;
$tester->app->loadConfig('api');
$tester->app->loadLang('doclib');
$labels = array();
$files = array();
$createFields = array('lib' => '', 'module' => '', 'title' => '', 'keywords' => '', 'type' => '', 'content' => '', 'contentType' => '',
'url' => '', 'labels' => $labels, 'files' => $files, 'contactListMenu' => '', 'acl' => '');
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
$objects = $this->objectModel->update($docID);
if(dao::isError()) return dao::getError();
return $objects["changes"];
}
/**
* Function saveDraft test by doc
*
* @param mixed $docID
* @param array $param
* @access public
* @return void
*/
public function saveDraftTest($docID, $param = array())
{
global $tester;
$tester->app->loadConfig('doc');
$tester->app->loadConfig('allowedTags');
$createFields = array('content' => '');
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
$this->objectModel->saveDraft($docID);
if(dao::isError()) return dao::getError();
$objects = $tester->dao->select('id,draft')->from(TABLE_DOC)->where('id')->eq($docID)->fetchAll('id');
unset($_POST);
return $objects;
}
/**
* Function getAllLibsByType test by doc
*
* @param mixed $type
* @param mixed $product
* @param mixed $pager
* @access public
* @return void
*/
public function getAllLibsByTypeTest($type, $product, $pager = null)
{
$objects = $this->objectModel->getAllLibsByType($type, $pager, $product);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test stat module and document counts of lib.
*
* @param array $idList
* @access public
* @return array
*/
public function statLibCountsTest($idList)
{
$objects = $this->objectModel->statLibCounts($idList);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get lib files.
*
* @param string $type
* @param int $objectID
* @param string $orderBy
* @param object $pager
* @access public
* @return string
*/
public function getLibFilesTest($type, $objectID, $orderBy, $pager = null)
{
$objects = $this->objectModel->getLibFiles($type, $objectID, $orderBy, $pager = null);
if(dao::isError()) return dao::getError();
$titles = '';
foreach($objects as $object)
{
$titles .= "$object->title,";
}
$titles = trim($titles, ',');
return $titles;
}
/**
* Test get file source pairs.
*
* @param array $files
* @access public
* @return void
*/
public function getFileSourcePairsTest($type, $objectID)
{
$files = $this->objectModel->getLibFiles($type, $objectID, 't1.id_desc', $pager = null);
$objects = $this->objectModel->getFileSourcePairs($files);
if(dao::isError()) return dao::getError();
$counts = '';
foreach($objects as $type => $items)
{
$counts .= "$type:" . count($items) .';';
}
return $counts;
}
/**
* Test get file icon.
*
* @param string $type
* @param int $objectID
* @access public
* @return string
*/
public function getFileIconTest($type, $objectID)
{
$files = $this->objectModel->getLibFiles($type, $objectID, 't1.id_desc', $pager = null);
$objects = $this->objectModel->getFileIcon($files);
if(dao::isError()) return dao::getError();
$icons = '';
foreach($objects as $object)
{
preg_match("/icon-[^']*/", $object, $matches);
$icons .= "$matches[0] ";
}
$icons = trim($icons);
return $icons;
}
/**
* Test get doc tree.
*
* @param int $libID
* @access public
* @return string
*/
public function getDocTreeTest($libID)
{
$objects = $this->objectModel->getDocTree($libID);
if(dao::isError()) return dao::getError();
$names = '';
foreach($objects as $object)
{
$names .= "$object->name:";
foreach($object->children as $children) $names .= (isset($children->name) ? $children->name : $children->title) . ",";
$names = trim($names, ',');
$names .= ";";
}
return $names;
}
/**
* Test fill docs in tree.
*
* @param object $node
* @param int $libID
* @access public
* @return object
*/
public function fillDocsInTreeTest($node, $libID)
{
$object = $this->objectModel->fillDocsInTree($node, $libID);
if(dao::isError()) return dao::getError();
$docsCounts = "$object->name:$object->docsCount;";
foreach($object->children as $children)
{
if(isset($children->type) and $children->type == 'doc') continue;
$docsCounts .= "$children->name:$children->docsCount;";
}
return $docsCounts;
}
public function getProductCrumbTest($productID, $executionID = 0)
{
$objects = $this->objectModel->getProductCrumb($productID, $executionID = 0);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test set lib users.
*
* @param string $type
* @param int $objectID
* @access public
* @return array
*/
public function setLibUsersTest($type, $objectID)
{
$objects = $this->objectModel->setLibUsers($type, $objectID);
if(dao::isError()) return dao::getError();
return implode($objects, ',');
}
public function getLibIdListByProjectTest($projectID = 0)
{
$objects = $this->objectModel->getLibIdListByProject($projectID);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get statistic information.
*
* @access public
* @return object
*/
public function getStatisticInfoTest()
{
$objects = $this->objectModel->getStatisticInfo();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get the previous and next doc.
*
* @param int $docID
* @param int $libID
* @access public
* @return object
*/
public function getPreAndNextDocTest($docID, $libID)
{
$objects = $this->objectModel->getPreAndNextDoc($docID, $libID);
if(dao::isError()) return dao::getError();
return $objects;
}
public function printChildModuleTest($module, $libID, $methodName, $browseType, $moduleID)
{
$objects = $this->objectModel->printChildModule($module, $libID, $methodName, $browseType, $moduleID);
if(dao::isError()) return dao::getError();
return $objects;
}
public function buildCrumbTitleTest($libID = 0, $param = 0, $title = '')
{
$objects = $this->objectModel->buildCrumbTitle($libID = 0, $param = 0, $title = '');
if(dao::isError()) return dao::getError();
return $objects;
}
public function buildCreateButton4DocTest($objectType, $objectID, $libID)
{
$objects = $this->objectModel->buildCreateButton4Doc($objectType, $objectID, $libID);
if(dao::isError()) return dao::getError();
return $objects;
}
public function buildCollectButton4DocTest()
{
$objects = $this->objectModel->buildCollectButton4Doc();
if(dao::isError()) return dao::getError();
return $objects;
}
public function buildBrowseSwitchTest($type, $objectID, $viewType)
{
$objects = $this->objectModel->buildBrowseSwitch($type, $objectID, $viewType);
if(dao::isError()) return dao::getError();
return $objects;
}
public function setFastMenuTest($fastLib)
{
$objects = $this->objectModel->setFastMenu($fastLib);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get toList and ccList.
*
* @param int $docID
* @access public
* @return bool|array
*/
public function getToAndCcListTest($docID)
{
$doc = $this->objectModel->getByID($docID);
$objects = $this->objectModel->getToAndCcList($doc);
if(dao::isError()) return dao::getError();
return $objects;
}
public function selectTest($type, $objects, $objectID, $libs, $libID = 0)
{
$objects = $this->objectModel->select($type, $objects, $objectID, $libs, $libID = 0);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getApiModuleTreeTest($rootID, $docID = 0, $release = 0)
{
$objects = $this->objectModel->getApiModuleTree($rootID, $docID = 0, $release = 0);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getTreeMenuTest($type, $objectID, $rootID, $startModule = 0, $docID = 0)
{
$objects = $this->objectModel->getTreeMenu($type, $objectID, $rootID, $startModule = 0, $docID = 0);
if(dao::isError()) return dao::getError();
return $objects;
}
public function summaryTest($files)
{
$objects = $this->objectModel->summary($files);
if(dao::isError()) return dao::getError();
return $objects;
}
public function setMenuByTypeTest($type, $objectID, $libID, $appendLib = 0)
{
$objects = $this->objectModel->setMenuByType($type, $objectID, $libID, $appendLib = 0);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Whether the url of link type documents needs to be autoloaded.
*
* @param int $docID
* @access public
* @return bool
*/
public function checkAutoloadPageTest($docID)
{
$doc = $this->objectModel->getByID($docID);
$objects = $this->objectModel->checkAutoloadPage($doc);
if(dao::isError()) return dao::getError();
return $objects;
}
}
+192
View File
@@ -0,0 +1,192 @@
<?php
class entryTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('entry');
}
/**
* Test get entry by id.
*
* @param int $entryID
* @access public
* @return object
*/
public function getByIdTest($entryID)
{
$object = $this->objectModel->getById($entryID);
if(dao::isError()) return dao::getError();
return $object;
}
/**
* Test get entry by code.
*
* @param int $code
* @access public
* @return object
*/
public function getByCodeTest($code)
{
$object = $this->objectModel->getByCode($code);
if(dao::isError()) return dao::getError();
return $object;
}
/**
* Test get entry by key.
*
* @param int $key
* @access public
* @return object
*/
public function getByKeyTest($key)
{
$object = $this->objectModel->getByKey($key);
if(dao::isError()) return dao::getError();
return $object;
}
/**
* Get list test.
*
* @param string $orderBy
* @param int $pager
* @access public
* @return object
*/
public function getListTest($orderBy = 'id_desc', $pager = null)
{
$objects = $this->objectModel->getList($orderBy, $pager);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get logs test.
*
* @param int $id
* @param string $orderBy
* @param int $pager
* @access public
* @return object
*/
public function getLogsTest($id, $orderBy = 'date_desc', $pager = null)
{
$object = $this->objectModel->getLogs($id, $orderBy, $paper);
if(dao::isError()) return dao::getError();
return $object;
}
/**
* Test create a object.
*
* @param array $params
* @access public
* @return object
*/
public function createObject($params = array())
{
$createFields = array();
$createFields['name'] = '这是应用名称';
$createFields['code'] = 'code';
$createFields['account'] = 'admin';
$createFields['key'] = md5(time());
foreach($createFields as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($params as $key => $value) $_POST[$key] = $value;
$objectID = $this->objectModel->create();
unset($_POST);
if(dao::isError()) return dao::getError();
$object = $this->objectModel->getById($objectID);
return $object;
}
/**
* Test update a entry.
*
* @param int $entryID
* @param int $params
* @access public
* @return object
*/
public function updateObject($entryID, $params)
{
global $tester;
$object = $tester->dbh->query("SELECT * FROM " . TABLE_ENTRY ." WHERE id = $entryID")->fetch();
foreach($object as $field => $value)
{
if(in_array($field, array_keys($params)))
{
$_POST[$field] = $params[$field];
}
else
{
$_POST[$field] = $value;
}
}
$change = $this->objectModel->update($entryID);
if($change == array()) $change = '没有数据更新';
unset($_POST);
if(dao::isError()) return dao::getError();
return $change;
}
/**
* Test update calledTime.
*
* @param int $code
* @param int $time
* @access public
* @return object
*/
public function updateCalledTimeTest($code, $time)
{
$this->objectModel->updateCalledTime($code, $time);
if(dao::isError()) return dao::getError();
$object = $this->objectModel->getByCode($code);
return $object;
}
/**
* Test save a log.
*
* @param int $entryID
* @param int $url
* @access public
* @return object
*/
public function saveLogTest($entryID, $url)
{
$this->objectModel->saveLog($entryID, $url);
if(dao::isError()) return dao::getError();
global $tester;
$object = $tester->dbh->query("SELECT * FROM " . TABLE_LOG ." WHERE objectID = $entryID AND objectType = 'entry'")->fetch();
return $object;
}
}
+314
View File
@@ -0,0 +1,314 @@
<?php
class fileTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('file');
}
/**
* Test get files of an object.
*
* @param string $objectType
* @param int $objectID
* @param string $extra
* @access public
* @return array
*/
public function getByObjectTest($objectType, $objectID, $extra = '')
{
$objects = $this->objectModel->getByObject($objectType, $objectID, $extra = '');
foreach($objects as $object)
{
if(isset($object->webPath)) $object->webPath = substr($object->webPath, strpos($object->webPath, '/data/upload'));
}
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get info of a file.
*
* @param int $fileID
* @access public
* @return object
*/
public function getByIdTest($fileID)
{
$object = $this->objectModel->getById($fileID);
if(isset($object->webPath)) $object->webPath = substr($object->webPath, strpos($object->webPath, '/data/upload'));
if(dao::isError()) return dao::getError();
return $object;
}
/**
* Test get counts of uploaded files.
*
* @param array $files
* @param array $labels
* @access public
* @return int
*/
public function getCountTest($files, $labels)
{
$_FILES['files'] = $files;
$_POST['labels'] = $labels;
$count = $this->objectModel->getCount();
unset($_FILES['files']);
unset($_POST['labels']);
if(dao::isError()) return dao::getError();
return $count;
}
/**
* Test get info of uploaded files.
*
* @param array $files
* @param array $labels
* @access public
* @return array
*/
public function getUploadTest($files, $labels)
{
$_FILES['files'] = $files;
$_POST['labels'] = $labels;
$objects = $this->objectModel->getUpload($htmlTagName = 'files', $labelsName = 'labels');
unset($_FILES['files']);
unset($_POST['labels']);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get uploaded file from zui.uploader.
*
* @param array $image
* @param array $files
* @access public
* @return object
*/
public function getUploadFileTest($image, $files)
{
$_FILES['file'] = $files;
foreach($image as $key => $value) $_POST[$key] = $value;
$object = $this->objectModel->getUploadFile($htmlTagName = 'file');
unset($_POST);
unset($_FILES['file']);
if(dao::isError()) return dao::getError();
return $object;
}
/**
* Test get extension of a file.
*
* @param string $filename
* @access public
* @return string
*/
public function getExtensionTest($filename)
{
$string = $this->objectModel->getExtension($filename);
if(dao::isError()) return dao::getError();
return $string;
}
/**
* Test get save name.
*
* @param string $pathName
* @access public
* @return string
*/
public function getSaveNameTest($pathName)
{
$objects = $this->objectModel->getSaveName($pathName);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get real path name.
*
* @param string $pathName
* @access public
* @return string
*/
public function getRealPathNameTest($pathName)
{
$realpath = $this->objectModel->getRealPathName($pathName);
if(dao::isError()) return dao::getError();
return $realpath;
}
/**
* Test get export tpl.
*
* @param string $module
* @access public
* @return array
*/
public function getExportTemplateTest($module)
{
$objects = $this->objectModel->getExportTemplate($module);
if(dao::isError()) return dao::getError();
return count($objects);
}
/**
* Test get tmp import path.
*
* @access public
* @return string
*/
public function getPathOfImportedFileTest()
{
$path = $this->objectModel->getPathOfImportedFile();
$path = substr($path, strpos($path, 'tmp'));
if(dao::isError()) return dao::getError();
return $path;
}
/**
* Test save export template.
*
* @param string $module
* @access public
* @return object
*/
public function saveExportTemplateTest($module, $file)
{
foreach($file as $key => $value) $_POST[$key] = $value;
$objectID = $this->objectModel->saveExportTemplate($module);
unset($_POST);
if(dao::isError()) return dao::getError()['title'][0];
global $tester;
$object = $tester->dao->select('*')->from(TABLE_USERTPL)->where('id')->eq($objectID)->fetch();
return $object;
}
/**
* Test set save path.
*
* @access public
* @return string
*/
public function setSavePathTest()
{
$this->objectModel->setSavePath();
if(dao::isError()) return dao::getError();
global $tester;
$path = substr($tester->file->savePath, strpos($tester->file->savePath, '/www/'));
return $path;
}
/**
* Test set the web path of upload files.
*
* @access public
* @return string
*/
public function setWebPathTest()
{
$this->objectModel->setWebPath();
if(dao::isError()) return dao::getError();
global $tester;
$path = substr($tester->file->webPath, strpos($tester->file->webPath, '/test/model/'));
return $path;
}
/**
* Test compress image.
*
* @param object $file
* @access public
* @return object
*/
public function compressImageTest($file)
{
$object = $this->objectModel->compressImage($file);
if(dao::isError()) return dao::getError();
return $object;
}
/**
* Test update objectID.
*
* @param int $uid
* @param int $objectID
* @param string $objectType
* @param array $albums
* @access public
* @return array
*/
public function updateObjectIDTest($uid, $objectID, $objectType, $albums)
{
$_SESSION['album'] = $albums;
$this->objectModel->updateObjectID($uid, $objectID, $objectType);
unset($_SESSION['album']);
global $tester;
$objects = $tester->dao->select('*')->from(TABLE_FILE)->where('id')->in($albums['used'][$uid])->fetchAll('id');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get file pairs.
*
* @param array $IDs
* @param string $value
* @access public
* @return array
*/
public function getPairsTest($IDs, $value = 'title')
{
$objects = $this->objectModel->getPairs($IDs, $value);
if(dao::isError()) return dao::getError();
return $objects;
}
}
+119
View File
@@ -0,0 +1,119 @@
<?php
class gitTest
{
public $tester;
public function __construct()
{
global $tester;
$this->tester = $tester;
$this->gitModel = $this->tester->loadModel('git');
}
/**
* Update commit.
*
* @param object $repo
* @param array $commentGroup
* @param bool $printLog
* @access public
* @return bool
*/
public function updateCommit($repo)
{
$repoID = isset($repo->id) ? $repo->id : 0;
$oldLastSync = $this->tester->dao->select('lastSync')->from(TABLE_REPO)->where('id')->eq($repoID)->fetch('lastSync');
$result = $this->gitModel->updateCommit($repo, array(), false);
if(empty($repoID)) return $result;
$newLastSync = $this->tester->dao->select('lastSync')->from(TABLE_REPO)->where('id')->eq($repoID)->fetch('lastSync');
return $oldLastSync != $newLastSync;
}
/**
* Set the repos.
*
* @access public
* @return object
*/
public function setRepos()
{
$this->gitModel->setRepos();
$repo = array_shift($this->gitModel->repos);
return $repo;
}
/**
* Get repos.
*
* @access public
* @return string
*/
public function getRepos()
{
$pairs = $this->gitModel->getRepos();
return array_shift($pairs);
}
/**
* Set repo.
*
* @param object $repo
* @access public
* @return object
*/
public function setRepo($repo)
{
$this->gitModel->client = '';
$this->gitModel->repoRoot = '';
$result = $this->gitModel->setRepo($repo);
$data = new stdclass();
$data->result = $result;
$data->client = !empty($this->gitModel->client);
$data->repoRoot = !empty($this->gitModel->repoRoot);
return $data;
}
/**
* get tags histories for repo.
*
* @param object $repo
* @access public
* @return int
*/
public function getRepoTags($repo)
{
$tags = $this->gitModel->getRepoTags($repo);
if(is_array($tags) and count($tags) >= 1) return 1;
return 0;
}
/**
* Get repo logs.
*
* @param object $repo
* @access public
* @return int
*/
public function getRepoLogs($repo)
{
$logs = $this->gitModel->getRepoLogs($repo, '');
if(is_array($logs) and count($logs) >= 1) return 1;
return 0;
}
/**
* Convert log from xml format to object.
*
* @param object $log
* @access public
* @return object
*/
public function convertLog($log)
{
$parsedLogs = $this->gitModel->convertLog($log);
if(empty($parsedLogs->revision)) $parsedLogs->revision = 0;
return $parsedLogs;
}
}
+163 -1
View File
@@ -28,6 +28,13 @@ class groupTest
return $object;
}
/**
* Update a group.
*
* @param int $groupID
* @access public
* @return void
*/
public function updateTest($groupID)
{
$objects = $this->objectModel->update($groupID);
@@ -37,6 +44,13 @@ class groupTest
return $objects;
}
/**
* Copy a group.
*
* @param int $groupID
* @access public
* @return void
*/
public function copyTest($groupID)
{
$objects = $this->objectModel->copy($groupID);
@@ -46,6 +60,14 @@ class groupTest
return $objects;
}
/**
* Copy privileges.
*
* @param string $fromGroup
* @param string $toGroup
* @access public
* @return void
*/
public function copyPrivTest($fromGroup, $toGroup)
{
$objects = $this->objectModel->copyPriv($fromGroup, $toGroup);
@@ -55,6 +77,14 @@ class groupTest
return $objects;
}
/**
* Copy user.
*
* @param string $fromGroup
* @param string $toGroup
* @access public
* @return void
*/
public function copyUserTest($fromGroup, $toGroup)
{
$objects = $this->objectModel->copyUser($fromGroup, $toGroup);
@@ -64,6 +94,13 @@ class groupTest
return $objects;
}
/**
* Get group lists.
*
* @param int $projectID
* @access public
* @return array
*/
public function getListTest($projectID = 0)
{
$objects = $this->objectModel->getList($projectID = 0);
@@ -73,6 +110,13 @@ class groupTest
return $objects;
}
/**
* Get group pairs.
*
* @param int $projectID
* @access public
* @return array
*/
public function getPairsTest($projectID = 0)
{
$objects = $this->objectModel->getPairs($projectID = 0);
@@ -82,6 +126,13 @@ class groupTest
return $objects;
}
/**
* Get group by id.
*
* @param int $groupID
* @access public
* @return object
*/
public function getByIDTest($groupID)
{
$objects = $this->objectModel->getByID($groupID);
@@ -91,6 +142,13 @@ class groupTest
return $objects;
}
/**
* Get group by account.
*
* @param string $account
* @access public
* @return array
*/
public function getByAccountTest($account)
{
$objects = $this->objectModel->getByAccount($account);
@@ -100,6 +158,13 @@ class groupTest
return $objects;
}
/**
* Get groups by accounts.
*
* @param array $accounts
* @access public
* @return array
*/
public function getByAccountsTest($accounts)
{
$objects = $this->objectModel->getByAccounts($accounts);
@@ -109,15 +174,29 @@ class groupTest
return $objects;
}
/**
* Get the account number in the group.
*
* @param array $groupIdList
* @access public
* @return array
*/
public function getGroupAccountsTest($groupIdList)
{
$objects = $this->objectModel->getGroupAccounts($groupIdList = array());
$objects = $this->objectModel->getGroupAccounts($groupIdList);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get privileges of a groups.
*
* @param int $groupID
* @access public
* @return array
*/
public function getPrivsTest($groupID)
{
$objects = $this->objectModel->getPrivs($groupID);
@@ -127,6 +206,13 @@ class groupTest
return $objects;
}
/**
* Get user pairs of a group.
*
* @param int $groupID
* @access public
* @return array
*/
public function getUserPairsTest($groupID)
{
$objects = $this->objectModel->getUserPairs($groupID);
@@ -136,6 +222,13 @@ class groupTest
return $objects;
}
/**
* Get user programs of a group.
*
* @param int $groupID
* @access public
* @return array
*/
public function getUserProgramsTest($groupID)
{
$objects = $this->objectModel->getUserPrograms($groupID);
@@ -145,6 +238,12 @@ class groupTest
return $objects;
}
/**
* Get the ID of the group that has access to the program.
*
* @access public
* @return array
*/
public function getAccessProgramGroupTest()
{
$objects = $this->objectModel->getAccessProgramGroup();
@@ -154,6 +253,14 @@ class groupTest
return $objects;
}
/**
* Delete a group.
*
* @param int $groupID
* @param null $null compatible with that of model::delete()
* @access public
* @return void
*/
public function deleteTest($groupID, $null = null)
{
$objects = $this->objectModel->delete($groupID, $null = null);
@@ -163,6 +270,13 @@ class groupTest
return $objects;
}
/**
* Update privilege of a group.
*
* @param int $groupID
* @access public
* @return bool
*/
public function updatePrivByGroupTest($groupID, $menu, $version)
{
$objects = $this->objectModel->updatePrivByGroup($groupID, $menu, $version);
@@ -172,6 +286,13 @@ class groupTest
return $objects;
}
/**
* Update view priv.
*
* @param int $groupID
* @access public
* @return bool
*/
public function updateViewTest($groupID)
{
$objects = $this->objectModel->updateView($groupID);
@@ -181,6 +302,12 @@ class groupTest
return $objects;
}
/**
* Update privilege by module.
*
* @access public
* @return void
*/
public function updatePrivByModuleTest()
{
$objects = $this->objectModel->updatePrivByModule();
@@ -190,6 +317,13 @@ class groupTest
return $objects;
}
/**
* Update users.
*
* @param int $groupID
* @access public
* @return void
*/
public function updateUserTest($groupID)
{
$objects = $this->objectModel->updateUser($groupID);
@@ -199,6 +333,13 @@ class groupTest
return $objects;
}
/**
* Update project admins.
*
* @param int $groupID
* @access public
* @return void
*/
public function updateProjectAdminTest($groupID)
{
$objects = $this->objectModel->updateProjectAdmin($groupID);
@@ -208,6 +349,12 @@ class groupTest
return $objects;
}
/**
* Sort resource.
*
* @access public
* @return void
*/
public function sortResourceTest()
{
$objects = $this->objectModel->sortResource();
@@ -217,6 +364,14 @@ class groupTest
return $objects;
}
/**
* Check menu have module
*
* @param string $menu
* @param string $moduleName
* @access public
* @return void
*/
public function checkMenuModuleTest($menu, $moduleName)
{
$objects = $this->objectModel->checkMenuModule($menu, $moduleName);
@@ -226,6 +381,13 @@ class groupTest
return $objects;
}
/**
* Get modules in menu
*
* @param string $menu
* @access public
* @return void
*/
public function getMenuModulesTest($menu)
{
$objects = $this->objectModel->getMenuModules($menu);
+320
View File
@@ -0,0 +1,320 @@
<?php
class holidayTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('holiday');
}
/**
* Test getById method.
*
* @param int $id
* @access public
* @return object
*/
public function getByIdTest($id)
{
$objects = $this->objectModel->getById($id);
if($objects === false) return 'Object not found';
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test getList method.
*
* @param string $year
* @param string $type
* @access public
* @return object
*/
public function getListTest($year = '', $type = 'all')
{
$objects = $this->objectModel->getList($year, $type);
if(dao::isError()) return dao::getError();
return count($objects);
}
/**
* Test getYearPairs method.
*
* @access public
* @return int
*/
public function getYearPairsTest()
{
$objects = $this->objectModel->getYearPairs();
if(dao::isError()) return dao::getError();
return count($objects);
}
/**
* Test create method.
*
* @param array $param
* @access public
* @return object
*/
public function createTest($param = array())
{
$defaultParam['type'] = 'holiday';
$defaultParam['begin'] = '2022-01-01';
$defaultParam['end'] = '2022-02-01';
$defaultParam['name'] = '测试创建holiday';
$defaultParam['desc'] = '默认的holiday';
foreach($defaultParam as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
$lastInsertID = $this->objectModel->create();
unset($_POST);
if(dao::isError())
{
return dao::getError();
}
else
{
$object = $this->objectModel->getByID($lastInsertID);
return $object;
}
}
/**
* Test update method.
*
* @param int $holidayID
* @param array $param
* @access public
* @return object
*/
public function updateTest($holidayID, $param = array())
{
global $tester;
$object = $tester->dbh->query("SELECT * FROM " . TABLE_HOLIDAY ." WHERE id = $holidayID")->fetch();
foreach($object as $field => $value)
{
if(in_array($field, array_keys($param)))
{
$_POST[$field] = $param[$field];
}
else
{
$_POST[$field] = $value;
}
}
$noError = $this->objectModel->update($bugID);
unset($_POST);
if(dao::isError())
{
return dao::getError();
}
else
{
return 'true';
}
}
/**
* Test getHolidays method.
*
* @param string $begin
* @param string $end
* @access public
* @return object
*/
public function getHolidaysTest($begin, $end)
{
$objects = $this->objectModel->getHolidays($begin, $end);
if(dao::isError()) return dao::getError();
return count($objects);
}
/**
* Test getWorkingDays method.
*
* @param string $begin
* @param string $end
* @access public
* @return int
*/
public function getWorkingDaysTest($begin = '', $end = '')
{
$objects = $this->objectModel->getWorkingDays($begin, $end);
if(dao::isError()) return dao::getError();
return count($objects);
}
/**
* Test getActualWorkingDays method.
*
* @param string $begin
* @param string $end
* @access public
* @return int
*/
public function getActualWorkingDaysTest($begin, $end)
{
$objects = $this->objectModel->getActualWorkingDays($begin, $end);
if(dao::isError()) return dao::getError();
return count($objects);
}
/**
* Test getDaysBetweenTest method.
*
* @param string $begin
* @param string $end
* @access public
* @return int
*/
public function getDaysBetweenTest($begin, $end)
{
$objects = $this->objectModel->getDaysBetween($begin, $end);
if(dao::isError()) return dao::getError();
return count($objects);
}
/**
* Test isHoliday method.
*
* @param string $date
* @access public
* @return object
*/
public function isHolidayTest($date)
{
$objects = $this->objectModel->isHoliday($date);
if(dao::isError()) return dao::getError();
return $objects === true ? "It is a holiday" : "It is not a holiday";
}
/**
* Test isWorkingDay method.
*
* @param string $date
* @access public
* @return object
*/
public function isWorkingDayTest($date)
{
$objects = $this->objectModel->isWorkingDay($date);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test updateProgramPlanDuration method.
*
* @param int $testProjectID
* @param object $holiday
* @access public
* @return int
*/
public function updateProgramPlanDurationTest($testProjectID, $holidayID)
{
global $tester;
$holiday = $tester->dao->select('*')->from(TABLE_HOLIDAY)->where('id')->eq($holidayID)->fetch();
$this->objectModel->updateProgramPlanDuration($holiday->begin, $holiday->end);
$project = $tester->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($testProjectID)->fetch();
if(dao::isError()) return dao::getError();
return $project->planDuration;
}
/**
* Test updateProjectRealDuration method.
*
* @param int $testProjectID
* @param object $holiday
* @access public
* @return int
*/
public function updateProjectRealDurationTest($testProjectID, $holidayID)
{
global $tester;
$holiday = $tester->dao->select('*')->from(TABLE_HOLIDAY)->where('id')->eq($holidayID)->fetch();
$this->objectModel->updateProjectRealDuration($holiday->begin, $holiday->end);
$project = $tester->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($testProjectID)->fetch();
if(dao::isError()) return dao::getError();
return $project->realDuration;
}
/**
* Test updateTaskPlanDuration method.
*
* @param int $testTaskID
* @param object $holiday
* @access public
* @return int
*/
public function updateTaskPlanDurationTest($testTaskID, $holidayID)
{
global $tester;
$holiday = $tester->dao->select('*')->from(TABLE_HOLIDAY)->where('id')->eq($holidayID)->fetch();
$this->objectModel->updateTaskPlanDuration($holiday->begin, $holiday->end);
$task = $tester->dao->select('*')->from(TABLE_TASK)->where('id')->eq($testTaskID)->fetch();
if(dao::isError()) return dao::getError();
return $task->planDuration;
}
/**
* Test updateTaskRealDuration method.
*
* @param int $testTaskID
* @param object $holiday
* @access public
* @return int
*/
public function updateTaskRealDurationTest($testTaskID, $holidayID)
{
global $tester;
$holiday = $tester->dao->select('*')->from(TABLE_HOLIDAY)->where('id')->eq($holidayID)->fetch();
$this->objectModel->updateTaskRealDuration($holiday->begin, $holiday->end);
$task = $tester->dao->select('*')->from(TABLE_TASK)->where('id')->eq($testTaskID)->fetch();
if(dao::isError()) return dao::getError();
return $task->realDuration;
}
}
+102
View File
@@ -0,0 +1,102 @@
<?php
class jenkinsTest
{
public $tester;
public function __construct()
{
global $tester;
$this->tester = $tester;
$this->jenkins = $this->tester->loadModel('jenkins');
}
/**
* Get by id.
*
* @param int $id
* @access public
* @return object
*/
public function getByID($id)
{
$jenkins = $this->jenkins->getByID($id);
if(empty($jenkins)) return 0;
return $jenkins;
}
/**
* Get jenkins list.
*
* @param string $orderBy
* @access public
* @return object
*/
public function getList($orderBy = 'id_desc')
{
$jenkins = $this->jenkins->getList($orderBy);
if(empty($jenkins)) return 0;
return array_shift($jenkins);
}
/**
* Get jenkins pairs
*
* @return string
*/
public function getPairs()
{
$pairs = $this->jenkins->getPairs();
return key($pairs);
}
/**
* Get jenkins tasks.
*
* @param int $id
* @access public
* @return array
*/
public function getTasks($id)
{
$tasks = $this->jenkins->getTasks($id);
if(empty($tasks)) return 0;
return $tasks;
}
/**
* Create a jenkins.
*
* @access public
* @return object|string
*/
public function create()
{
$jenkinsID = $this->jenkins->create();
if(dao::isError())
{
$errors = dao::getError();
return key($errors);
}
return $this->jenkins->getById($jenkinsID);
}
/**
* Update a jenkins.
*
* @param int $id
* @access public
* @return object|string
*/
public function update($id)
{
$this->jenkins->update($id);
if(dao::isError())
{
$errors = dao::getError();
return key($errors);
}
return $this->jenkins->getById($id);
}
}
+122
View File
@@ -0,0 +1,122 @@
<?php
class messageTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('message');
}
public function getMessagesTest($status)
{
$objects = $this->objectModel->getMessages($status);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get objectTypes.
*
* @access public
* @return void
*/
public function getObjectTypesTest()
{
$objects = $this->objectModel->getObjectTypes();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get object actions.
*
* @access public
* @return void
*/
public function getObjectActionsTest()
{
$objects = $this->objectModel->getObjectActions();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Check send.
*
* @param int $objectType
* @param int $objectID
* @param int $actionType
* @param int $actionID
* @param string $actor
* @access public
* @return void
*/
public function sendTest($objectType, $objectID, $actionType, $actionID, $actor = '')
{
$objects = $this->objectModel->send($objectType, $objectID, $actionType, $actionID, $actor = '');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Save notice.
*
* @param int $objectType
* @param int $objectID
* @param int $actionType
* @param int $actionID
* @param string $actor
* @access public
* @return void
*/
public function saveNoticeTest($objectType, $objectID, $actionType, $actionID, $actor = '')
{
$objects = $this->objectModel->saveNotice($objectType, $objectID, $actionType, $actionID, $actor = '');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get toList.
*
* @param int $objectType
* @access public
* @return void
*/
public function getToListTest($objectType)
{
global $tester;
$table = $tester->config->objectTables[$objectType];
$object = $tester->dao->select('*')->from($table)->where('id')->eq('1')->fetch();
$objects = $this->objectModel->getToList($object, $objectType);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get notice todos.
*
* @access public
* @return void
*/
public function getNoticeTodosTest()
{
$objects = $this->objectModel->getNoticeTodos();
if(dao::isError()) return dao::getError();
return $objects;
}
}
+126
View File
@@ -0,0 +1,126 @@
<?php
class pipelineTest
{
/**
* __construct
*
* @access public
* @return void
*/
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('pipeline');
}
/**
* Get a pipeline by id.
*
* @param int $id
* @access public
* @return object
*/
public function getByIDTest($id)
{
$objects = $this->objectModel->getByID($id);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get pipeline list.
*
* @param string $type jenkins|gitlab
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getListTest($type = 'jenkins', $orderBy = 'id_desc', $pager = null)
{
$objects = $this->objectModel->getList($type, $orderBy, $pager);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get pipeline pairs
*
* @param int $data
* @access public
* @return array
*/
public function getPairs($data)
{
$objects = $this->objectModel->getPairs($data['type']);
if(empty($objects)) return '没有获取到数据';
if(isset($data['id'])) return $objects[$data['id']];
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Create a pipeline.
*
* @param int $type
* @param int $param
* @access public
* @return void
*/
public function createTest($type, $param)
{
foreach($param as $k => $v) $_POST[$k] = $v;
$objects = $this->objectModel->create($type);
unset($_POST);
if(dao::isError()) return dao::getError();
$objects = $this->objectModel->getById($objects);
return $objects;
}
/**
* Update a pipeline.
*
* @param int $id
* @access public
* @return bool
*/
public function updateTest($id)
{
$objects = $this->objectModel->update($id);
if(dao::isError()) return dao::getError();
$objects = $this->objectModel->getByID($id);
return $objects;
}
/**
* Delete one record.
*
* @param string $id the id to be deleted
* @param string $object the action object
* @access public
* @return int
*/
public function deleteTest($id, $object = 'gitlab')
{
$objects = $this->objectModel->delete($id, $object = 'gitlab');
if(dao::isError()) return dao::getError();
$objects = $this->objectModel->getById($id);
return $objects;
}
}
+260
View File
@@ -0,0 +1,260 @@
<?php
class settingTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('setting');
}
/**
* Get value of an item.
*
* @param string $paramString see parseItemParam();
* @access public
* @return bool
*/
public function getItemTest($paramString)
{
$objects = $this->objectModel->getItem($paramString);
if(dao::isError()) return dao::getError();
if($objects or $objects === 0 or $objects === '0') return true;
return false;
}
/**
* Get some items.
*
* @param string $paramString see parseItemParam();
* @access public
* @return array|string
*/
public function getItemsTest($paramString)
{
$objects = $this->objectModel->getItems($paramString);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Set value of an item.
*
* @param string $path system.common.global.sn | system.common.sn | system.common.global.sn@rnd
* @param string $value
* @access public
* @return misc
*/
public function setItemTest($path, $value = '')
{
$this->objectModel->setItem($path, $value);
if(dao::isError()) return dao::getError();
/* Determine vision of config item. */
$pathVision = explode('@', $path);
$vision = isset($pathVision[1]) ? $pathVision[1] : '';
$path = $pathVision[0];
$level = substr_count($path, '.');
$section = '';
if($level <= 1) return false;
if($level == 2) list($owner, $module, $key) = explode('.', $path);
if($level == 3) list($owner, $module, $section, $key) = explode('.', $path);
$paramString = "vision=$vision&owner=$owner&module=$module&section=$section&key=$key";
$objects = $this->objectModel->getItem($paramString);
return $objects;
}
/**
* Batch set items, the example:
*
* $path = 'system.mail';
* $items->turnon = true;
* $items->smtp->host = 'localhost';
*
* @param string $path like system.mail
* @param array|object $items the items array or object, can be mixed by one level or two levels.
* @access public
* @return bool|string
*/
public function setItemsTest($path, $items)
{
$result = $this->objectModel->setItems($path, $items);
if(dao::isError()) return dao::getError();
return $result;
}
/**
* Delete items.
*
* @param string $paramString see parseItemParam();
* @access public
* @return misc
*/
public function deleteItemsTest($paramString)
{
$this->objectModel->deleteItems($paramString);
if(dao::isError()) return dao::getError();
$object = $this->getItemTest($paramString);
return $object;
}
/**
* Parse the param string for select or delete items.
*
* @param string $paramString owner=xxx&key=sn and so on.
* @access public
* @return array
*/
public function parseItemParamTest($paramString)
{
$objects = $this->objectModel->parseItemParam($paramString);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test create a DAO object to select or delete one or more records.
*
* @param string $paramString
* @param string $method select|delete.
* @access public
* @return array|int
*/
public function createDAOTest($paramString, $method = 'select')
{
$params = $this->objectModel->parseItemParam($paramString);
if($method == 'delete')
{
$objects = $this->objectModel->createDAO($params, $method)->exec();
}
else
{
$objects = $this->objectModel->createDAO($params, $method)->orderBy('key')->fetch();
}
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get config of system and one user.
*
* @param string $account
* @access public
* @return bool
*/
public function getSysAndPersonalConfigTest($account = '')
{
$objects = $this->objectModel->getSysAndPersonalConfig($account);
if(dao::isError()) return dao::getError();
return !empty($objects) ? true : false;
}
/**
* Test get the version of current zentaopms.
*
* Since the version field not saved in db. So if empty, return 0.3 beta.
*
* @access public
* @return void
*/
public function getVersionTest()
{
$objects = $this->objectModel->getVersion();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get URSR.
*
* @access public
* @return int
*/
public function getURSRTest()
{
$objects = $this->objectModel->getURSR();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test update version
*
* @param string $version
* @access public
* @return array
*/
public function updateVersionTest($version)
{
$this->objectModel->updateVersion($version);
if(dao::isError()) return dao::getError();
$params['owner'] = 'system';
$params['module'] = 'common';
$params['section'] = 'global';
$params['key'] = 'version';
$objects = $this->objectModel->createDAO($params)->fetchAll();
return $objects;
}
/**
* Test set the sn of current zentaopms.
*
* @access public
* @return bool
*/
public function setSNTest()
{
$this->objectModel->setSN();
if(dao::isError()) return dao::getError();
$params['owner'] = 'system';
$params['module'] = 'common';
$params['section'] = 'global';
$params['key'] = 'sn';
$objects = $this->objectModel->createDAO($params)->fetchAll();
return !empty($objects) ? true : false;
}
/**
* Test judge a sn needed update or not.
*
* @param string $sn
* @access public
* @return bool
*/
public function snNeededUpdateTest($sn)
{
$objects = $this->objectModel->snNeededUpdate($sn);
if(dao::isError()) return dao::getError();
return $objects;
}
}
+29
View File
@@ -0,0 +1,29 @@
<?php
class ssoTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('sso');
}
/**
* Test create a user.
*
* @param array $param
* @access public
* @return void
*/
public function createTest($param = array())
{
foreach($param as $key => $value) $_POST[$key] = $value;
$result = $this->objectModel->createUser();
unset($_POST);
if($result['status'] == 'fail') return 'fail';
$object = $this->objectModel->getBindUser($param['account']);
return $object;
}
}
+281
View File
@@ -0,0 +1,281 @@
<?php
class tutorialTest
{
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('tutorial');
}
/**
* Check novice.
*
* @access public
* @return void
*/
public function checkNoviceTest()
{
$this->app->user->modifyPassword = 1;
$objects = $this->objectModel->checkNovice();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial product pairs.
*
* @access public
* @return void
*/
public function getProductPairsTest()
{
$objects = $this->objectModel->getProductPairs();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get module pairs for tutorial.
*
* @access public
* @return void
*/
public function getModulePairsTest()
{
$objects = $this->objectModel->getModulePairs();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial product.
*
* @access public
* @return void
*/
public function getProductTest()
{
$objects = $this->objectModel->getProduct();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get product stats for tutorial.
*
* @access public
* @return void
*/
public function getProductStatsTest()
{
$objects = $this->objectModel->getProductStats();
if(dao::isError()) return dao::getError();
return $objects[0][0]['products'];
}
/**
* Get project for tutorial.
*
* @access public
* @return void
*/
public function getProjectTest()
{
$objects = $this->objectModel->getProject();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial project pairs.
*
* @access public
* @return void
*/
public function getProjectPairsTest()
{
$objects = $this->objectModel->getProjectPairs();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get project stats for tutorial.
*
* @param string $browseType
* @access public
* @return void
*/
public function getProjectStatsTest($browseType = '')
{
$objects = $this->objectModel->getProjectStats($browseType = '');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial stories.
*
* @access public
* @return void
*/
public function getStoriesTest()
{
$objects = $this->objectModel->getStories();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial Execution pairs.
*
* @access public
* @return void
*/
public function getExecutionPairsTest()
{
$objects = $this->objectModel->getExecutionPairs();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial execution.
*
* @access public
* @return void
*/
public function getExecutionTest()
{
$objects = $this->objectModel->getExecution();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial execution products.
*
* @access public
* @return void
*/
public function getExecutionProductsTest()
{
$objects = $this->objectModel->getExecutionProducts();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial execution stories.
*
* @access public
* @return void
*/
public function getExecutionStoriesTest()
{
$objects = $this->objectModel->getExecutionStories();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial execution story pairs.
*
* @access public
* @return void
*/
public function getExecutionStoryPairsTest()
{
$objects = $this->objectModel->getExecutionStoryPairs();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial team members.
*
* @access public
* @return void
*/
public function getTeamMembersTest()
{
$objects = $this->objectModel->getTeamMembers();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get team members pairs.
*
* @access public
* @return void
*/
public function getTeamMembersPairsTest()
{
$objects = $this->objectModel->getTeamMembersPairs();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorial user pairs.
*
* @access public
* @return void
*/
public function getUserPairsTest()
{
$objects = $this->objectModel->getUserPairs();
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Get tutorialed.
*
* @access public
* @return void
*/
public function getTutorialedTest()
{
$objects = $this->objectModel->getTutorialed();
if(dao::isError()) return dao::getError();
return $objects;
}
}
+228 -24
View File
@@ -4,26 +4,91 @@ class weeklyTest
public function __construct()
{
global $tester;
$this->objectModel = $tester->loadModel('weekly');
$this->objectModel = $tester->loadModel('weekly');
$this->projectModel = $tester->loadModel('project');
}
public function getPageNavTest($project, $date)
/**
* GetPageNav
*
* @param int $projectID
* @param string $date
* @access public
* @return string
*/
public function getPageNavTest($projectID, $date)
{
$objects = $this->objectModel->getPageNav($project, $date);
$project = $this->projectModel->getById($projectID);
$pageNav = $this->objectModel->getPageNav($project, $date);
if(dao::isError()) return dao::getError();
$start_str = mb_strpos($pageNav,"ass='btn'>") + mb_strlen("class='btn'>");
$end_str = mb_strpos($pageNav,"</a>") - $start_str;
$objects = mb_substr($pageNav,$start_str,$end_str);
return $objects;
}
/**
* GetWeekPairs
*
* @param int $begin
* @param int $end
* @access public
* @return array
*/
public function getWeekPairsTest($begin, $end)
{
switch($begin)
{
case '1':
$begin = date('Y-m-d');
break;
case '2':
$begin = date('Y-m-d', strtotime(date('Y-m-d')."- 6 days"));
break;
case '3':
$begin = date('Y-m-d', strtotime(date('Y-m-d') . "+ 6 days"));
break;
case '':
$begin = '';
break;
}
switch($begin)
{
case '1':
$end = date('Y-m-d');
break;
case '2':
$end = date('Y-m-d', strtotime(date('Y-m-d')."- 6 days"));
break;
case '3':
$end = date('Y-m-d', strtotime(date('Y-m-d') . "+ 6 days"));
break;
case '':
$end = '';
break;
}
$objects = $this->objectModel->getWeekPairs($begin, $end);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getWeekPairsTest($begin, $end = '')
{
$objects = $this->objectModel->getWeekPairs($begin, $end = '');
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* GetFromDB
*
* @param int $project
* @param string $date
* @access public
* @return object
*/
public function getFromDBTest($project, $date)
{
@@ -34,15 +99,34 @@ class weeklyTest
return $objects;
}
/**
* Save data.
*
* @param int $project
* @param string $date
* @access public
* @return void
*/
public function saveTest($project, $date)
{
$objects = $this->objectModel->save($project, $date);
if(dao::isError()) return dao::getError();
return $objects;
$weekly = $this->objectModel->getFromDB($project, $date);
return $weekly;
}
/**
* GetWeekSN
*
* @param string $begin
* @param string $date
* @access public
* @return int
*/
public function getWeekSNTest($begin, $date)
{
$objects = $this->objectModel->getWeekSN($begin, $date);
@@ -52,6 +136,14 @@ class weeklyTest
return $objects;
}
/**
* Get monday for a date.
*
* @param string $date
* @access public
* @return date
*/
public function getThisMondayTest($date)
{
$objects = $this->objectModel->getThisMonday($date);
@@ -61,6 +153,14 @@ class weeklyTest
return $objects;
}
/**
* GetThisSunday
*
* @param string $date
* @access public
* @return date
*/
public function getThisSundayTest($date)
{
$objects = $this->objectModel->getThisSunday($date);
@@ -70,6 +170,14 @@ class weeklyTest
return $objects;
}
/**
* GetLastDay
*
* @param string $date
* @access public
* @return string
*/
public function getLastDayTest($date)
{
$objects = $this->objectModel->getLastDay($date);
@@ -79,87 +187,167 @@ class weeklyTest
return $objects;
}
/**
* Test getStaff
*
* @param int $project
* @param string $date
* @access public
* @return array
*/
public function getStaffTest($project, $date = '')
{
$objects = $this->objectModel->getStaff($project, $date = '');
$objects = $this->objectModel->getStaff($project, $date);
if(dao::isError()) return dao::getError();
return $objects;
}
public function getFinishedTest($project, $date = '', $pager = null)
/**
* Test getFinished
*
* @param int $project
* @param string $date
* @access public
* @return void
*/
public function getFinishedTest($project, $date = '')
{
$objects = $this->objectModel->getFinished($project, $date = '', $pager = null);
$objects = $this->objectModel->getFinished($project, $date);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test getPostponed
*
* @param int $project
* @param string $date
* @access public
* @return void
*/
public function getPostponedTest($project, $date = '')
{
$objects = $this->objectModel->getPostponed($project, $date = '');
$objects = $this->objectModel->getPostponed($project, $date);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test getTasksOfNextWeek
*
* @param int $project
* @param string $date
* @access public
* @return void
*/
public function getTasksOfNextWeekTest($project, $date = '')
{
$objects = $this->objectModel->getTasksOfNextWeek($project, $date = '');
$objects = $this->objectModel->getTasksOfNextWeek($project, $date);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test getWorkloadByType
*
* @param int $project
* @param string $date
* @access public
* @return object
*/
public function getWorkloadByTypeTest($project, $date = '')
{
$objects = $this->objectModel->getWorkloadByType($project, $date = '');
$objects = $this->objectModel->getWorkloadByType($project, $date);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test getPlanedTaskByWeek
*
* @param int $project
* @param string $date
* @access public
* @return array
*/
public function getPlanedTaskByWeekTest($project, $date = '')
{
$objects = $this->objectModel->getPlanedTaskByWeek($project, $date = '');
$objects = $this->objectModel->getPlanedTaskByWeek($project, $date);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test getPV
*
* @param int $project
* @param string $date
* @access public
* @return int
*/
public function getPVTest($projectID, $date = '')
{
$objects = $this->objectModel->getPV($projectID, $date = '');
$objects = $this->objectModel->getPV($projectID, $date);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get EV data.
*
* @param int $projectID
* @param string $date
* @access public
* @return int
*/
public function getEVTest($projectID, $date = '')
{
$objects = $this->objectModel->getEV($projectID, $date = '');
$objects = $this->objectModel->getEV($projectID, $date);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get AC data.
*
* @param int $project
* @param string $date
* @access public
* @return int
*/
public function getACTest($project, $date = '')
{
$objects = $this->objectModel->getAC($project, $date = '');
$objects = $this->objectModel->getAC($project, $date);
if(dao::isError()) return dao::getError();
return $objects;
}
/**
* Test get SV data.
*
* @param int $ev
* @param int $pv
* @access public
* @return int
*/
public function getSVTest($ev, $pv)
{
$objects = $this->objectModel->getSV($ev, $pv);
@@ -169,6 +357,14 @@ class weeklyTest
return $objects;
}
/**
* Test getCV
*
* @param int $ev
* @param int $ac
* @access public
* @return int
*/
public function getCVTest($ev, $ac)
{
$objects = $this->objectModel->getCV($ev, $ac);
@@ -178,12 +374,20 @@ class weeklyTest
return $objects;
}
/**
* Test getTips
*
* @param string $type
* @param int $data
* @access public
* @return string
*/
public function getTipsTest($type = 'progress', $data = 0)
{
$objects = $this->objectModel->getTips($type = 'progress', $data = 0);
$objects = $this->objectModel->getTips($type, $data);
if(dao::isError()) return dao::getError();
return $objects;
}
}
}
+1 -1
View File
@@ -78,7 +78,7 @@ fields:
format: ""
- field: type
note: "文档类型"
range: text,markdown
range: text,markdown,url
prefix: ""
postfix: ""
loop: 0
+6 -3
View File
@@ -33,8 +33,11 @@ fields:
format: ""
- field: content
note: "文档正文"
range: 1-10000
prefix: "文档正文"
fields:
- field: content1
range: 文档正文,文档正文,www.baidu.com
- field: content2
range: 1-2,[]
postfix: ""
loop: 0
format: ""
@@ -47,7 +50,7 @@ fields:
format: ""
- field: type
note: "文档类型"
range: text,markdown
range: text,markdown,html
prefix: ""
postfix: ""
loop: 0
+111
View File
@@ -0,0 +1,111 @@
title: table zt_extension
desc: "插件"
author: automated export
version: "1.0"
fields:
- field: id
note: "ID"
range: 1-10000
prefix: ""
postfix: ""
loop: 0
format: ""
- field: name
note: "插件名称"
range: 1-10000
prefix: "这是插件名称"
postfix: ""
loop: 0
format: ""
- field: code
note: "代号"
range: 1-10000
prefix: "code"
postfix: ""
loop: 0
format: ""
- field: version
note: "版本号"
range: 1-3
prefix: "version"
postfix: ""
loop: 0
format: ""
- field: author
note: "作者"
range: 1-10000
prefix: "author"
postfix: ""
loop: 0
format: ""
- field: desc
note: "描述"
range: 1-10000
prefix: "这是插件描述"
postfix: ""
loop: 0
format: ""
- field: license
note: "授权"
range: LGPL
prefix: ""
postfix: ""
loop: 0
format: ""
- field: type
note: "类型"
range: extension
prefix: ""
postfix: ""
loop: 0
format: ""
- field: site
note: "官网"
range: zentao
prefix: "http://"
postfix: ".net"
loop: 0
format: ""
- field: zentaoCompatible
note: "适用版本"
range: all
prefix: ""
postfix: ""
loop: 0
format: ""
- field: installedTime
note: "安装时间"
from: common.date.v1.yaml
use: dateA
prefix: ""
postfix: ""
loop: 0
format: ""
- field: depends
note: "依赖"
range: 0
prefix: ""
postfix: ""
loop: 0
format: ""
- field: dirs
note: "安装目录"
range: []
prefix: ""
postfix: ""
loop: 0
format: ""
- field: files
note: "安装文件"
range: 1-10000
prefix: "json格式文件内容"
postfix: ""
loop: 0
format: ""
- field: status
note: "安装状态"
range: installed,deactivated
prefix: ""
postfix: ""
loop: 0
format: ""
+6
View File
@@ -41,6 +41,12 @@ fields:
- field: engine
note: "引擎"
range: jenkins,gitlab
- field: server
note: "服务器ID"
range: 3,1
- field: pipeline
note: "流水线"
range: dave,[{"project":"1569"}]
- field: triggerType
note: "触发方式"
range: tag,commit,schedule
+68
View File
@@ -0,0 +1,68 @@
title: table zt_log
desc: "接口日志"
author: automated export
version: "1.0"
fields:
- field: id
note: "ID"
range: 1-10000
prefix: ""
postfix: ""
loop: 0
format: ""
- field: objectType
note: "对象类型"
range: entry,webhook{9}
prefix: ""
postfix: ""
loop: 0
format: ""
- field: objectID
note: "对象ID"
range: 1-10000
prefix: ""
postfix: ""
loop: 0
format: ""
- field: action
note: "操作日志ID"
range: 1-10000
prefix: ""
postfix: ""
loop: 0
format: ""
- field: date
note: "日期"
range: "(-1M)-(1w)"
type: timestamp
format: "YYYY-MM-DD hh:mm:ss"
prefix: ""
postfix: ""
- field: url
note: "请求地址"
range: "qcmmi"
prefix: "http://"
postfix: ".com"
loop: 0
format: ""
- field: contentType
note: "内容类型"
range: "application/json"
prefix: ""
postfix: ""
loop: 0
format: ""
- field: data
note: "数据"
range: a-z
prefix: ""
postfix: ""
loop: 0
format: ""
- field: result
note: "结果"
range: a-z
prefix: ""
postfix: ""
loop: 0
format: ""
+83
View File
@@ -0,0 +1,83 @@
title: table_meeting
desc: ""
version: "1.0"
fields:
- field: id
range: 1-1000
- field: project
range: 11-20
- field: execution
range: 101-110
- field: name
range: 1-100
prefix: "会议"
- field: type
range: ""
- field: begin
range: "(-1M)-(+1w)"
type: timestamp
format: "hh:mm:ss"
- field: end
range: "(-1M)-(+1w):1h"
type: timestamp
format: "hh:mm:ss"
- field: dept
range: 1-10
- field: mode
range: both,online,outline
- field: host
range: admin
- field: participant
range: admin
prefix: ","
postfix: ","
- field: date
range: "(-1M)-(+1w)"
type: timestamp
format: "YYYY-MM-DD"
- field: room
range: 1
- field: minutes
range: ""
- field: minutedBy
range: ""
- field: minutedDate
range: ""
- field: objectType
range: story,task,issue,bug
- field: objectID
range: 0
- field: createdBy
range: admin
- field: createdDate
range: "(-1M)-(+1w)"
type: timestamp
format: "YYYY-MM-DD hh:mm:ss"
- field: editedBy
range: ""
- field: editedDate
range: ""
- field: deleted
range: 0
+4
View File
@@ -28,5 +28,9 @@ fields:
range: 0
- field: compileID
range: 0
- field: createdBy
range: admin
- field: assignee
range: admin
- field: deleted
range: 0
+98
View File
@@ -0,0 +1,98 @@
title: table zt_notify
desc: "消息通知"
author: automated export
version: "1.0"
fields:
- field: id
note: "ID"
range: 1-10000
prefix: ""
postfix: ""
loop: 0
format: ""
- field: objectType
note: "对象类型"
range: mail
prefix: ""
postfix: ""
loop: 0
format: ""
- field: objectID
note: "对象ID"
range: 0
prefix: ""
postfix: ""
loop: 0
format: ""
- field: action
note: "操作记录ID"
range: 0
prefix: ""
postfix: ""
loop: 0
format: ""
- field: toList
note: "指派用户"
range: admin,user10,test10,dev10,top10
prefix: ""
postfix: ""
loop: 0
format: ""
- field: ccList
range: 0
note: ""
prefix: ""
postfix: ""
loop: 0
format: ""
- field: subject
note: "主题"
range: 1-100
prefix: "主题"
postfix: ""
loop: 0
format: ""
- field: data
note: "记录数据"
range: 1-100
prefix: "用户创建了任务"
postfix: ""
loop: 0
format: ""
- field: createdBy
note: "创建者"
range: dev12,test12,admin
prefix: ""
postfix: ""
loop: 0
format: ""
- field: createdDate
note: "创建日期"
range: "(1M)-(1w)"
type: timestamp
format: "YYYY-MM-DD hh:mm:ss"
prefix: ""
postfix: ""
loop: 0
- field: sendTime
note: "发送日期"
range: "(1M)-(1w)"
type: timestamp
format: "YYYY-MM-DD hh:mm:ss"
prefix: ""
postfix: ""
loop: 0
- field: status
note: "状态"
range: wait,fail
prefix: ""
postfix: ""
loop: 0
format: ""
- field: failReason
note: "失败原因"
range: ""
prefix: ""
postfix: ""
loop: 0
format: ""
+9 -9
View File
@@ -3,24 +3,24 @@ author: Zeng gang
version: "1.0"
fields:
- field: id
range: 1-2
range: 1-3
- field: type
range: gitlab,sonarqube
range: gitlab,sonarqube,jenkins
- field: name
range: gitlab服务器,sonarqube服务器
range: gitlab服务器,sonarqube服务器,jenkins服务器
- field: url
range: [http://192.168.1.161:51080],[http://192.168.1.161:59001]
range: [http://10.0.1.161:51080],[http://10.0.1.161:59001],[http://10.0.1.161:58080]
- field: account
range: [],[admin]
range: [],[admin]{2}
- field: password
range: [],[UDJzc3cwcmQ=]
range: [],[UDJzc3cwcmQ=],[]
- field: token
range: x88fZokrp5hShia2jyBN,YWRtaW46UDJzc3cwcmQ=
range: x88fZokrp5hShia2jyBN,YWRtaW46UDJzc3cwcmQ=,1196c85ba525a268570df9da627e3a7b2d
- field: private
range: 08bcc98f75d7d40053dc80722bdc117b,228b25587479f2fc7570428e8bcbabdc
range: 08bcc98f75d7d40053dc80722bdc117b,228b25587479f2fc7570428e8bcbabdc,ec8e41481723685d9106c88be5967c41
- field: createdBy
range: admin
- field: createdDate
range: [2021-12-09 11:23:35],[2022-01-12 08:47:37]
range: [2021-12-09 11:23:35],[2022-01-12 08:47:37],[2022-01-12 08:47:37]
- field: deleted
range: 0
+4
View File
@@ -62,5 +62,9 @@ fields:
- field: subStatus
range: ' '
- field: notify
range: PO,PD
postfix: ","
- field: deleted
range: 0
+7 -2
View File
@@ -50,14 +50,14 @@ fields:
- field: commiter
note: "源代码帐号"
fields:
- field: commiter1
- 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: ""
fields:
- field: avatar1
- field: avatar1
range: /home/z/tmp/,/home/z/user/
- field: avatar2
range: 1-10,10-20
@@ -167,6 +167,11 @@ fields:
range: 1
- field: ranzhi
note: "ZDOO账号"
fields:
- field: account1
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: account2
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: score
note: "积分"
range: 1-10000:R
+47
View File
@@ -0,0 +1,47 @@
title: table zt_usertpl
desc: "用户模块"
author: automated export
version: "1.0"
fields:
- field: id
note: "ID"
range: 1-10000
prefix: ""
postfix: ""
loop: 0
format: ""
- field: account
range: admin,dev10,top10,test10,po10
note: "用户名"
prefix: ""
postfix: ""
loop: 0
format: ""
- field: type
note: "类型"
range: exporttask,story,exportbug,exportstory
prefix: ""
postfix: ""
loop: 0
format: ""
- field: title
note: "模板名"
range: 1-10000
prefix: "模板名称"
postfix: ""
loop: 0
format: ""
- field: content
note: "内容"
range: 1-10000
prefix: "模块内容"
postfix: ""
loop: 0
format: ""
- field: public
note: "是否公开"
range: 0,1
prefix: ""
postfix: ""
loop: 0
format: ""
+2 -4
View File
@@ -21,10 +21,8 @@ fields:
format: ""
- field: weekStart
note: ""
range: "(M)-(w):60s"
type: timestamp
format: "YYYY-MM-DD"
prefix: ""
range: ""
prefix: "2022-05-02"
postfix: ""
- field: pv
range: 1-10
+7 -2
View File
@@ -13,7 +13,8 @@ $builder->dept = array('rows' => 100, 'extends' => array('dept'));
$builder->action = array('rows' => 100, 'extends' => array('action'));
$builder->history = array('rows' => 100, 'extends' => array('history'));
$builder->file = array('rows' => 100, 'extends' => array('file'));
$builder->score = array('rows' => 100, 'extends' => array('score'));
$builder->score = array('rows' => 100, 'extends' => array('score'));
$builder->extension = array('rows' => 10, 'extends' => array('extension'));
$builder->program = array('rows' => 10, 'extends' => array('project', 'program'));
$builder->project = array('rows' => 90, 'extends' => array('project', 'project'));
@@ -103,14 +104,18 @@ $builder->designspec = array('rows' => 120, 'extends' => array('designspec'));
$builder->stage = array('rows' => 6, 'extends' => array('stage'));
$builder->webhook = array('rows' => 7, 'extends' => array('webhook'));
$builder->entry = array('rows' => 1, 'extends' => array('entry'));
$builder->log = array('rows' => 10, 'extends' => array('log'));
$builder->weeklyreport = array('rows' => 10, 'extends' => array('weeklyreport'));
$builder->metting = array('rows' => 10, 'extends' => array('meeting'));
$builder->usertpl = array('rows' => 10, 'extends' => array('usertpl'));
$builder->pipeline = array('rows' => 2, 'extends' => array('pipeline'));
$builder->pipeline = array('rows' => 3, 'extends' => array('pipeline'));
$builder->holiday = array('rows' => 100, 'extends' => array('holiday'));
$builder->repo = array('rows' => 1, 'extends' => array('repo'));
$builder->job = array('rows' => 2, 'extends' => array('job'));
$builder->mr = array('rows' => 1, 'extends' => array('mr'));
$builder->oauth = array('rows' => 90, 'extends' => array('oauth'));
$builder->notify = array('rows' => 10, 'extends' => array('notify'));
$builder->vm = array('rows' => 1, 'extends' => array('vm'));
$builder->vmtemplate = array('rows' => 1, 'extends' => array('vmtemplate'));
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->appendCountParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->appendCountParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->checkAPI();
cid=1
pid=1
*/
$block = new blockTest();
r($block->checkAPITest()) && p() && e();
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getAssignToMeParams();
cid=1
pid=1
获取当前登陆用户待办的默认参数 >> 待办数,20,input
获取当前登陆用户任务的默认参数 >> 任务数,20,input
获取当前登陆用户Bug的默认参数 >> Bug数,20,input
获取当前登陆用户需求的默认参数 >> 需求数,20,input
*/
$block = new blockTest();
$data = $block->getAssignToMeParamsTest();
r($data) && p('todoCount:name,default,control') && e('待办数,20,input'); // 获取当前登陆用户待办的默认参数
r($data) && p('taskCount:name,default,control') && e('任务数,20,input'); // 获取当前登陆用户任务的默认参数
r($data) && p('bugCount:name,default,control') && e('Bug数,20,input'); // 获取当前登陆用户Bug的默认参数
r($data) && p('storyCount:name,default,control') && e('需求数,20,input'); // 获取当前登陆用户需求的默认参数
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getAvailableBlocks();
cid=1
pid=1
通过获取项目的可用区块 >> 项目计划,最新动态
通过获取测试的可用区块 >> 测试统计,Bug列表,用例列表,版本列表
*/
$block = new blockTest();
$data[0] = $block->getAvailableBlocksTest('project', 'project', 'waterfall');
$data[1] = $block->getAvailableBlocksTest('qa');
r($data[0]) && p('waterfallgantt,projectdynamic') && e('项目计划,最新动态'); // 通过获取项目的可用区块
r($data[1]) && p('statistic,bug,case,testtask') && e('测试统计,Bug列表,用例列表,版本列表'); // 通过获取测试的可用区块
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getBlock();
cid=1
pid=1
测试获取block的所属模块 >> my
测试获取block的名称 >> 项目统计
测试获取block的来源 >> project
测试获取block的区块 >> statistic
*/
$block = new blockTest();
$data = $block->getBlockTest(99);
r($data) && p('module') && e('my'); // 测试获取block的所属模块
r($data) && p('title') && e('项目统计'); // 测试获取block的名称
r($data) && p('source') && e('project'); // 测试获取block的来源
r($data) && p('block') && e('statistic'); // 测试获取block的区块
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getBlockList();
cid=1
pid=1
>> 测试统计;指派给我的Bug;指派给我的用例;待测版本列表
>> 项目计划;最新计划
*/
$block = new blockTest();
r($block->getBlockListTest('qa')) && p('107:title;108:title;109:title;110:title') && e('测试统计;指派给我的Bug;指派给我的用例;待测版本列表');
r($block->getBlockListTest('project', 'waterfall')) && p('105:title;106:title') && e('项目计划;最新计划');
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getBugParams();
cid=1
pid=1
测试通过模块获取Bug区块的参数 >> 数量;类型;排序
测试通过模块获取Bug区块的参数 >> 数量;类型;排序
*/
$block = new blockTest();
$data[0] = $block->getBugParamsTest('qa');
$data[1] = $block->getBugParamsTest('my');
r($data[0]) && p('count:name;type:name;orderBy:name') && e('数量;类型;排序'); //测试通过模块获取Bug区块的参数
r($data[1]) && p('count:name;type:name;orderBy:name') && e('数量;类型;排序'); //测试通过模块获取Bug区块的参数
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getBuildParams();
cid=1
pid=1
测试获取版本区块参数 >> 数量,20,input
*/
$block = new blockTest();
$data = $block->getBuildParamsTest();
r($data) && p('count:name,default,control') && e('数量,20,input'); //测试获取版本区块参数
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getByID();
cid=1
pid=1
测试获取block的所属模块 >> my
测试获取block的名称 >> 项目统计
测试获取block的来源 >> project
测试获取block的区块 >> statistic
*/
$block = new blockTest();
$data = $block->getByIDTest(99);
r($data) && p('module') && e('my'); // 测试获取block的所属模块
r($data) && p('title') && e('项目统计'); // 测试获取block的名称
r($data) && p('source') && e('project'); // 测试获取block的来源
r($data) && p('block') && e('statistic'); // 测试获取block的区块
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getCaseParams();
cid=1
pid=1
测试通过模块获取用例区块的参数 >> 数量;类型;排序
测试通过模块获取用例区块的参数 >> 数量;类型;排序
*/
$block = new blockTest();
$data[0] = $block->getCaseParamsTest('qa');
$data[1] = $block->getCaseParamsTest('my');
r($data[0]) && p('count:name;type:name;orderBy:name') && e('数量;类型;排序'); //测试通过模块获取用例区块的参数
r($data[1]) && p('count:name;type:name;orderBy:name') && e('数量;类型;排序'); //测试通过模块获取用例区块的参数
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getClosedBlockPairs();
cid=1
pid=1
测试获取关闭的区块键值对 >> 未获取到关闭的区域
*/
global $config;
$block = new blockTest();
$data = $block->getClosedBlockPairsTest('');
r($data) && p('massage') && e('未获取到关闭的区域'); //测试获取关闭的区块键值对
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getExecutionParams();
cid=1
pid=1
测试获取执行区块的参数 >> 数量;类型
*/
$block = new blockTest();
$data = $block->getExecutionParamsTest();
r($data) && p('count:name;type:name') && e('数量;类型'); //测试获取执行区块的参数
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getExecutionStatisticParams();
cid=1
pid=1
测试获取执行区块的参数 >> 数量;类型
*/
$block = new blockTest();
$data = $block->getExecutionStatisticParamsTest();
r($data) && p('count:name;type:name') && e('数量;类型'); //测试获取执行区块的参数
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getHiddenBlocks();
cid=1
pid=1
测试获取隐藏的区块 >> 未获取到隐藏的区块
*/
$block = new blockTest();
r($block->getHiddenBlocksTest('my')) && p('message') && e('未获取到隐藏的区块'); //测试获取隐藏的区块
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getLastKey();
cid=1
pid=1
测试通过qa模块获取区块的key >> 4
测试通过my模块获取区块的key >> 10
*/
$block = new blockTest();
$data[0] = $block->getLastKeyTest('qa');
$data[1] = $block->getLastKeyTest('my');
r($data[0]) && p('qa') && e('4'); //测试通过qa模块获取区块的key
r($data[1]) && p('my') && e('10'); //测试通过my模块获取区块的key
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getListParams();
cid=1
pid=1
测试通过模块获取区块的参数 >> 数量
测试通过模块获取区块的参数 >> 数量
测试通过模块获取区块的参数 >> 数量;类型;排序
*/
$block = new blockTest();
$data[0] = $block->getListParamsTest('my');
$data[1] = $block->getListParamsTest('qa');
$data[2] = $block->getListParamsTest('project');
r($data[0]) && p('count:name') && e('数量'); //测试通过模块获取区块的参数
r($data[1]) && p('count:name') && e('数量'); //测试通过模块获取区块的参数
r($data[2]) && p('count:name;type:name;orderBy:name') && e('数量;类型;排序'); //测试通过模块获取区块的参数
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getOverviewParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getOverviewParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getPlanParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getPlanParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getProductParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getProductParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getProductStatisticParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getProductStatisticParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getProjectDynamicParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getProjectDynamicParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getProjectParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getProjectParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getProjectStatisticParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getProjectStatisticParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getProjectTeamParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getProjectTeamParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getQaStatisticParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getQaStatisticParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getRecentProjectParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getRecentProjectParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getReleaseParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getReleaseParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getScrumListParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getScrumListParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getScrumOverviewParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getScrumOverviewParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getScrumProductParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getScrumProductParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getScrumRoadMapParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getScrumRoadMapParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getScrumTestParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getScrumTestParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getSprintParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getSprintParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getStatisticParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getStatisticParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getStoryParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getStoryParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getStorysEstimateHours();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getStorysEstimateHoursTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getTaskParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getTaskParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getTesttaskParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getTesttaskParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getTodoParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getTodoParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getWaterfallEstimateParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getWaterfallEstimateParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getWaterfallGanttParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getWaterfallGanttParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getWaterfallIssueParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getWaterfallIssueParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getWaterfallProgressParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getWaterfallProgressParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getWaterfallReportParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getWaterfallReportParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getWaterfallRiskParams();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getWaterfallRiskParamsTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->getWelcomeBlockData();
cid=1
pid=1
*/
$block = new blockTest();
r($block->getWelcomeBlockDataTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->initBlock();
cid=1
pid=1
*/
$block = new blockTest();
r($block->initBlockTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->isLongBlock();
cid=1
pid=1
*/
$block = new blockTest();
r($block->isLongBlockTest()) && p() && e();
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/block.class.php';
su('admin');
/**
title=测试 blockModel->save();
cid=1
pid=1
*/
$block = new blockTest();
r($block->saveTest()) && p() && e();
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/ci.class.php';
su('admin');
/**
title=测试 ciModel->sendRequest();
cid=1
pid=1
成功执行jenkins构建 >> 1
错误的密码执行jenkins构建 >> 0
空的参数执行jenkins构建 >> 1
错误的路径执行jenkins构建 >> 0
*/
$ci = new ciTest();
$url = 'http://10.0.1.161:58080/job/dave/buildWithParameters/api/json';
$errorUrl = 'http://10.0.1.161:58080/job/test/buildWithParameters/api/json';
$userPWD = 'admin:1196c85ba525a268570df9da627e3a7b2d';
$errorPWD = 'admin:1';
$emptyData = new stdclass();
$normalData = new stdclass();
$normalData->PARAM_TAG = 'tag_test1';
r($ci->sendRequestTest($url, $normalData, $userPWD)) && p() && e('1'); //成功执行jenkins构建
r($ci->sendRequestTest($url, $normalData, $errorPWD)) && p() && e('0'); //错误的密码执行jenkins构建
r($ci->sendRequestTest($url, $emptyData, $userPWD)) && p() && e('1'); //空的参数执行jenkins构建
r($ci->sendRequestTest($errorUrl, $normalData, $userPWD)) && p() && e('0'); //错误的路径执行jenkins构建
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/ci.class.php';
su('admin');
/**
title=测试 ciModel->setMenu();
cid=1
pid=1
替换devops模块的参数 >> 代码|repo|browse|repoID=1
*/
$ci = new ciTest();
r($ci->setMenuTest()) && p('link') && e('代码|repo|browse|repoID=1'); //替换devops模块导航的参数
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/ci.class.php';
su('admin');
/**
title=测试 ciModel->syncCompileStatus();
cid=1
pid=1
同步jenkins构建结果 >> created
*/
$ci = new ciTest();
r($ci->syncCompileStatusTest(1)) && p('status') && e('created'); //同步jenkins构建结果
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/ci.class.php';
su('admin');
/**
title=测试 ciModel->syncGitlabTaskStatus();
cid=1
pid=1
同步gitlab构建结果 >> 1
*/
$ci = new ciTest();
r($ci->syncGitlabTaskStatusTest(2)) && p() && e(1); //同步jenkins构建结果
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/ci.class.php';
su('admin');
/**
title=测试 ciModel->updateBuildStatus();
cid=1
pid=1
更新构建任务状态为构建中 >> building
更新构建任务状态为成功 >> success
更新构建任务状态为失败 >> failure
*/
$ci = new ciTest();
r($ci->updateBuildStatusTest(1, 'building')) && p('status') && e('building'); //更新构建任务状态为构建中
r($ci->updateBuildStatusTest(1, 'success')) && p('status') && e('success'); //更新构建任务状态为成功
r($ci->updateBuildStatusTest(1, 'failure')) && p('status') && e('failure'); //更新构建任务状态为失败
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/datatable.class.php';
su('admin');
/**
title=测试 datatableModel::getFieldList();
cid=1
pid=1
获取产品模块browse方法自定义列 >> ID
获取项目模块browse方法自定义列 >> 项目名称
获取执行模块task方法自定义列 >> 70
获取测试用例模块browse方法自定义列 >> auto
*/
$datatable = new datatableTest();
r($datatable->getFieldListTest('product', 'browse')) && p('id:title') && e('ID'); //获取产品模块browse方法自定义列
r($datatable->getFieldListTest('project', 'browse')) && p('name:title') && e('项目名称'); //获取项目模块browse方法自定义列
r($datatable->getFieldListTest('execution', 'task')) && p('id:width') && e('70'); //获取执行模块task方法自定义列
r($datatable->getFieldListTest('testcase', 'browse')) && p('title:width') && e('auto'); //获取测试用例模块browse方法自定义列
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/datatable.class.php';
su('admin');
/**
title=测试 datatableModel::getSetting();
cid=1
pid=1
获取产品模块browse方法设置 >> ID
获取项目模块browse方法设置 >> 项目名称
获取执行模块task方法设置 >> 70
获取测试用例模块browse方法设置 >> auto
*/
$datatable = new datatableTest();
r($datatable->getSettingTest('product', 'browse')) && p('0:title') && e('ID'); //获取产品模块browse方法设置
r($datatable->getSettingTest('project', 'browse')) && p('1:title') && e('项目名称'); //获取项目模块browse方法设置
r($datatable->getSettingTest('execution', 'task')) && p('0:width') && e('70'); //获取执行模块task方法设置
r($datatable->getSettingTest('testcase', 'browse')) && p('2:width') && e('auto'); //获取测试用例模块browse方法设置
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/datatable.class.php';
su('admin');
/**
title=测试 datatableModel::printHead();
cid=1
pid=1
获取产品模块browse方法头部html >> 1
获取产品模块browse方法头部html带排序 >> 1
获取产品模块browse方法头部html带参数 >> 1
获取产品模块browse方法头部html带checkbox >> 1
*/
$datatable = new datatableTest();
$productSetting = $datatable->getSettingTest('product', 'browse');
$data = array('cols' => $productSetting[0], 'orderBy' => '', 'vars' => '', 'checkBox' => false);
$data_order = array('cols' => $productSetting[0], 'orderBy' => 'id_asc', 'vars' => '', 'checkBox' => false);
$data_vars = array('cols' => $productSetting[0], 'orderBy' => 'id_asc', 'vars' => 'productID=1', 'checkBox' => false);
$data_check = array('cols' => $productSetting[0], 'orderBy' => 'id_asc', 'vars' => 'productID=1', 'checkBox' => true);
r($datatable->printHeadTest($data)) && p() && e(1); //获取产品模块browse方法头部html
r($datatable->printHeadTest($data_order)) && p() && e(1); //获取产品模块browse方法头部html带排序
r($datatable->printHeadTest($data_vars)) && p() && e(1); //获取产品模块browse方法头部html带参数
r($datatable->printHeadTest($data_check)) && p() && e(1); //获取产品模块browse方法头部html带checkbox
@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/datatable.class.php';
su('admin');
/**
title=测试 datatableModel::setFixedFieldWidth();
cid=1
pid=1
获取产品模块browse方法设置宽度 >> 550
获取项目模块browse方法设置宽度 >> 180
获取执行模块task方法设置宽度 >> 550
获取测试用例模块browse方法设置宽度 >> 150
*/
$datatable = new datatableTest();
$productSetting = $datatable->getSettingTest('product', 'browse');
$projectSetting = $datatable->getSettingTest('project', 'browse');
$executionSetting = $datatable->getSettingTest('execution', 'task');
$testcaseSetting = $datatable->getSettingTest('testcase', 'browse');
r($datatable->setFixedFieldWidthTest($productSetting)) && p('leftWidth') && e('550'); //获取产品模块browse方法设置宽度
r($datatable->setFixedFieldWidthTest($projectSetting)) && p('rightWidth') && e('180'); //获取项目模块browse方法设置宽度
r($datatable->setFixedFieldWidthTest($executionSetting)) && p('leftWidth') && e('550'); //获取执行模块browse方法设置宽度
r($datatable->setFixedFieldWidthTest($testcaseSetting)) && p('rightWidth') && e('150'); //获取测试用例模块browse方法设置宽度
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/doc.class.php';
su('admin');
/**
title=测试 docModel->buildBrowseSwitch();
cid=1
pid=1
*/
$doc = new docTest();
r($doc->buildBrowseSwitchTest()) && p() && e();

Some files were not shown because too many files have changed in this diff Show More