Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms into fixbug
This commit is contained in:
@@ -86,6 +86,7 @@ class projectsEntry extends entry
|
||||
$this->setPost('whitelist', $this->request('whitelist', array()));
|
||||
$this->setPost('PM', $this->request('PM', ''));
|
||||
$this->setPost('model', $this->request('model', 'scrum'));
|
||||
$this->setPost('parent', $this->request('parent', 0));
|
||||
|
||||
$control = $this->loadController('project', 'create');
|
||||
$this->requireFields('name,code,begin,end,products');
|
||||
|
||||
@@ -2021,7 +2021,7 @@ class execution extends control
|
||||
$deadline = $execution->status == 'closed' ? substr($execution->closedDate, 0, 10) : $execution->suspendedDate;
|
||||
$deadline = strpos('closed,suspended', $execution->status) === false ? helper::today() : $deadline;
|
||||
$endDate = strpos($type, 'withdelay') !== false ? $deadline : $execution->end;
|
||||
list($dateList, $interval) = $this->execution->getDateList($execution->begin, $endDate, $type, 0, 'Y-m-d');
|
||||
list($dateList, $interval) = $this->execution->getDateList($execution->begin, $endDate, $type, 0, 'Y-m-d', $execution->end);
|
||||
$chartData = $this->execution->buildBurnData($executionID, $dateList, $type);
|
||||
|
||||
/* Load pager. */
|
||||
|
||||
+18
-11
@@ -33,7 +33,7 @@ class scoreModel extends model
|
||||
* @param string $time
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return bool|object
|
||||
*/
|
||||
public function create($module = '', $method = '', $param = '', $account = '', $time = '')
|
||||
{
|
||||
@@ -47,6 +47,8 @@ class scoreModel extends model
|
||||
|
||||
if(is_numeric($param)) $desc .= 'ID:' . $param;
|
||||
|
||||
$object = '';
|
||||
|
||||
switch($module)
|
||||
{
|
||||
case 'user':
|
||||
@@ -65,12 +67,13 @@ class scoreModel extends model
|
||||
if($method == 'close')
|
||||
{
|
||||
$openedBy = $this->dao->findById($param)->from(TABLE_STORY)->fetch('openedBy');
|
||||
$object = true;
|
||||
|
||||
if(!empty($openedBy))
|
||||
{
|
||||
$newRule = $rule;
|
||||
$newRule['score'] = $extended['createID'];
|
||||
$this->saveScore($openedBy, $newRule, $module, $method, $desc, $time);
|
||||
$object = $this->saveScore($openedBy, $newRule, $module, $method, $desc, $time);
|
||||
unset($newRule);
|
||||
}
|
||||
}
|
||||
@@ -93,7 +96,7 @@ class scoreModel extends model
|
||||
|
||||
if(!empty($task->estimate))
|
||||
{
|
||||
$rule['score'] = $rule['score'] + (empty($task->consumed) ? 0 : round($task->consumed / 10 * $task->estimate / $task->consumed));
|
||||
$rule['score'] = $rule['score'] + (empty($task->consumed) ? 0 : round($task->consumed / 10.0 * $task->estimate / $task->consumed));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -130,6 +133,7 @@ class scoreModel extends model
|
||||
{
|
||||
$desc = $this->lang->score->methods[$module][$method] . ',' . $desc . 'ID:' . $param->id;
|
||||
$timestamp = empty($time) ? time() : strtotime($time);
|
||||
$object = true;
|
||||
|
||||
/* Project PM. */
|
||||
if(!empty($param->PM))
|
||||
@@ -139,7 +143,7 @@ class scoreModel extends model
|
||||
{
|
||||
$rule['score'] += $extended['manager']['onTime'];
|
||||
}
|
||||
$this->saveScore($param->PM, $rule, $module, $method, $desc, $time);
|
||||
$object = $this->saveScore($param->PM, $rule, $module, $method, $desc, $time);
|
||||
}
|
||||
|
||||
/* Project team user. */
|
||||
@@ -154,13 +158,11 @@ class scoreModel extends model
|
||||
|
||||
foreach($teams as $user)
|
||||
{
|
||||
if($user != $param->PM) $this->saveScore($user, $rule, $module, $method, $desc, $time);
|
||||
if($user != $param->PM) $object = $this->saveScore($user, $rule, $module, $method, $desc, $time);
|
||||
}
|
||||
}
|
||||
|
||||
/* When the execution is closed, no more user get score. */
|
||||
return true;
|
||||
}
|
||||
|
||||
break;
|
||||
case 'search':
|
||||
if($method == 'saveQueryAdvanced') $desc = $this->lang->score->methods[$module][$method];
|
||||
@@ -169,7 +171,10 @@ class scoreModel extends model
|
||||
$desc = $this->lang->score->methods[$module][$method];
|
||||
break;
|
||||
}
|
||||
$this->saveScore($user, $rule, $module, $method, $desc, $time);
|
||||
|
||||
$object = $object === '' ? $this->saveScore($user, $rule, $module, $method, $desc, $time) : $object;
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -182,8 +187,8 @@ class scoreModel extends model
|
||||
* @param string $desc
|
||||
* @param string $time
|
||||
*
|
||||
* @access private
|
||||
* @return bool
|
||||
* @access public
|
||||
* @return object|bool
|
||||
*/
|
||||
public function saveScore($account = '', $rule = array(), $module = '', $method = '', $desc = '', $time = '')
|
||||
{
|
||||
@@ -222,6 +227,8 @@ class scoreModel extends model
|
||||
$this->dao->insert(TABLE_SCORE)->data($data)->exec();
|
||||
|
||||
$this->dao->update(TABLE_USER)->set("`score`=`score` + " . (int)$rule['score'])->set("`scoreLevel`=`scoreLevel` + " . (int)$rule['score'])->where('account')->eq($account)->exec();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -299,6 +299,33 @@ $config->delete['16_5_beta1'][] = 'module/project/ext/css/task/execl.css';
|
||||
$config->delete['16_5_beta1'][] = 'module/project/ext/js/taskeffort/taskeffort.js';
|
||||
$config->delete['16_5_beta1'][] = 'module/project/ext/js/effort/effort.js';
|
||||
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/action/ext/model/class/flow.class.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/action/ext/model/flow.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/flow/ext/control/export.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/flow/ext/control/exporttemplate.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/flow/ext/view/autoimport.html.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/flow/ext/view/browse.html.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/workflow/ext/control/flowchart.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/workflowcondition/ext/view/browse.html.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/workflowhook/ext/view/browse.html.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/group/ext/lang/zh-cn/aflow.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/group/ext/lang/zh-cn/zflow.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/group/ext/model/class/flow.class.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/biz/group/ext/model/flow.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/action/ext/model/class/flow.class.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/action/ext/model/flow.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/flow/ext/control/export.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/flow/ext/control/exporttemplate.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/flow/ext/view/autoimport.html.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/flow/ext/view/browse.html.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/workflow/ext/control/flowchart.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/workflowcondition/ext/view/browse.html.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/workflowhook/ext/view/browse.html.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/group/ext/lang/zh-cn/aflow.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/group/ext/lang/zh-cn/zflow.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/group/ext/model/class/flow.class.php';
|
||||
$config->delete['17_0_beta1'][] = 'extension/max/group/ext/model/flow.php';
|
||||
|
||||
$config->upgrade->openModules = array('action', 'admin', 'api', 'automation', 'backup', 'block', 'branch', 'budget', 'bug', 'build', 'caselib', 'ci', 'client', 'common', 'company', 'compile', 'convert', 'cron', 'custom', 'datatable', 'dept', 'design', 'dev', 'doc', 'durationestimation', 'entry', 'execution', 'extension', 'file', 'git', 'gitlab', 'group', 'holiday', 'im', 'index', 'index.html', 'install', 'issue', 'jenkins', 'job', 'kanban', 'license', 'mail', 'message', 'misc', 'mr', 'my', 'personnel', 'pipeline', 'product', 'productplan', 'productset', 'program', 'programplan', 'project', 'projectbuild', 'projectrelease', 'projectstory', 'qa', 'release', 'repo', 'report', 'risk', 'score', 'search', 'setting', 'sonarqube', 'sso', 'stage', 'stakeholder', 'story', 'subject', 'svn', 'task', 'testcase', 'testreport', 'testsuite', 'testtask', 'todo', 'tree', 'tutorial', 'upgrade', 'user', 'webhook', 'weekly', 'workestimation');
|
||||
|
||||
$config->upgrade->unsetModules = array('design', 'program', 'programplan', 'projectbuild', 'projectrelease', 'stage', 'stakeholder', 'product', 'branch', 'productplan', 'release', 'build', 'qa', 'bug', 'testcase', 'testtask', 'testreport', 'testsuite', 'caselib', 'automation', 'repo', 'ci', 'compile', 'jenkins', 'job', 'svn', 'gitlab', 'sonarqube', 'mr', 'git', 'report', 'sqlbuilder', 'feedback', 'faq', 'attend', 'holiday', 'leave', 'makeup', 'overtime', 'lieu', 'ops', 'host', 'serverroom', 'account', 'domain', 'service', 'deploy', 'conference', 'traincourse', 'pssp', 'baseline', 'classify', 'cm', 'cmcl', 'auditcl', 'reviewcl', 'process', 'activity', 'zoutput', 'auditplan', 'nc', 'subject', 'weekly', 'workestimation', 'issue', 'durationestimation', 'risk', 'opportunity', 'trainplan', 'gapanalysis', 'researchplan', 'researchreport', 'meeting', 'meetingroom', 'budget', 'reviewissue', 'reviewsetting', 'review', 'milestone', 'measurement', 'measrecord', 'assetlib', 'setting', 'im', 'client', 'ldap', 'dev', 'api');
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
class scoreTest
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel = $tester->loadModel('score');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user score list.
|
||||
*
|
||||
* @param string $account
|
||||
* @param object $pager
|
||||
* @param bool $needCount
|
||||
*
|
||||
* @access public
|
||||
* @return array|int
|
||||
*/
|
||||
public function getListByAccountTest($account, $pager, $needCount = false)
|
||||
{
|
||||
$objects = $this->objectModel->getListByAccount($account, $pager);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $needCount ? count($objects) : $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add score logs.
|
||||
*
|
||||
* @param string $module
|
||||
* @param string $method
|
||||
* @param string $param
|
||||
* @param string $account
|
||||
* @param string $time
|
||||
*
|
||||
* @access public
|
||||
* @return string|object
|
||||
*/
|
||||
public function createTest($module = '', $method = '', $param = '', $account = '', $time = '')
|
||||
{
|
||||
global $tester;
|
||||
|
||||
$object = $this->objectModel->create($module, $method, $param, $account, $time);
|
||||
|
||||
if(dao::isError())
|
||||
{
|
||||
return dao::getError();
|
||||
}
|
||||
else
|
||||
{
|
||||
$object = (!empty((array) $object) and is_object($object)) ? $object : '';
|
||||
}
|
||||
|
||||
return $object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Score reset.
|
||||
*
|
||||
* @param int $lastID
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function resetTest($lastID = 0)
|
||||
{
|
||||
$result = $this->objectModel->reset($lastID);
|
||||
while($result['status'] != 'finish')
|
||||
{
|
||||
$result = $this->objectModel->reset($result['lastID']);
|
||||
}
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix action type for score.
|
||||
*
|
||||
* @param $string
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function fixKeyTest($string)
|
||||
{
|
||||
$objects = $this->objectModel->fixKey($string);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
+95
-54
@@ -12,7 +12,7 @@ class searchTest
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getQueryTest($queryID)
|
||||
{
|
||||
@@ -37,7 +37,7 @@ class searchTest
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getByIDTest($queryID)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ class searchTest
|
||||
*
|
||||
* @param int $queryID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return int
|
||||
*/
|
||||
public function deleteQueryTest($queryID)
|
||||
{
|
||||
@@ -69,9 +69,9 @@ class searchTest
|
||||
/**
|
||||
* Test get query pairs.
|
||||
*
|
||||
* @param int $module
|
||||
* @param string $module
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getQueryPairsTest($module)
|
||||
{
|
||||
@@ -85,10 +85,10 @@ class searchTest
|
||||
/**
|
||||
* Test get list.
|
||||
*
|
||||
* @param int $keywords
|
||||
* @param int $type
|
||||
* @param string $keywords
|
||||
* @param sreing $type
|
||||
* @access public
|
||||
* @return void
|
||||
* @return int
|
||||
*/
|
||||
public function getListTest($keywords, $type)
|
||||
{
|
||||
@@ -119,10 +119,10 @@ class searchTest
|
||||
/**
|
||||
* Test save index.
|
||||
*
|
||||
* @param int $objectType
|
||||
* @param string $objectType
|
||||
* @param int $objectID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public function saveIndexTest($objectType, $objectID)
|
||||
{
|
||||
@@ -150,7 +150,7 @@ class searchTest
|
||||
*
|
||||
* @param string $word
|
||||
* @access public
|
||||
* @return void
|
||||
* @return int
|
||||
*/
|
||||
public function saveDictTest($word)
|
||||
{
|
||||
@@ -171,69 +171,110 @@ class searchTest
|
||||
/**
|
||||
* Test decode.
|
||||
*
|
||||
* @param int $string
|
||||
* @param int $key
|
||||
* @access public
|
||||
* @return void
|
||||
* @return string
|
||||
*/
|
||||
public function decodeTest($string)
|
||||
public function decodeTest($key)
|
||||
{
|
||||
$objects = $this->objectModel->decode($string);
|
||||
global $tester;
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
$result = array();
|
||||
while(!isset($result['finished']))
|
||||
{
|
||||
if(empty($result))
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex($result['type'], $result['lastID']);
|
||||
}
|
||||
}
|
||||
|
||||
$objects = $this->objectModel->decode($key);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function getSummaryTest($content, $words)
|
||||
/**
|
||||
* Test get summary.
|
||||
*
|
||||
* @param int $indexID
|
||||
* @param string $words
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getSummaryTest($indexID, $words)
|
||||
{
|
||||
$objects = $this->objectModel->getSummary($content, $words);
|
||||
global $tester;
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
$result = array();
|
||||
while(!isset($result['finished']))
|
||||
{
|
||||
if(empty($result))
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex($result['type'], $result['lastID']);
|
||||
}
|
||||
}
|
||||
|
||||
$searchIndex = $tester->dao->select('*')->from(TABLE_SEARCHINDEX)->where('id')->eq($indexID)->fetch();
|
||||
|
||||
$objects = $this->objectModel->getSummary($searchIndex->content, $words);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function checkPrivTest($results)
|
||||
/**
|
||||
* Test mark keywords.
|
||||
*
|
||||
* @param int $indexID
|
||||
* @param string $keywords
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function markKeywordsTest($indexID, $keywords)
|
||||
{
|
||||
$objects = $this->objectModel->checkPriv($results);
|
||||
global $tester;
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
$result = array();
|
||||
while(!isset($result['finished']))
|
||||
{
|
||||
if(empty($result))
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->objectModel->buildAllIndex($result['type'], $result['lastID']);
|
||||
}
|
||||
}
|
||||
|
||||
$searchIndex = $tester->dao->select('*')->from(TABLE_SEARCHINDEX)->where('id')->eq($indexID)->fetch();
|
||||
|
||||
$objects = $this->objectModel->markKeywords($searchIndex->content, $keywords);
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function markKeywordsTest($content, $keywords)
|
||||
{
|
||||
$objects = $this->objectModel->markKeywords($content, $keywords);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function buildAllIndexTest($type = '', $lastID = 0)
|
||||
{
|
||||
$objects = $this->objectModel->buildAllIndex($type = '', $lastID = 0);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function deleteIndexTest($objectType, $objectID)
|
||||
{
|
||||
$objects = $this->objectModel->deleteIndex($objectType, $objectID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function appendFilesTest($object)
|
||||
{
|
||||
$objects = $this->objectModel->appendFiles($object);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHINDEX)->exec();
|
||||
$tester->dao->delete()->from(TABLE_SEARCHDICT)->exec();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/score.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 scoreModel->create();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$moduleList = array('user', 'story', 'task', 'bug', 'execution', 'product');
|
||||
$methodList = array('login', 'close', 'finish', 'confirmBug', 'close', 'edit');
|
||||
$accountList = array('admin', 'dev10', 'test10', 'top10');
|
||||
|
||||
$bug = new stdclass();
|
||||
$bug->id = '1';
|
||||
$bug->openedBy = 'admin';
|
||||
$bug->severity = '1';
|
||||
|
||||
$execution = new stdclass();
|
||||
$execution->id = '701';
|
||||
$execution->PM = 'admin';
|
||||
$execution->end = '2022-05-14';
|
||||
|
||||
$score = new scoreTest();
|
||||
|
||||
r($score->createTest($moduleList[1], $methodList[1], '402')) && p('') && e('0'); // 关闭一个不存在创建者的需求
|
||||
r($score->createTest($moduleList[1], $methodList[1], '9')) && p('score') && e('2'); // 关闭一个存在创建者的需求
|
||||
r($score->createTest($moduleList[2], $methodList[2], '601')) && p('') && e('0'); // ID为601 的任务有子任务,完成不计算积分
|
||||
r($score->createTest($moduleList[2], $methodList[2], '2')) && p('score') && e('2'); // ID为2 的任务,优先级为2,消耗4h, 预计1h
|
||||
r($score->createTest($moduleList[3], $methodList[3], $bug)) && p('score') && e('4'); // 确认严重程度为1的bug
|
||||
r($score->createTest($moduleList[4], $methodList[4], $execution, 'admin', '2022-05-11')) && p('score') && e('30'); // 在截止时间内关闭一个项目经理为admin的执行
|
||||
r($score->createTest($moduleList[5], $methodList[5])) && p('') && e('0'); // product模块的edit方法不存在与积分规则中,不计算积分
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/score.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 scoreModel->fixKey();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$actionList = array('created', 'opened', 'bugconfirmed', 'fixed');
|
||||
|
||||
$score = new scoreTest();
|
||||
|
||||
r($score->fixKeyTest($actionList[0])) && p('') && e('create'); // action为created
|
||||
r($score->fixKeyTest($actionList[1])) && p('') && e('create'); // action为opened
|
||||
r($score->fixKeyTest($actionList[2])) && p('') && e('confirmBug'); // action为bugconfirmed
|
||||
r($score->fixKeyTest($actionList[3])) && p('') && e('fixed'); // action为fixed, 不存在于strings中
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/score.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 scoreModel->getListByAccount();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
global $tester;
|
||||
$tester->app->loadClass('pager', $static = true);
|
||||
|
||||
$score = new scoreTest();
|
||||
$accountList = array('admin', 'dev10', 'top10', 'adminn');
|
||||
$pager = new pager(0, 15, 1);
|
||||
|
||||
r($score->getListByAccountTest($accountList[0], $pager)) && p('0:account') && e('admin'); // 查看account为admin,每页展示15条,第一页的第一条数据
|
||||
r($score->getListByAccountTest($accountList[1], $pager, true)) && p('') && e('15'); // 查看account为dev10, 每页展示15条,第一页的数据总量
|
||||
r($score->getListByAccountTest($accountList[2], null)) && p('0:account') && e('top10'); // 查看account为top10, 不传pager(默认分页)的第一条数据
|
||||
r($score->getListByAccountTest($accountList[3], null)) && p('0:account') && e('0'); // 查看account为adminn(不存在的用户)的数据
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/score.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 scoreModel->reset();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$score = new scoreTest();
|
||||
|
||||
r($score->resetTest()) && p('status,number') && e('finish,0'); // 重置积分成功
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/search.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 searchModel->appendFiles();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->appendFilesTest()) && p() && e();
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/search.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 searchModel->buildAllIndex();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->buildAllIndexTest()) && p() && e();
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/search.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 searchModel->checkPriv();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->checkPrivTest()) && p() && e();
|
||||
@@ -14,4 +14,4 @@ pid=1
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->decodeTest()) && p() && e();
|
||||
r($search->decodeTest(20135)) && p() && e('产'); //测试将搜索字转化为正确的汉字
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/search.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 searchModel->deleteIndex();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->deleteIndexTest()) && p() && e();
|
||||
@@ -39,7 +39,7 @@ $searchWords = array('任务','bug','用例','文档','待办','版本','用例
|
||||
r($search->getListTest($searchWords[0], $searchType[0])) && p() && e('1246'); //测试在全部类型中搜索带有任务字体的条数
|
||||
r($search->getListTest($searchWords[0], $searchType[1])) && p() && e('910'); //测试在任务类型中搜索带有任务字体的条数
|
||||
r($search->getListTest($searchWords[1], $searchType[2])) && p() && e('239'); //测试在bug类型中搜索带有bug字体的条数
|
||||
r($search->getListTest($searchWords[2], $searchType[3])) && p() && e('208'); //测试在用例类型中搜索带有用例字体的条数
|
||||
r($search->getListTest($searchWords[2], $searchType[3])) && p() && e('97'); //测试在用例类型中搜索带有用例字体的条数
|
||||
r($search->getListTest($searchWords[3], $searchType[4])) && p() && e('900'); //测试在文档类型中搜索带有文档字体的条数
|
||||
r($search->getListTest($searchWords[4], $searchType[5])) && p() && e('1680'); //测试在待办类型中搜索带有待办字体的条数
|
||||
r($search->getListTest($searchWords[5], $searchType[6])) && p() && e('20'); //测试在版本类型中搜索带有版本字体的条数
|
||||
|
||||
@@ -14,4 +14,6 @@ pid=1
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->getSummaryTest()) && p() && e();
|
||||
r($search->getSummaryTest(1, 0)) && p() && e('【步骤】【结果】【期望】'); //测试搜索的内容中不带关键字的结果展示
|
||||
r($search->getSummaryTest(1, 39588)) && p() && e("【步<span class='text-danger'>骤</span> 】【结果】【期望】"); //测试搜索的内容中带关键字的结果展示
|
||||
|
||||
|
||||
@@ -14,4 +14,4 @@ pid=1
|
||||
|
||||
$search = new searchTest();
|
||||
|
||||
r($search->markKeywordsTest()) && p() && e();
|
||||
r($search->markKeywordsTest(1, 39588)) && p() && e("12304 27493 <span class='text-danger'>骤</span> 12305 12304 32467 26524 12305 12304 26399 26395 12305"); //测试查找带骤字的bug
|
||||
|
||||
@@ -130,8 +130,12 @@ switch($argv[1])
|
||||
case 'report':
|
||||
ztfRun('model/report');
|
||||
break;
|
||||
case 'score':
|
||||
ztfRun('model/score');
|
||||
break;
|
||||
case 'sso':
|
||||
ztfRun('model/sso');
|
||||
break;
|
||||
case 'setting':
|
||||
ztfRun('model/setting');
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user