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

This commit is contained in:
Zongjun Lan
2022-03-17 16:31:11 +08:00
81 changed files with 1543 additions and 3136 deletions
-1
View File
@@ -60,4 +60,3 @@ INSERT INTO `zt_config` (`vision`,`owner`, `module`, `section`, `key`, `value`)
INSERT INTO `zt_config` (`vision`,`owner`, `module`, `section`, `key`, `value`) VALUES ('lite','system', 'project', '', 'defaultCurrency', 'CNY');
ALTER TABLE `zt_apistruct` CHANGE `desc` `desc` text COLLATE 'utf8_general_ci' NOT NULL DEFAULT '' AFTER `type`;
ALTER TABLE `zt_review` ADD `doc` mediumint NULL AFTER `template`;
+467 -2
View File
@@ -46,6 +46,14 @@ class bugTest
}
}
/**
* Test batch create bugs.
*
* @param int $productID
* @param array $param
* @access public
* @return object
*/
public function batchCreateObject($productID, $param = array())
{
$modules = array('0', '0', '0');
@@ -108,7 +116,7 @@ class bugTest
* @param array $bug
* @param int $executionID
* @access public
* @return int
* @return object|int
*/
public function createBugFromGitlabIssueTest($bug, $executionID)
{
@@ -129,7 +137,7 @@ class bugTest
* Test get bugs.
*
* @access public
* @return int
* @return string
*/
public function getBugsTest($product, $branch, $browseType, $module)
{
@@ -149,6 +157,463 @@ class bugTest
$title = '';
foreach($bugs as $bug) $title .= ',' . $bug->title;
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test check delay bug.
*
* @param object $bug
* @param string $status
* @access public
* @return object
*/
public function checkDelayBugTest($bug, $status)
{
$bug->status = $status;
$bug->deadline = $bug->deadline ? date('Y-m-d',strtotime("$bug->deadline day")) : '0000-00-00';
$bug->resolvedDate = $bug->resolvedDate ? date('Y-m-d',strtotime("$bug->resolvedDate day")) : '0000-00-00';
$object = $this->objectModel->checkDelayBug($bug);
if(!isset($object->delay)) $object->delay = 0;
if(dao::isError())
{
return dao::getError();
}
else
{
return $object;
}
}
/**
* Test check delay bugs.
*
* @param string $productIDList
* @access public
* @return string
*/
public function checkDelayedBugsTest($productID)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
/* Load pager. */
$tester->app->loadClass('pager', $static = true);
$pager = new pager(0, 20 ,1);
$bugs = $this->objectModel->getAllBugs($productID, 0, 0, $executions, 'id_asc', $pager, 0);
$bugs = $this->objectModel->checkDelayedBugs($bugs);
$delay = '';
foreach($bugs as $bug)
{
$delay .= ',' . (!isset($bug->delay) ? 0 : $bug->delay);
}
$delay = trim($delay, ',');
if(dao::isError())
{
return dao::getError();
}
else
{
return $delay;
}
}
/**
* Test get bugs of a module.
*
* @param string $productIDList
* @param string $moduleIDList
* @access public
* @return string
*/
public function getModuleBugsTest($productIDList, $moduleIDList)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getModuleBugs($productIDList, 'all', $moduleIDList, $executions);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get all bugs.
*
* @param string $productIDList
* @param string $moduleIDList
* @access public
* @return string
*/
public function getAllBugsTest($productIDList, $moduleIDList)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getAllBugs($productIDList, 'all', $moduleIDList, $executions, 'id_desc');
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get bugs of assign to me.
*
* @param string $productIDList
* @param string $moduleIDList
* @access public
* @return string
*/
public function getByAssigntomeTest($productIDList, $moduleIDList)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getByAssigntome($productIDList, 'all', $moduleIDList, $executions, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get bugs of opened by me.
*
* @param string $productIDList
* @param string $moduleIDList
* @access public
* @return string
*/
public function getByOpenedbymeTest($productIDList, $moduleIDList)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getByOpenedbyme($productIDList, 'all', $moduleIDList, $executions, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get bugs of resolved by me.
*
* @param string $productIDList
* @access public
* @return string
*/
public function getByResolvedbymeTest($productIDList)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getByResolvedbyme($productIDList, 'all', '0', $executions, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get bugs of nobody to do.
*
* @param string $productIDList
* @access public
* @return string
*/
public function getByAssigntonullTest($productIDList)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getByAssigntonull($productIDList, 'all', '0', $executions, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get unconfirmed bugs.
*
* @param string $productIDList
* @param string $modules
* @access public
* @return string
*/
public function getUnconfirmedTest($productIDList, $modules)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getUnconfirmed($productIDList, 'all', $modules, $executions, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get bugs the overdueBugs is active or unclosed.
*
* @param string $productIDList
* @param string $modules
* @access public
* @return string
*/
public function getOverdueBugsTest($productIDList, $modules)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getOverdueBugs($productIDList, 'all', $modules, $executions, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get bugs the status is active or unclosed.
*
* @param string $productIDList
* @param string $modules
* @access public
* @return string
*/
public function getByStatusTest($productIDList, $modules, $status)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getByStatus($productIDList, 'all', $modules, $executions, $status, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get unclosed bugs for long time.
*
* @param string $productIDList
* @param string $modules
* @access public
* @return string
*/
public function getByLonglifebugsTest($productIDList, $modules)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getByLonglifebugs($productIDList, 'all', $modules, $executions, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get postponed bugs.
*
* @param string $productIDList
* @access public
* @return string
*/
public function getByPostponedbugsTest($productIDList)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getByPostponedbugs($productIDList, 'all', '0', $executions, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
return dao::getError();
}
else
{
return $title;
}
}
/**
* Test get bugs need confirm.
*
* @param string $productIDList
* @access public
* @return string
*/
public function getByNeedconfirmTest($productIDList)
{
global $tester;
$executions = $tester->loadModel('execution')->getPairs('0', 'all', 'empty|withdelete');
$bugs = $this->objectModel->getByNeedconfirm($productIDList, 'all', '0', $executions, 'id_desc', null, 0);
$title = '';
foreach($bugs as $bug)
{
$title .= ',' . $bug->title;
}
$title = trim($title, ',');
$title = str_replace("'", '', $title);
if(dao::isError())
{
+6 -1
View File
@@ -1263,6 +1263,7 @@ class executionTest
public function getTeamSkipTest($taskID, $begin, $end)
{
global $tester;
$teams = $tester->dao->select('*')->from(TABLE_TEAM)->where('root')->eq($taskID)->andWhere('type')->eq('task')->orderBy('order')->fetchAll('account');
$object = $this->objectModel->getTeamSkip($teams, $begin, $end);
@@ -1591,8 +1592,12 @@ class executionTest
*/
public function getBurnDataFlotTest($executionID = 0, $count)
{
$date = date("Y-m-d");
$object = $this->objectModel->getBurnDataFlot($executionID, $burnBy = 'left');
$todayData = array();
foreach ($object[$date] as $key => $value) $todayData[$key] = $value;
if(dao::isError())
{
$error = dao::getError();
@@ -1600,7 +1605,7 @@ class executionTest
}
elseif($count == "1")
{
return count($object);
return sizeof($todayData);
}
else
{
Regular → Executable
+99 -33
View File
@@ -520,14 +520,8 @@ class userTest
{
$myObjects = $this->objectModel->getObjects($account, $type, $status, $orderBy);
if(dao::isError())
{
return dao::getError();
}
else
{
return $myObjects;
}
if(dao::isError()) return dao::getError();
return $myObjects;
}
/**
@@ -542,14 +536,8 @@ class userTest
{
$contacts = $this->objectModel->getContactLists($account, $params);
if(dao::isError())
{
return dao::getError();
}
else
{
return $contacts;
}
if(dao::isError()) return dao::getError();
return $contacts;
}
/**
@@ -597,7 +585,7 @@ class userTest
*/
public function getContactUserPairsTest($accountList)
{
return $this->objectModel->getContactListByID($listID);
return $this->objectModel->getContactUserPairs($accountList);
}
/**
@@ -612,14 +600,8 @@ class userTest
{
$listID = $this->objectModel->createContactList($listName, $userList);
if(dao::isError())
{
return dao::getError();
}
else
{
return $listID;
}
if(dao::isError()) return dao::getError();
return $this->objectModel->getContactListByID($listID);
}
/**
@@ -635,13 +617,97 @@ class userTest
{
$this->objectModel->updateContactList($listID, $listName, $userList);
if(dao::isError())
{
return dao::getError();
}
else
{
return $this->objectModel->getContactListByID($listID);
}
if(dao::isError()) return dao::getError();
return $this->objectModel->getContactListByID($listID);
}
/**
* Test delete a contact list.
*
* @param int $listID
* @access public
* @return void
*/
public function deleteContactListTest($listID)
{
$this->objectModel->deleteContactList($listID);
if(dao::isError()) return dao::getError();
return $this->objectModel->getContactListByID($listID);
}
/**
* Test delete a contact list.
*
* @param object $user
* @access public
* @return void
*/
public function getDataInJSONTest($user)
{
$user = $this->objectModel->getDataInJSON($user);
if(dao::isError()) return dao::getError();
return $user;
}
/**
* Test get weak users.
*
* @access public
* @return void
*/
public function getWeakUsersTest()
{
$users = $this->objectModel->getWeakUsers();
if(dao::isError()) return dao::getError();
return $users;
}
/**
* Test compute password strength.
*
* @access public
* @return void
*/
public function computePasswordStrengthTest($password)
{
$strength = $this->objectModel->computePasswordStrength($password);
if(dao::isError()) return dao::getError();
return $strength;
}
/**
* Test compute user view.
*
* @param string $account
* @param bool $force
* @access public
* @return void
*/
public function computeUserViewTest($account, $force = false)
{
$userview = $this->objectModel->computeUserView($account, $force);
if(dao::isError()) return dao::getError();
return $userview;
}
/**
* Test get product members.
*
* @param string $account
* @param bool $force
* @access public
* @return void
*/
public function getProductMembersTest($allProducts)
{
$members = $this->objectModel->getProductMembers($allProducts);
if(dao::isError()) return dao::getError();
return $members;
}
}
+13 -5
View File
@@ -11,13 +11,13 @@ fields:
- field: branch
range: 0
- field: module
range: 0
range: 1821-1823,1825-1827,1831-1833,0{1000000}
- field: execution
range: 101-700{3}
- field: plan
range: 0
- field: story
range: 0
range: 2-400:4
- field: storyVersion
range: 1
- field: task
@@ -57,7 +57,7 @@ fields:
- field: color
range: [#3da7f5,#75c941,#2dbdb2,#797ec9,#ffaf38,#ff4e3e]
- field: confirmed
range: [0,1]:R
range: 0,1
- field: activatedCount
range: 0
- field: mailto
@@ -77,8 +77,11 @@ fields:
type: timestamp
format: "YYYY-MM-DD"
- field: deadline
range: "(+2w):60"
range: "(-1M)-(+1w):-1D"
type: timestamp
prefix: ""
postfix: ""
loop: 0
format: "YYYY-MM-DD"
- field: resolvedBy
range: []{50},$assignedTo{30},admin{20}
@@ -87,7 +90,12 @@ fields:
- field: resolvedBuild
range: []{55},trunk{15},[]{25},trunk{5}
- field: resolvedDate
range:
range: "(+1w)-(-2w):-1D"
type: timestamp
prefix: ""
postfix: ""
loop: 0
format: "YYYY-MM-DD"
- field: closedBy
range: []{80},admin{20}
- field: closedDate
+1 -1
View File
@@ -260,7 +260,7 @@ fields:
format: ""
- field: version
note: "版本号"
range: 1
range: 2{100},1{300}
prefix: ""
postfix: ""
loop: 0
+36
View File
@@ -0,0 +1,36 @@
title: table zt_userview
desc: "可访问权限"
author: automated export
version: "1.0"
fields:
- field: account
note: "用户名"
fields:
- field: account1
range: test{100},dev{100},td{100},top{100}
- field: account2
range: 1-100,1-100,1-100,1-100
- field: programs
note: "项目集"
range: 1-10
prefix: ","
postfix: ""
format: ""
- field: products
note: "产品"
range: 1-100
prefix: ","
postfix: ""
format: ""
- field: projects
note: "项目"
range: 11-100
prefix: ","
postfix: ""
format: ""
- field: sprints
note: "迭代"
range: 101-700
prefix: ","
postfix: ""
format: ""
+1
View File
@@ -7,6 +7,7 @@ $builder->todo = array('rows' => 2000, 'extends' => array('todo'));
$builder->effort = array('rows' => 100, 'extends' => array('effort'));
$builder->usergroup = array('rows' => 600, 'extends' => array('usergroup'));
$builder->usercontact = array('rows' => 61, 'extends' => array('usercontact'));
$builder->userview = array('rows' => 400, 'extends' => array('userview'));
$builder->dept = array('rows' => 100, 'extends' => array('dept'));
$builder->action = array('rows' => 100, 'extends' => array('action'));
+31
View File
@@ -91,6 +91,37 @@ class Processor
foreach($users as $account => $user) $this->dao->update(TABLE_USER)->data($user)->where('account')->eq($account)->exec();
$this->dao->update(TABLE_USERCONTACT)->set('account')->eq('admin')->where('account')->like('admin%')->exec();
$productIDList = $this->dao->select('id')->from(TABLE_PRODUCT)->fetchAll();
$projectIDList = $this->dao->select('id')->from(TABLE_PROJECT)->where('type')->eq('project')->fetchAll();
$sprintIDList = $this->dao->select('id')->from(TABLE_EXECUTION)->where('type')->in('sprint,stage,kanban')->fetchAll();
$product = array();
$project = array();
$sprint = array();
foreach($productIDList as $productID) $product[] = $productID->id;
foreach($projectIDList as $projectID) $project[] = $projectID->id;
foreach($sprintIDList as $sprintID) $sprint[] = $sprintID->id;
$products = ",".join(",",$product);
$projects = ",".join(",",$project);
$sprints = ",".join(",",$sprint);
$userViews = new stdclass();
$userViews->account = 'admin';
$userViews->programs = ',1,2,3,4,5,6,7,8,9,10';
$userViews->products = $products;
$userViews->projects = $projects;
$userViews->sprints = $sprints;
$this->dao->insert(TABLE_USERVIEW)->data($userViews)->exec();
$guestViews = new stdclass();
$guestViews->account = 'guest';
$guestViews->programs = '';
$guestViews->products = '';
$guestViews->projects = '';
$guestViews->sprints = '';
$this->dao->insert(TABLE_USERVIEW)->data($guestViews)->exec();
}
/**
+68
View File
@@ -0,0 +1,68 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->checkDelayBug();
cid=1
pid=1
检查deadline在1天前 resolvedDate不存在 状态为未解决的bug是否延期 >> 1
检查deadline在1天前 resolvedDate不存在 状态为已解决的bug是否延期 >> 1
检查deadline在1天前 resolvedDate不存在 状态为已关闭的bug是否延期 >> 1
检查deadline在3天前 resolvedDate在1天前 状态为未解决的bug是否延期 >> 2
检查deadline在3天前 resolvedDate在1天前 状态为已解决的bug是否延期 >> 2
检查deadline在3天前 resolvedDate在1天前 状态为已关闭的bug是否延期 >> 2
检查deadline在3天前 resolvedDate在4天前 状态为未解决的bug是否延期 >> 0
检查deadline在3天前 resolvedDate在4天前 状态为已解决的bug是否延期 >> 0
检查deadline在3天前 resolvedDate在4天前 状态为已关闭的bug是否延期 >> 0
检查deadline在3天后 resolvedDate在4天后 状态为未解决的bug是否延期 >> 1
检查deadline在3天后 resolvedDate在4天后 状态为已解决的bug是否延期 >> 1
检查deadline在3天后 resolvedDate在4天后 状态为已关闭的bug是否延期 >> 1
检查deadline在3天后 resolvedDate在4天前 状态为未解决的bug是否延期 >> 0
检查deadline在3天后 resolvedDate在4天前 状态为已解决的bug是否延期 >> 0
检查deadline在3天后 resolvedDate在4天前 状态为已关闭的bug是否延期 >> 0
*/
$bug1 = new stdclass();
$bug1->deadline = '-1';
$bug1->resolvedDate = '0';
$bug2 = new stdclass();
$bug2->deadline = '-3';
$bug2->resolvedDate = '-1';
$bug3 = new stdclass();
$bug3->deadline = '-3';
$bug3->resolvedDate = '-4';
$bug4 = new stdclass();
$bug4->deadline = '3';
$bug4->resolvedDate = '4';
$bug5 = new stdclass();
$bug5->deadline = '3';
$bug5->resolvedDate = '-4';
$statusList = array('active', 'resolved', 'closed');
$bug = new bugTest();
r($bug->checkDelayBugTest($bug1, $statusList[0])) && p('delay') && e('1'); // 检查deadline在1天前 resolvedDate不存在 状态为未解决的bug是否延期
r($bug->checkDelayBugTest($bug1, $statusList[1])) && p('delay') && e('1'); // 检查deadline在1天前 resolvedDate不存在 状态为已解决的bug是否延期
r($bug->checkDelayBugTest($bug1, $statusList[2])) && p('delay') && e('1'); // 检查deadline在1天前 resolvedDate不存在 状态为已关闭的bug是否延期
r($bug->checkDelayBugTest($bug2, $statusList[0])) && p('delay') && e('2'); // 检查deadline在3天前 resolvedDate在1天前 状态为未解决的bug是否延期
r($bug->checkDelayBugTest($bug2, $statusList[1])) && p('delay') && e('2'); // 检查deadline在3天前 resolvedDate在1天前 状态为已解决的bug是否延期
r($bug->checkDelayBugTest($bug2, $statusList[2])) && p('delay') && e('2'); // 检查deadline在3天前 resolvedDate在1天前 状态为已关闭的bug是否延期
r($bug->checkDelayBugTest($bug3, $statusList[0])) && p('delay') && e('0'); // 检查deadline在3天前 resolvedDate在4天前 状态为未解决的bug是否延期
r($bug->checkDelayBugTest($bug3, $statusList[1])) && p('delay') && e('0'); // 检查deadline在3天前 resolvedDate在4天前 状态为已解决的bug是否延期
r($bug->checkDelayBugTest($bug3, $statusList[2])) && p('delay') && e('0'); // 检查deadline在3天前 resolvedDate在4天前 状态为已关闭的bug是否延期
r($bug->checkDelayBugTest($bug4, $statusList[0])) && p('delay') && e('1'); // 检查deadline在3天后 resolvedDate在4天后 状态为未解决的bug是否延期
r($bug->checkDelayBugTest($bug4, $statusList[1])) && p('delay') && e('1'); // 检查deadline在3天后 resolvedDate在4天后 状态为已解决的bug是否延期
r($bug->checkDelayBugTest($bug4, $statusList[2])) && p('delay') && e('1'); // 检查deadline在3天后 resolvedDate在4天后 状态为已关闭的bug是否延期
r($bug->checkDelayBugTest($bug5, $statusList[0])) && p('delay') && e('0'); // 检查deadline在3天后 resolvedDate在4天前 状态为未解决的bug是否延期
r($bug->checkDelayBugTest($bug5, $statusList[1])) && p('delay') && e('0'); // 检查deadline在3天后 resolvedDate在4天前 状态为已解决的bug是否延期
r($bug->checkDelayBugTest($bug5, $statusList[2])) && p('delay') && e('0'); // 检查deadline在3天后 resolvedDate在4天前 状态为已关闭的bug是否延期
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->checkDelayedBugs();
cid=1
pid=1
检查deadline在resolvedDate前 状态为未解决的bug是否延期 >> 35,33,31
检查deadline在resolvedDate后 状态为未解决的bug是否延期 >> 0,0,0
检查deadline在resolvedDate前 状态为已解决的bug是否延期 >> 10,8,6
检查deadline在resolvedDate后 状态为已解决的bug是否延期 >> 0,0,0
检查deadline在resolvedDate前 状态为已关闭的bug是否延期 >> 6,4,2
检查deadline在resolvedDate后 状态为已关闭的bug是否延期 >> 0,0,0
*/
$productIDList = array('1', '7','18', '20', '28', '33');
$bug = new bugTest();
r($bug->checkDelayedBugsTest($productIDList[0])) && p('delay') && e('35,33,31'); // 检查deadline在resolvedDate前 状态为未解决的bug是否延期
r($bug->checkDelayedBugsTest($productIDList[1])) && p('delay') && e('0,0,0'); // 检查deadline在resolvedDate后 状态为未解决的bug是否延期
r($bug->checkDelayedBugsTest($productIDList[2])) && p('delay') && e('10,8,6'); // 检查deadline在resolvedDate前 状态为已解决的bug是否延期
r($bug->checkDelayedBugsTest($productIDList[3])) && p('delay') && e('0,0,0'); // 检查deadline在resolvedDate后 状态为已解决的bug是否延期
r($bug->checkDelayedBugsTest($productIDList[4])) && p('delay') && e('6,4,2'); // 检查deadline在resolvedDate前 状态为已关闭的bug是否延期
r($bug->checkDelayedBugsTest($productIDList[5])) && p('delay') && e('0,0,0'); // 检查deadline在resolvedDate后 状态为已关闭的bug是否延期
+11 -11
View File
@@ -10,12 +10,12 @@ title=bugModel->createBugFromGitlabIssue ();
cid=1
pid=1
测试正常的创建来源于gitlab issue的bug title >> 问题1
测试短时间内重复创建来源于gitlab issue的bug >> 0
测试正常的创建来源于gitlab issue的bug execution >> 101
测试正常的创建来源于gitlab issue的bug pri >> 3
测试正常的创建来源于gitlab issue的bug severity >> 3
测试创建没有标题 来源于gitlab issue的异常bug >> 『Bug标题』不能为空。
测试正常的创建来源于gitlab issue的bugtitle >> 问题1
测试正常的创建来源于gitlab issue的bug的execution >> 101
测试正常的创建来源于gitlab issue的bug的pri >> 3
测试正常的创建来源于gitlab issue的bug的severity >> 3
测试创建没有标题 来源于gitlab issue的异常bug >> 『Bug标题』不能为空。
测试短时间内重复创建来源于gitlab issue的bug >> 0
*/
@@ -43,11 +43,11 @@ $bug5->title = '';
$bug5->execution = $executionID;
$bug=new bugTest();
r($bug->createBugFromGitlabIssueTest($bug1, $executionID)) && p('title') && e('问题1'); // 测试正常的创建来源于gitlab issue的bug title
r($bug->createBugFromGitlabIssueTest($bug1, $executionID)) && p('task') && e('0'); // 测试短时间内重复创建来源于gitlab issue的bug
r($bug->createBugFromGitlabIssueTest($bug2, $executionID)) && p('execution') && e($executionID); // 测试正常的创建来源于gitlab issue的bug execution
r($bug->createBugFromGitlabIssueTest($bug3, $executionID)) && p('pri') && e('3'); // 测试正常的创建来源于gitlab issue的bug pri
r($bug->createBugFromGitlabIssueTest($bug4, $executionID)) && p('severity') && e('3'); // 测试正常的创建来源于gitlab issue的bug severity
r($bug->createBugFromGitlabIssueTest($bug1, $executionID)) && p('title') && e('问题1'); // 测试正常的创建来源于gitlab issue的bugtitle
r($bug->createBugFromGitlabIssueTest($bug2, $executionID)) && p('execution') && e("$executionID"); // 测试正常的创建来源于gitlab issue的bug的execution
r($bug->createBugFromGitlabIssueTest($bug3, $executionID)) && p('pri') && e('3'); // 测试正常的创建来源于gitlab issue的bug的pri
r($bug->createBugFromGitlabIssueTest($bug4, $executionID)) && p('severity') && e('3'); // 测试正常的创建来源于gitlab issue的bug的severity
r($bug->createBugFromGitlabIssueTest($bug5, $executionID)) && p('title:0') && e('『Bug标题』不能为空。'); // 测试创建没有标题 来源于gitlab issue的异常bug
r($bug->createBugFromGitlabIssueTest($bug1, $executionID)) && p('task') && e('0'); // 测试短时间内重复创建来源于gitlab issue的bug
system("./ztest init");
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getAllBugs();
cid=1
pid=1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825下的bug >> BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下的bug >> 0
查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1
查询产品1 3与模块1821, 1825下的bug >> BUG1
查询产品1 3与模块不存在的模块1000001下的bug >> 0
查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug >> 0
查询不存在的产品10001 与模块1821, 1825下的bug >> 0
查询不存在的产品10001 与不存在的模块1000001下的bug >> 0
*/
$productIDList = array('1,2,3,1000001', '1,3', '1000001');
$moduleIDList = array('1821,1825,1831,1000001', '1821, 1825', '1000001');
$bug=new bugTest();
r($bug->getAllBugsTest($productIDList[0], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug
r($bug->getAllBugsTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下的bug
r($bug->getAllBugsTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下的bug
r($bug->getAllBugsTest($productIDList[1], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1'); // 查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下的bug
r($bug->getAllBugsTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下的bug
r($bug->getAllBugsTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下的bug
r($bug->getAllBugsTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug
r($bug->getAllBugsTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下的bug
r($bug->getAllBugsTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下的bug
+8 -10
View File
@@ -13,12 +13,12 @@ pid=1
查询正常产品 没有分支 查看全部 没有模块的全部bug的标题拼接1 >> BUG3,BUG2,BUG1
查询正常产品 不存在的分支主干 查看全部 没有模块的全部bug的标题拼接 >> BUG3,BUG2,BUG1
查询正常产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接 >> BUG3,BUG2,BUG1
查询正常产品 没有分支 查看全部 模块1821的全部bug的标题拼接 >> 0
查询正常产品 没有分支 查看全部 模块1821的全部bug的标题拼接 >> BUG1
查询正常产品 没有分支 查看全部 模块不存在的全部bug的标题拼接 >> BUG3,BUG2,BUG1
查询多分支产品 没有分支 查看全部 没有模块的全部bug的标题拼接59 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*'":.<>。?/();175
查询多分支产品 主干 查看全部 没有模块的全部bug的标题拼接 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*'":.<>。?/();175
查询多分支产品 没有分支 查看全部 没有模块的全部bug的标题拼接59 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175
查询多分支产品 主干 查看全部 没有模块的全部bug的标题拼接 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175
查询多分支产品 分支37 查看全部 没有模块的全部bug的标题拼接 >> 0
查询多分支产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*'":.<>。?/();175
查询多分支产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接 >> BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175
查询多分支产品 没有分支 查看全部 模块2053的全部bug的标题拼接 >> 0
查询不存在的产品的全部bug的标题拼接 >> 0
@@ -34,13 +34,11 @@ $bug=new bugTest();
r($bug->getBugsTest($productIDList[0], $branchList[0], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG3,BUG2,BUG1'); // 查询正常产品 没有分支 查看全部 没有模块的全部bug的标题拼接1
r($bug->getBugsTest($productIDList[0], $branchList[1], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG3,BUG2,BUG1'); // 查询正常产品 不存在的分支主干 查看全部 没有模块的全部bug的标题拼接
r($bug->getBugsTest($productIDList[0], $branchList[0], $browseTypeList[1], $moduleIDList[0])) && p('title') && e('BUG3,BUG2,BUG1'); // 查询正常产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接
r($bug->getBugsTest($productIDList[0], $branchList[0], $browseTypeList[0], $moduleIDList[1])) && p('title') && e('0'); // 查询正常产品 没有分支 查看全部 模块1821的全部bug的标题拼接
r($bug->getBugsTest($productIDList[0], $branchList[0], $browseTypeList[0], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询正常产品 没有分支 查看全部 模块1821的全部bug的标题拼接
r($bug->getBugsTest($productIDList[0], $branchList[0], $browseTypeList[0], $moduleIDList[3])) && p('title') && e('BUG3,BUG2,BUG1'); // 查询正常产品 没有分支 查看全部 模块不存在的全部bug的标题拼接
r($bug->getBugsTest($productIDList[1], $branchList[0], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*\'":.<>。?/();175'); // 查询多分支产品 没有分支 查看全部 没有模块的全部bug的标题拼接59
r($bug->getBugsTest($productIDList[1], $branchList[1], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*\'":.<>。?/();175'); // 查询多分支产品 主干 查看全部 没有模块的全部bug的标题拼接
r($bug->getBugsTest($productIDList[1], $branchList[0], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175'); // 查询多分支产品 没有分支 查看全部 没有模块的全部bug的标题拼接59
r($bug->getBugsTest($productIDList[1], $branchList[1], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175'); // 查询多分支产品 主干 查看全部 没有模块的全部bug的标题拼接
r($bug->getBugsTest($productIDList[1], $branchList[2], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('0'); // 查询多分支产品 分支37 查看全部 没有模块的全部bug的标题拼接
r($bug->getBugsTest($productIDList[1], $branchList[0], $browseTypeList[1], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*\'":.<>。?/();175'); // 查询多分支产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接
r($bug->getBugsTest($productIDList[1], $branchList[0], $browseTypeList[1], $moduleIDList[0])) && p('title') && e('BUG177,bug176,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();175'); // 查询多分支产品 没有分支 查看未关闭 没有模块的全部bug的标题拼接
r($bug->getBugsTest($productIDList[1], $branchList[0], $browseTypeList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询多分支产品 没有分支 查看全部 模块2053的全部bug的标题拼接
r($bug->getBugsTest($productIDList[2], $branchList[0], $browseTypeList[0], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品的全部bug的标题拼接
system("./ztest init");
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getByAssigntome();
cid=1
pid=1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下指派给我的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825下指派给我的bug >> BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下指派给我的bug >> 0
查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下指派给我的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1
查询产品1 3与模块1821, 1825下指派给我的bug >> BUG1
查询产品1 3与模块不存在的模块1000001下指派给我的bug >> 0
查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下指派给我的bug >> 0
查询不存在的产品10001 与模块1821, 1825下指派给我的bug >> 0
查询不存在的产品10001 与不存在的模块1000001下指派给我的bug >> 0
*/
$productIDList = array('1,2,3,1000001', '1,3', '1000001');
$moduleIDList = array('1821,1825,1831,1000001', '1821, 1825', '1000001');
$bug=new bugTest();
r($bug->getByAssigntomeTest($productIDList[0], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下指派给我的bug
r($bug->getByAssigntomeTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下指派给我的bug
r($bug->getByAssigntomeTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下指派给我的bug
r($bug->getByAssigntomeTest($productIDList[1], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1'); // 查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下指派给我的bug
r($bug->getByAssigntomeTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下指派给我的bug
r($bug->getByAssigntomeTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下指派给我的bug
r($bug->getByAssigntomeTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下指派给我的bug
r($bug->getByAssigntomeTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下指派给我的bug
r($bug->getByAssigntomeTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下指派给我的bug
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getByAssigntonull();
cid=1
pid=1
查询产品1 581 58 不存在的产品10001下由我创建的bug >> BUG174,BUG173,BUG172,BUG93,BUG92,BUG91
查询产品1 58下由我创建的bug >> BUG174,BUG173,BUG172
查询不存在的产品10001下由我创建的bug >> 0
*/
$productIDList = array('1,31,58,1000001', '1,58', '1000001');
$bug=new bugTest();
r($bug->getByAssigntonullTest($productIDList[0])) && p('title') && e('BUG174,BUG173,BUG172,BUG93,BUG92,BUG91'); // 查询产品1 581 58 不存在的产品10001下由我创建的bug
r($bug->getByAssigntonullTest($productIDList[1])) && p('title') && e('BUG174,BUG173,BUG172'); // 查询产品1 58下由我创建的bug
r($bug->getByAssigntonullTest($productIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001下由我创建的bug
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getByLonglifebugs();
cid=1
pid=1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下长时间未关闭的bug >> bug8,BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825下长时间未关闭的bug >> BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下长时间未关闭的bug >> 0
查询产品1 2 3 不存在的产品10001下长时间未关闭的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG2,BUG1
查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下长时间未关闭的bug >> bug8,BUG1
查询产品1 3与模块1821, 1825下长时间未关闭的bug >> BUG1
查询产品1 3与模块不存在的模块1000001下长时间未关闭的bug >> 0
查询产品13 不存在的产品10001下长时间未关闭的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG2,BUG1
查询不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下长时间未关闭的bug >> 0
查询不存在的产品10001 与模块1821, 1825下长时间未关闭的bug >> 0
查询不存在的产品10001 与不存在的模块1000001下长时间未关闭的bug >> 0
查询不存在的产品10001下长时间未关闭的bug >> 0
*/
$productIDList = array('1,2,3,1000001', '1,3', '1000001');
$moduleIDList = array('1821,1825,1832,1000001', '1821, 1825', '1000001', '0');
$bug=new bugTest();
r($bug->getByLonglifebugsTest($productIDList[0], $moduleIDList[0])) && p('title') && e('bug8,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[0], $moduleIDList[3])) && p('title') && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG2,BUG1'); // 查询产品1 2 3 不存在的产品10001下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[1], $moduleIDList[0])) && p('title') && e('bug8,BUG1'); // 查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[1], $moduleIDList[3])) && p('title') && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG2,BUG1'); // 查询产品13 不存在的产品10001下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下长时间未关闭的bug
r($bug->getByLonglifebugsTest($productIDList[2], $moduleIDList[3])) && p('title') && e('0'); // 查询不存在的产品10001下长时间未关闭的bug
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getByOpenedbyme();
cid=1
pid=1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下由我创建的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825下由我创建的bug >> BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下由我创建的bug >> 0
查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下由我创建的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1
查询产品1 3与模块1821, 1825下由我创建的bug >> BUG1
查询产品1 3与模块不存在的模块1000001下由我创建的bug >> 0
查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下由我创建的bug >> 0
查询不存在的产品10001 与模块1821, 1825下由我创建的bug >> 0
查询不存在的产品10001 与不存在的模块1000001下由我创建的bug >> 0
*/
$productIDList = array('1,2,3,1000001', '1,3', '1000001');
$moduleIDList = array('1821,1825,1831,1000001', '1821, 1825', '1000001');
$bug=new bugTest();
r($bug->getByOpenedbymeTest($productIDList[0], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下由我创建的bug
r($bug->getByOpenedbymeTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下由我创建的bug
r($bug->getByOpenedbymeTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下由我创建的bug
r($bug->getByOpenedbymeTest($productIDList[1], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1'); // 查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下由我创建的bug
r($bug->getByOpenedbymeTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下由我创建的bug
r($bug->getByOpenedbymeTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下由我创建的bug
r($bug->getByOpenedbymeTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下由我创建的bug
r($bug->getByOpenedbymeTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下由我创建的bug
r($bug->getByOpenedbymeTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下由我创建的bug
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getByPostponedbugs();
cid=1
pid=1
查询产品25 32 48 100001下被延期的bug >> BUG94,BUG75,BUG74,BUG73
查询产品25下被延期的bug >> BUG75,BUG74,BUG73
查询产品32下被延期的bug >> BUG94
查询产品1下被延期的bug >> 0
查询不存在的产品10001下被延期的bug >> 0
*/
$productIDList = array('25,32,48,1000001', '25' , '32', '1', '1000001');
$bug=new bugTest();
r($bug->getByPostponedBugsTest($productIDList[0])) && p('title') && e('BUG94,BUG75,BUG74,BUG73'); // 查询产品25 32 48 100001下被延期的bug
r($bug->getByPostponedBugsTest($productIDList[1])) && p('title') && e('BUG75,BUG74,BUG73'); // 查询产品25下被延期的bug
r($bug->getByPostponedBugsTest($productIDList[2])) && p('title') && e('BUG94'); // 查询产品32下被延期的bug
r($bug->getByPostponedBugsTest($productIDList[3])) && p('title') && e('0'); // 查询产品1下被延期的bug
r($bug->getByPostponedBugsTest($productIDList[4])) && p('title') && e('0'); // 查询不存在的产品10001下被延期的bug
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getByResolvedbyme();
cid=1
pid=1
查询产品1 29 98 不存在的产品10001 下由我解决的bug >> BUG294,BUG293,BUG292,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();87,BUG86,BUG85
查询产品1 98下由我解决的bug >> BUG294,BUG293,BUG292
查询产品29下由我解决的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();87,BUG86,BUG85
查询不存在的产品10001 下由我解决的bug >> 0
*/
$productIDList = array('1,29,98,1000001', '1,98', '29', '1000001');
$bug=new bugTest();
r($bug->getByResolvedbymeTest($productIDList[0])) && p('title') && e('BUG294,BUG293,BUG292,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();87,BUG86,BUG85'); // 查询产品1 29 98 不存在的产品10001 下由我解决的bug
r($bug->getByResolvedbymeTest($productIDList[1])) && p('title') && e('BUG294,BUG293,BUG292'); // 查询产品1 98下由我解决的bug
r($bug->getByResolvedbymeTest($productIDList[2])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();87,BUG86,BUG85'); // 查询产品29下由我解决的bug
r($bug->getByResolvedbymeTest($productIDList[3])) && p('title') && e('0'); // 查询不存在的产品10001 下由我解决的bug
+75
View File
@@ -0,0 +1,75 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getByStatus();
cid=1
pid=1
查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug >> bug8,BUG1
查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug >> bug8,BUG1
查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug >> 0
查询产品1 3 不存在的产品10001 与模块1821状态为unclosed下未确认的bug >> BUG1
查询产品1 3 不存在的产品10001 与模块1821状态为unresolved下未确认的bug >> BUG1
查询产品1 3 不存在的产品10001 与模块1821状态为toclosed下未确认的bug >> 0
查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为unclosed下未确认的bug >> 0
查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为unresolved下未确认的bug >> 0
查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为toclosed下未确认的bug >> 0
查询产品1 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug >> BUG1
查询产品1 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug >> BUG1
查询产品1 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug >> 0
查询产品1 与模块1821状态为unclosed下未确认的bug >> BUG1
查询产品1 与模块1821状态为unresolved下未确认的bug >> BUG1
查询产品1 与模块1821状态为toclosed下未确认的bug >> 0
查询产品1 与不存在的模块1000001 状态为unclosed下未确认的bug >> 0
查询产品1 与不存在的模块1000001 状态为unresolved下未确认的bug >> 0
查询产品1 与不存在的模块1000001 状态为toclosed下未确认的bug >> 0
查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug >> 0
查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug >> 0
查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug >> 0
查询不存在的产品10001 与模块1821状态为unclosed下未确认的bug >> 0
查询不存在的产品10001 与模块1821状态为unresolved下未确认的bug >> 0
查询不存在的产品10001 与模块1821状态为toclosed下未确认的bug >> 0
查询不存在的产品10001 与不存在的模块1000001 状态为unclosed下未确认的bug >> 0
查询不存在的产品10001 与不存在的模块1000001 状态为unresolved下未确认的bug >> 0
查询不存在的产品10001 与不存在的模块1000001 状态为toclosed下未确认的bug >> 0
*/
$productIDList = array('1,3,1000001', '1', '1000001');
$moduleIDList = array('1821,1832,1000001', '1821', '1000001', '0');
$statusList = array('unclosed', 'unresolved', 'toclosed');
$bug=new bugTest();
r($bug->getByStatusTest($productIDList[0], $moduleIDList[0], $statusList[0])) && p('title') && e('bug8,BUG1'); // 查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug
r($bug->getByStatusTest($productIDList[0], $moduleIDList[0], $statusList[1])) && p('title') && e('bug8,BUG1'); // 查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug
r($bug->getByStatusTest($productIDList[0], $moduleIDList[0], $statusList[2])) && p('title') && e('0'); // 查询产品1 3 不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug
r($bug->getByStatusTest($productIDList[0], $moduleIDList[1], $statusList[0])) && p('title') && e('BUG1'); // 查询产品1 3 不存在的产品10001 与模块1821状态为unclosed下未确认的bug
r($bug->getByStatusTest($productIDList[0], $moduleIDList[1], $statusList[1])) && p('title') && e('BUG1'); // 查询产品1 3 不存在的产品10001 与模块1821状态为unresolved下未确认的bug
r($bug->getByStatusTest($productIDList[0], $moduleIDList[1], $statusList[2])) && p('title') && e('0'); // 查询产品1 3 不存在的产品10001 与模块1821状态为toclosed下未确认的bug
r($bug->getByStatusTest($productIDList[0], $moduleIDList[2], $statusList[0])) && p('title') && e('0'); // 查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为unclosed下未确认的bug
r($bug->getByStatusTest($productIDList[0], $moduleIDList[2], $statusList[1])) && p('title') && e('0'); // 查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为unresolved下未确认的bug
r($bug->getByStatusTest($productIDList[0], $moduleIDList[2], $statusList[2])) && p('title') && e('0'); // 查询产品1 3 不存在的产品10001 与不存在的模块1000001 状态为toclosed下未确认的bug
r($bug->getByStatusTest($productIDList[1], $moduleIDList[0], $statusList[0])) && p('title') && e('BUG1'); // 查询产品1 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug
r($bug->getByStatusTest($productIDList[1], $moduleIDList[0], $statusList[1])) && p('title') && e('BUG1'); // 查询产品1 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug
r($bug->getByStatusTest($productIDList[1], $moduleIDList[0], $statusList[2])) && p('title') && e('0'); // 查询产品1 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug
r($bug->getByStatusTest($productIDList[1], $moduleIDList[1], $statusList[0])) && p('title') && e('BUG1'); // 查询产品1 与模块1821状态为unclosed下未确认的bug
r($bug->getByStatusTest($productIDList[1], $moduleIDList[1], $statusList[1])) && p('title') && e('BUG1'); // 查询产品1 与模块1821状态为unresolved下未确认的bug
r($bug->getByStatusTest($productIDList[1], $moduleIDList[1], $statusList[2])) && p('title') && e('0'); // 查询产品1 与模块1821状态为toclosed下未确认的bug
r($bug->getByStatusTest($productIDList[1], $moduleIDList[2], $statusList[0])) && p('title') && e('0'); // 查询产品1 与不存在的模块1000001 状态为unclosed下未确认的bug
r($bug->getByStatusTest($productIDList[1], $moduleIDList[2], $statusList[1])) && p('title') && e('0'); // 查询产品1 与不存在的模块1000001 状态为unresolved下未确认的bug
r($bug->getByStatusTest($productIDList[1], $moduleIDList[2], $statusList[2])) && p('title') && e('0'); // 查询产品1 与不存在的模块1000001 状态为toclosed下未确认的bug
r($bug->getByStatusTest($productIDList[2], $moduleIDList[0], $statusList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unclosed下未确认的bug
r($bug->getByStatusTest($productIDList[2], $moduleIDList[0], $statusList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为unresolved下未确认的bug
r($bug->getByStatusTest($productIDList[2], $moduleIDList[0], $statusList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1832 不存在的模块1000001 状态为toclosed下未确认的bug
r($bug->getByStatusTest($productIDList[2], $moduleIDList[1], $statusList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821状态为unclosed下未确认的bug
r($bug->getByStatusTest($productIDList[2], $moduleIDList[1], $statusList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821状态为unresolved下未确认的bug
r($bug->getByStatusTest($productIDList[2], $moduleIDList[1], $statusList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821状态为toclosed下未确认的bug
r($bug->getByStatusTest($productIDList[2], $moduleIDList[2], $statusList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001 状态为unclosed下未确认的bug
r($bug->getByStatusTest($productIDList[2], $moduleIDList[2], $statusList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001 状态为unresolved下未确认的bug
r($bug->getByStatusTest($productIDList[2], $moduleIDList[2], $statusList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001 状态为toclosed下未确认的bug
+38
View File
@@ -0,0 +1,38 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getModuleBugs();
cid=1
pid=1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825下的bug >> BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下的bug >> 0
查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下的bug >> 缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1
查询产品1 3与模块1821, 1825下的bug >> BUG1
查询产品1 3与模块不存在的模块1000001下的bug >> 0
查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug >> 0
查询不存在的产品10001 与模块1821, 1825下的bug >> 0
查询不存在的产品10001 与不存在的模块1000001下的bug >> 0
*/
$productIDList = array('1,2,3,1000001', '1,3', '1000001');
$moduleIDList = array('1821,1825,1831,1000001', '1821, 1825', '1000001');
$bug=new bugTest();
r($bug->getModuleBugsTest($productIDList[0], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug
r($bug->getModuleBugsTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下的bug
r($bug->getModuleBugsTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下的bug
r($bug->getModuleBugsTest($productIDList[1], $moduleIDList[0])) && p('title') && e('缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG1'); // 查询产品1 3与模块1821, 1825, 1831 不存在的模块1000001下的bug
r($bug->getModuleBugsTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下的bug
r($bug->getModuleBugsTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下的bug
r($bug->getModuleBugsTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1831 不存在的模块1000001下的bug
r($bug->getModuleBugsTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下的bug
r($bug->getModuleBugsTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下的bug
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getOverdueBugs();
cid=1
pid=1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug >> bug8,BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825下过期未解决的bug >> BUG4,BUG1
查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下过期未解决的bug >> 0
查询产品1 2 3 不存在的产品10001下过期未解决的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG2,BUG1
查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug >> bug8,BUG1
查询产品1 3与模块1821, 1825下过期未解决的bug >> BUG1
查询产品1 3与模块不存在的模块1000001下过期未解决的bug >> 0
查询产品13 不存在的产品10001下过期未解决的bug >> BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG2,BUG1
查询不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug >> 0
查询不存在的产品10001 与模块1821, 1825下过期未解决的bug >> 0
查询不存在的产品10001 与不存在的模块1000001下过期未解决的bug >> 0
查询不存在的产品10001下过期未解决的bug >> 0
*/
$productIDList = array('1,2,3,1000001', '1,3', '1000001');
$moduleIDList = array('1821,1825,1832,1000001', '1821, 1825', '1000001', '0');
$bug=new bugTest();
r($bug->getOverdueBugsTest($productIDList[0], $moduleIDList[0])) && p('title') && e('bug8,BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG4,BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[0], $moduleIDList[3])) && p('title') && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG6,BUG5,BUG4,BUG3,BUG2,BUG1'); // 查询产品1 2 3 不存在的产品10001下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[1], $moduleIDList[0])) && p('title') && e('bug8,BUG1'); // 查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[1], $moduleIDList[3])) && p('title') && e('BUG9,bug8,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG2,BUG1'); // 查询产品13 不存在的产品10001下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下过期未解决的bug
r($bug->getOverdueBugsTest($productIDList[2], $moduleIDList[3])) && p('title') && e('0'); // 查询不存在的产品10001下过期未解决的bug
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/bug.class.php';
su('admin');
/**
title=bugModel->getUnconfirmed();
cid=1
pid=1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug >> BUG1
查询产品1 2 3 不存在的产品10001 与模块1821, 1825下未确认的bug >> BUG1
查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下未确认的bug >> 0
查询产品1 2 3 不存在的产品10001下未确认的bug >> BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG5,BUG3,BUG1
查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug >> BUG1
查询产品1 3与模块1821, 1825下未确认的bug >> BUG1
查询产品1 3与模块不存在的模块1000001下未确认的bug >> 0
查询产品13 不存在的产品10001下未确认的bug >> BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG1
查询不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug >> 0
查询不存在的产品10001 与模块1821, 1825下未确认的bug >> 0
查询不存在的产品10001 与不存在的模块1000001下未确认的bug >> 0
查询不存在的产品10001下未确认的bug >> 0
*/
$productIDList = array('1,2,3,1000001', '1,3', '1000001');
$moduleIDList = array('1821,1825,1832,1000001', '1821, 1825', '1000001', '0');
$bug=new bugTest();
r($bug->getUnconfirmedTest($productIDList[0], $moduleIDList[0])) && p('title') && e('BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug
r($bug->getUnconfirmedTest($productIDList[0], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 2 3 不存在的产品10001 与模块1821, 1825下未确认的bug
r($bug->getUnconfirmedTest($productIDList[0], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 2 3 不存在的产品10001 与不存在的模块1000001下未确认的bug
r($bug->getUnconfirmedTest($productIDList[0], $moduleIDList[3])) && p('title') && e('BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG5,BUG3,BUG1'); // 查询产品1 2 3 不存在的产品10001下未确认的bug
r($bug->getUnconfirmedTest($productIDList[1], $moduleIDList[0])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug
r($bug->getUnconfirmedTest($productIDList[1], $moduleIDList[1])) && p('title') && e('BUG1'); // 查询产品1 3与模块1821, 1825下未确认的bug
r($bug->getUnconfirmedTest($productIDList[1], $moduleIDList[2])) && p('title') && e('0'); // 查询产品1 3与模块不存在的模块1000001下未确认的bug
r($bug->getUnconfirmedTest($productIDList[1], $moduleIDList[3])) && p('title') && e('BUG9,缺陷!@()(){}|+=%^&*$#测试bug名称到底可以有多长!@#¥%&*":.<>。?/();7,BUG3,BUG1'); // 查询产品13 不存在的产品10001下未确认的bug
r($bug->getUnconfirmedTest($productIDList[2], $moduleIDList[0])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825, 1832 不存在的模块1000001下未确认的bug
r($bug->getUnconfirmedTest($productIDList[2], $moduleIDList[1])) && p('title') && e('0'); // 查询不存在的产品10001 与模块1821, 1825下未确认的bug
r($bug->getUnconfirmedTest($productIDList[2], $moduleIDList[2])) && p('title') && e('0'); // 查询不存在的产品10001 与不存在的模块1000001下未确认的bug
r($bug->getUnconfirmedTest($productIDList[2], $moduleIDList[3])) && p('title') && e('0'); // 查询不存在的产品10001下未确认的bug
+6 -6
View File
@@ -10,9 +10,9 @@ title=测试executionModel->getBurnDataFlotTest();
cid=1
pid=1
敏捷执行查询统计 >> 2
瀑布执行查询统计 >> 2
看板执行查询统计 >> 1
敏捷执行查询统计 >> 3
瀑布执行查询统计 >> 3
看板执行查询统计 >> 3
*/
@@ -20,6 +20,6 @@ $executionIDList = array('101', '131', '161');
$count = array('0','1');
$execution = new executionTest();
r($execution->getBurnDataFlotTest($executionIDList[0], $count[1])) && p() && e('2'); // 敏捷执行查询统计
r($execution->getBurnDataFlotTest($executionIDList[1], $count[1])) && p() && e('2'); // 瀑布执行查询统计
r($execution->getBurnDataFlotTest($executionIDList[2], $count[1])) && p() && e('1'); // 看板执行查询统计
r($execution->getBurnDataFlotTest($executionIDList[0], $count[1])) && p() && e('3'); // 敏捷执行查询统计
r($execution->getBurnDataFlotTest($executionIDList[1], $count[1])) && p() && e('3'); // 瀑布执行查询统计
r($execution->getBurnDataFlotTest($executionIDList[2], $count[1])) && p() && e('3'); // 看板执行查询统计
@@ -1,32 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/execution.class.php';
su('admin');
/**
title=测试executionModel->getKanbanGroupDataTest();
cid=1
pid=1
敏捷执行查询 >> 子任务6,101
瀑布执行查询 >> 更多任务93,131
看板执行查询 >> 开发任务71,161
敏捷执行查询统计 >> 11
瀑布执行查询统计 >> 4
看板执行查询统计 >> 4
*/
$executionIDList = array('101', '131', '161');
$count = array('0', '1');
$execution = new executionTest();
var_dump($execution->getKanbanGroupDataTest($executionIDList[0], $count[0]));die;
r($execution->getKanbanGroupDataTest($executionIDList[0], $count[0])) && p('906:name,execution') && e('子任务6,101'); // 敏捷执行查询
r($execution->getKanbanGroupDataTest($executionIDList[1], $count[0])) && p('693:name,execution') && e('更多任务93,131'); // 瀑布执行查询
r($execution->getKanbanGroupDataTest($executionIDList[2], $count[0])) && p('61:name,execution') && e('开发任务71,161'); // 看板执行查询
r($execution->getKanbanGroupDataTest($executionIDList[0], $count[1])) && p() && e('11'); // 敏捷执行查询统计
r($execution->getKanbanGroupDataTest($executionIDList[1], $count[1])) && p() && e('4'); // 瀑布执行查询统计
r($execution->getKanbanGroupDataTest($executionIDList[2], $count[1])) && p() && e('4'); // 看板执行查询统计
+4 -4
View File
@@ -11,7 +11,7 @@ cid=1
pid=1
全部执行计划查询 >> 长名称
执行计划查询 >> 1.1 [2021-05-23 ~ 2021-09-23]
执行计划查询 >> 1.1
全部执行计划查询 >> 2
*/
@@ -21,6 +21,6 @@ $executionIDList = array('0','101');
$count = array('0','1');
$execution = new executionTest();
r($execution->getPlansTest($productIDList, $executionIDList[0], $count[0])) && p('1:3') && e('长名称'); // 全部执行计划查询
r($execution->getPlansTest($productIDList, $executionIDList[1], $count[0])) && p('1:2') && e('1.1 [2021-05-23 ~ 2021-09-23]'); // 执行计划查询
r($execution->getPlansTest($productIDList, $executionIDList[0], $count[1])) && p() && e('2'); // 全部执行计划查询
r($execution->getPlansTest($productIDList, $executionIDList[0], $count[0])) && p('1:3') && e('长名称'); // 全部执行计划查询
r($execution->getPlansTest($productIDList, $executionIDList[1], $count[0])) && p('1:2') && e('1.1'); // 执行计划查询
r($execution->getPlansTest($productIDList, $executionIDList[0], $count[1])) && p() && e('2'); // 全部执行计划查询
+2 -2
View File
@@ -34,7 +34,7 @@ doing任务查询统计 >> 1
undone任务查询统计 >> 3
done任务查询统计 >> 1
根据查询条件查询任务统计 >> 1
根据模块查询任务统计 >> 2
根据模块查询任务统计 >> 8
name_asc,id_asc排序查询统计 >> 4
id_asc排序查询统计 >> 4
pri_desc,id_desc排序查询统计 >> 4
@@ -74,7 +74,7 @@ r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[3],
r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[4],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('3'); // undone任务查询统计
r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[5],$queryID[0],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // done任务查询统计
r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[7],$queryID[1],$moduleID[0],$sort[0],$count[1])) && p() && e('1'); // 根据查询条件查询任务统计
r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[1])) && p() && e('2'); // 根据模块查询任务统计
r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[1],$sort[0],$count[1])) && p() && e('8'); // 根据模块查询任务统计
r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[1],$count[1])) && p() && e('4'); // name_asc,id_asc排序查询统计
r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[2],$count[1])) && p() && e('4'); // id_asc排序查询统计
r($execution->getTasksTest($productIDList[0],$executionIDList[1],$browseType[0],$queryID[0],$moduleID[0],$sort[3],$count[1])) && p() && e('4'); // pri_desc,id_desc排序查询统计
+6 -6
View File
@@ -10,17 +10,17 @@ title=测试executionModel->getTeamSkipTest();
cid=1
pid=1
正常跳过 >> 901,admin,研发
正常跳过 >> 901,user92,研发
begin与end一致 >> 无跳转数据
end与begin一致 >> 无跳转数据
*/
$taskID = 901;
$begin = 'admin';
$end = 'user92';
$begin = 'user92';
$end = 'user93';
$execution = new executionTest();
r($execution->getTeamSkipTest($taskID, $begin, $end)) && p('admin:root,account,role') && e('901,admin,研发'); // 正常跳过
r($execution->getTeamSkipTest($taskID, $begin, $begin)) && p() && e('无跳转数据'); // begin与end一致
r($execution->getTeamSkipTest($taskID, $end, $end)) && p() && e('无跳转数据'); // end与begin一致
r($execution->getTeamSkipTest($taskID, $begin, $end)) && p('user92:root,account,role') && e('901,user92,研发'); // 正常跳过
r($execution->getTeamSkipTest($taskID, $begin, $begin)) && p() && e('无跳转数据'); // begin与end一致
r($execution->getTeamSkipTest($taskID, $end, $end)) && p() && e('无跳转数据'); // end与begin一致
+4 -4
View File
@@ -11,8 +11,8 @@ cid=1
pid=1
敏捷执行查询统计 >> 29
瀑布执行查询统计 >> 60
看板执行查询统计 >> 60
瀑布执行查询统计 >> 59
看板执行查询统计 >> 62
错误时间查询统计 >> 0
*/
@@ -25,6 +25,6 @@ $count = array('0','1');
$execution = new executionTest();
r($execution->processBurnDataTest($executionIDList[0], $itemCounts[0], $begin[0], $end[0], $count[1])) && p() && e('29'); // 敏捷执行查询统计
r($execution->processBurnDataTest($executionIDList[1], $itemCounts[1], $begin[0], $end[0], $count[1])) && p() && e('60'); // 瀑布执行查询统计
r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[0], $end[0], $count[1])) && p() && e('60'); // 看板执行查询统计
r($execution->processBurnDataTest($executionIDList[1], $itemCounts[1], $begin[0], $end[0], $count[1])) && p() && e('59'); // 瀑布执行查询统计
r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[0], $end[0], $count[1])) && p() && e('62'); // 看板执行查询统计
r($execution->processBurnDataTest($executionIDList[2], $itemCounts[2], $begin[1], $end[1], $count[1])) && p() && e('0'); // 错误时间查询统计
+2 -2
View File
@@ -10,7 +10,7 @@ title=测试executionModel->statRelatedDataTest();
cid=1
pid=1
敏捷执行数据统计 >> 3
敏捷执行数据统计 >> 2
瀑布执行数据统计 >> 4
看板执行数据统计 >> 3
@@ -19,6 +19,6 @@ pid=1
$executionIDList = array('101', '131', '161');
$execution = new executionTest();
r($execution->statRelatedDataTest($executionIDList[0])) && p('storyCount') && e('3'); // 敏捷执行数据统计
r($execution->statRelatedDataTest($executionIDList[0])) && p('storyCount') && e('2'); // 敏捷执行数据统计
r($execution->statRelatedDataTest($executionIDList[1])) && p('taskCount') && e('4'); // 瀑布执行数据统计
r($execution->statRelatedDataTest($executionIDList[2])) && p('bugCount') && e('3'); // 看板执行数据统计
+2 -2
View File
@@ -11,7 +11,7 @@ cid=1
pid=1
测试重复迭代code >> 『迭代代号』已经有『project1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
测试修改迭代名称 >> name,迭代1,任务名修改
测试修改迭代名称 >> name,迭代1,迭代名修改
测试修改迭代项目为瀑布项目 >> project,11,41
测试修改迭代项目为看板项目 >> project,41,71
测试修改迭代code >> code,project31,code修改
@@ -44,7 +44,7 @@ $repeatcode = array('name' => '迭代名修改1');
$execution = new executionTest();
r($execution->updateObject($executionIDList[0], $repeatcode)) && p('code:0') && e('『迭代代号』已经有『project1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试重复迭代code
r($execution->updateObject($executionIDList[0], $changeName)) && p('0:field,old,new') && e('name,迭代1,任务名修改'); // 测试修改迭代名称
r($execution->updateObject($executionIDList[0], $changeName)) && p('0:field,old,new') && e('name,迭代1,迭代名修改'); // 测试修改迭代名称
r($execution->updateObject($executionIDList[0], $changeStage)) && p('0:field,old,new') && e('project,11,41'); // 测试修改迭代项目为瀑布项目
r($execution->updateObject($executionIDList[0], $changeKanban)) && p('0:field,old,new') && e('project,41,71'); // 测试修改迭代项目为看板项目
r($execution->updateObject($executionIDList[1], $changeCode)) && p('0:field,old,new') && e('code,project31,code修改'); // 测试修改迭代code
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
#This script is use to rename files
for file in * ;
do mv $file `echo $file | tr 'A-Z' 'a-z'`;
done
-66
View File
@@ -1,66 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/product.class.php';
su('admin');
/**
title=测试productModel->create();
cid=1
pid=1
测试正常的创建 >> case1
测试不填产品代号的情况 >> 『code』不能为空。
测试创建重复的产品 >> 『code』已经有『testcase1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
测试不填产品名称的情况 >> 『name』不能为空。
测试传入name和code >> case3,testcase3
测试传入program、name、code >> 3,case4,testcase4
测试传入program、name、code、type、status >> 4,branch,closed
*/
$config = new stdClass();
$config->createFields->product = array('program' => '', 'name' => '', 'code' => '', 'PO' => '', 'QD' => '', 'RD' => '', 'type' => 'normal', 'status' => 'normal', 'desc' => '', 'acl' => 'private');
/*
function createObject($module = '', $param = array())
{
global $config;
foreach($config->createFields->$module as $field => $defaultValue) $_POST[$field] = $defaultValue;
foreach($param as $key => $value) $_POST[$key] = $value;
global $tester;
$objectModel = $tester->loadModel($module);
$objectID = $objectModel->create();
unset($_POST);
if(dao::isError())
{
return dao::getError();
}
else
{
$object = $objectModel->getByID($objectID);
return $object;
}
}*/
$createObject = new Product('admin');
$create1 = array('name' => 'case1', 'code' => 'testcase1');
$create2 = array('name' => 'case2');
$create3 = array('name' => 'case1', 'code' => 'testcase1');
$create4 = array('code' => 'testcase1');
$create5 = array('name' => 'case3', 'code' => 'testcase3');
$create6 = array('program' => '3', 'name' => 'case4', 'code' => 'testcase4');
$create7 = array('program' => '4', 'name' => 'case5', 'code' => 'testcase5', 'type' => 'branch', 'status' => 'closed');
r($createObject->createObject('product', $create1)) && p('name') && e('case1'); // 测试正常的创建
r($createObject->createObject('product', $create2)) && p('code:0') && e('『code』不能为空。'); // 测试不填产品代号的情况
r($createObject->createObject('product', $create3)) && p('code:0') && e('『code』已经有『testcase1』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试创建重复的产品
r($createObject->createObject('product', $create4)) && p('name:0') && e('『name』不能为空。'); // 测试不填产品名称的情况
r($createObject->createObject('product', $create5)) && p('name,code') && e('case3,testcase3'); // 测试传入name和code
r($createObject->createObject('product', $create6)) && p('program,name,code') && e('3,case4,testcase4'); // 测试传入program、name、code
r($createObject->createObject('product', $create7)) && p('program,type,status') && e('4,branch,closed'); // 测试传入program、name、code、type、status
system("./ztest init");
@@ -1,23 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/product.class.php';
/**
title=测试productModel->getLatestProject();
cid=1
pid=1
测试产品25关联的最后一个未关闭的项目,按begin字段排序 >> 315
测试产品38关联的最后一个未关闭的项目,按begin字段排序 >> 阶段588
传入不存在的产品 >> 没有数据
*/
$project = new Product('admin');
#var_dump($z->testGetLatestProject(38));die;
r($project->testGetLatestProject(25)) && p('id') && e('315'); // 测试产品25关联的最后一个未关闭的项目,按begin字段排序
r($project->testGetLatestProject(38)) && p('name') && e('阶段588'); // 测试产品38关联的最后一个未关闭的项目,按begin字段排序
r($project->testGetLatestProject(101)) && p() && e('没有数据'); // 传入不存在的产品
-102
View File
@@ -1,102 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
/**
title=productModel->getList();
cid=1
pid=1
返回项目集1下的产品数量 >> 9
测试传入programID=0的情况 >> 100
传入不存在的项目集 >> 0
返回项目集1下的未关闭的产品数量 >> 5
获取所有的未关闭的产品数量 >> 60
返回项目集1下的关闭了的产品数量 >> 4
返回所有的未关闭的产品数量 >> 40
返回项目集1下的与当前用户有关系的产品数量 >> 0
返回项目集1下产品线1的产品数量 >> 9
返回项目集1下产品线2的产品数量 >> 0
*/
class Tester
{
public function __construct($user)
{
global $tester;
su($user);
$this->product = $tester->loadModel('product');
}
public function getAllProducts($programID)
{
return $this->product->getList($programID);
}
public function getAllProductsCount($programID)
{
return count($this->getAllProducts($programID));
}
public function getNoclosedProducts($programID)
{
return $this->product->getList($programID, 'noclosed');
}
public function getNoclosedProductsCount($programID)
{
return count($this->getNoclosedProducts($programID));
}
public function getClosedProducts($programID)
{
return $this->product->getList($programID, 'closed');
}
public function getClosedProductsCount($programID)
{
return count($this->getClosedProducts($programID));
}
public function getInvolvedProducts($programID)
{
return $this->product->getList($programID, 'involved');
}
public function getInvolvedProductsCount($programID)
{
return count($this->getInvolvedProducts($programID));
}
public function getProductsByLine($programID, $line = 0)
{
return $this->product->getList($programID, 'all', 0, $line);
}
public function countProductsByLine($programID, $line = 0)
{
return count($this->getProductsByLine($programID, $line));
}
public function getProductList($programID, $status = 'all', $line = 0)
{
return $this->product->getList($programID, $status, 0, $line);
}
public function getProductCount($programID, $status = 'all', $line = 0)
{
return count($this->getProductList($programID, $status, $line));
}
}
$adminTester = new Tester('admin');
r($adminTester->getAllProductsCount(1)) && p() && e('9'); // 返回项目集1下的产品数量
r($adminTester->getAllProductsCount(0)) && p() && e('100'); // 测试传入programID=0的情况
r($adminTester->getAllProductsCount(11)) && p() && e('0'); // 传入不存在的项目集
r($adminTester->getNoclosedProductsCount(1)) && p() && e('5'); // 返回项目集1下的未关闭的产品数量
r($adminTester->getNoclosedProductsCount(0)) && p() && e('60'); // 获取所有的未关闭的产品数量
r($adminTester->getClosedProductsCount(1)) && p() && e('4'); // 返回项目集1下的关闭了的产品数量
r($adminTester->getClosedProductsCount(0)) && p() && e('40'); // 返回所有的未关闭的产品数量
r($adminTester->getInvolvedProductsCount(1)) && p() && e('0'); // 返回项目集1下的与当前用户有关系的产品数量
r($adminTester->countProductsByLine(1, 1)) && p() && e('9'); // 返回项目集1下产品线1的产品数量
r($adminTester->countProductsByLine(1, 2)) && p() && e('0'); // 返回项目集1下产品线2的产品数量
-40
View File
@@ -1,40 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productBox.class.php';
/**
title=测试productModel->getPairs();
cid=1
pid=1
测试项目集10下的11号产品 >> 正常产品11
测试项目集10下的55号产品 >> 多分支产品55
测试项目集10下的99号产品 >> 多平台产品99
测试不存在的项目集 >> 没有数据
返回所有产品的数量 >> 100
返回项目集10下的所有产品 >> 9
测试项目集10下的未关闭产品5 >> 正常产品6
返回项目集10下的未关闭产品的数量 >> 5
测试顺序program_desc >> 1
测试顺序program_asc >> 1
测试顺序type_desc >> 1
*/
$tester = new productBox('admin');
var_dump($tester->getProductPairsByOrder(10, '', 'program_desc'));die;
r($tester->getProductPairs(10)) && p('11') && e('正常产品11'); // 测试项目集10下的11号产品
r($tester->getProductPairs(10)) && p('55') && e('多分支产品55'); // 测试项目集10下的55号产品
r($tester->getProductPairs(10)) && p('99') && e('多平台产品99'); // 测试项目集10下的99号产品
r($tester->getProductPairs(11)) && p() && e('没有数据'); // 测试不存在的项目集
r($tester->getProductPairsCount(0)) && p() && e('100'); // 返回所有产品的数量
r($tester->getProductPairsCount(10)) && p() && e('9'); // 返回项目集10下的所有产品
r($tester->getNoclosedPairs(5)) && p('6') && e('正常产品6'); // 测试项目集10下的未关闭产品5
r($tester->getNoclosedPairsCount(10)) && p() && e('5'); // 返回项目集10下的未关闭产品的数量
r($tester->getProductPairsByOrder(10, '', 'program_desc')) && p() && e('1'); // 测试顺序program_desc
r($tester->getProductPairsByOrder(11, '', 'program_asc')) && p() && e('1'); // 测试顺序program_asc
r($tester->getProductPairsByOrder(11, '', 'type_desc')) && p() && e('1'); // 测试顺序type_desc
-95
View File
@@ -1,95 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
/**
title=测试productModel->getPairs();
cid=1
pid=1
测试项目集10下的11号产品 >> 正常产品11
测试项目集10下的55号产品 >> 多分支产品55
测试项目集10下的99号产品 >> 多平台产品99
测试不存在的项目集 >> 没有数据
返回所有产品的数量 >> 100
返回项目集10下的所有产品 >> 9
测试项目集10下的未关闭产品5 >> 正常产品6
返回项目集10下的未关闭产品的数量 >> 5
测试顺序program_desc >> 1
测试顺序program_asc >> 1
测试顺序type_desc >> 1
*/
class Tester
{
public function __construct($user, $orderBy = 'id_desc')
{
global $tester;
su($user);
$this->product = $tester->loadModel('product');
$this->config = new stdclass();
$this->config->product->orderBy = $orderBy;
}
public function getProductPairs($programID)
{
$pairs = $this->product->getPairs('', $programID);
if($pairs == array()) return '没有数据';
return $pairs;
}
public function getProductPairsCount($programID)
{
$pairsCount = count($this->getProductPairs($programID));
if($pairsCount == '没有数据') return '0';
return $pairsCount;
}
public function getAllPairs($programID)
{
$pairs = $this->product->getPairs('all', $programID);
if($pairs == array()) return '没有数据';
return $pairs;
}
public function getAllPairsCount($programID)
{
$pairsCount = count($this->getAllPairs($programID));
if($pairsCount == '没有数据') return '0';
return $pairsCount;
}
public function getNoclosedPairs($programID)
{
$pairs = $this->product->getPairs('noclosed', $programID);
if($pairs == array()) return '没有数据';
return $pairs;
}
public function getNoclosedPairsCount($programID)
{
$pairsCount = count($this->getNoclosedPairs($programID));
if($pairsCount == '没有数据') return '0';
return $pairsCount;
}
public function getProductPairsByOrder($programID, $mode = '', $orderBy = 'id_desc')
{
$this->config->product->orderBy = $orderBy;
$pairs = $this->product->getPairs($mode, $programID);
return checkOrder($pairs, $orderBy);
}
}
$tester = new Tester('admin');
r($tester->getProductPairs(10)) && p('11' && e('正常产品11'); // 测试项目集10下的11号产品
r($tester->getProductPairs(10)) && p('55') && e('多分支产品55'); // 测试项目集10下的55号产品
r($tester->getProductPairs(10)) && p('99') && e('多平台产品99'); // 测试项目集10下的99号产品
r($tester->getProductPairs(11)) && p() && e('没有数据'); // 测试不存在的项目集
r($tester->getProductPairsCount(0)) && p() && e('100'); // 返回所有产品的数量
r($tester->getProductPairsCount(10)) && p() && e('9'); // 返回项目集10下的所有产品
r($tester->getNoclosedPairs(5)) && p('6') && e('正常产品6'); // 测试项目集10下的未关闭产品5
r($tester->getNoclosedPairsCount(10)) && p() && e('5'); // 返回项目集10下的未关闭产品的数量
r($tester->getProductPairsByOrder(10, '', 'program_desc')) && p() && e('1'); // 测试顺序program_desc
r($tester->getProductPairsByOrder(11, '', 'program_asc')) && p() && e('1'); // 测试顺序program_asc
r($tester->getProductPairsByOrder(11, '', 'type_desc')) && p() && e('1'); // 测试顺序type_desc
@@ -1,43 +0,0 @@
#!/usr/bin/env php
<?php include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
/**
title=productModel->getProjectListByProduct();
cid=1
pid=1
返回产品1关联的项目11名字 >> 项目11
返回产品1关联的项目21名字 >> 项目1
传入不存在的产品 >> 没有数据
*/
class Tester
{
public function __construct($user)
{
global $tester;
su($user);
$this->product = $tester->loadModel('product');
}
public function getAllProjectsByProduct($productID)
{
$projects = $this->product->getProjectListByProduct($productID, 'all');
if($projects == array()) return '没有数据';
return $projects;
}
public function getProjectsByStatus($productID, $status)
{
$projects = $this->product->getProjectListByProduct($productID, $browseType);
if($projects == array()) return '没有数据';
return $projects;
}
}
$tester = new Tester('admin');
r($tester->getAllProjectsByProduct(1)) && p('21:name') && e('项目11'); // 返回产品1关联的项目11名字
r($tester->getAllProjectsByProduct(1)) && p('11:name') && e('项目1'); // 返回产品1关联的项目21名字
r($tester->getAllProjectsByProduct(101)) && p() && e('没有数据'); // 传入不存在的产品
@@ -1,27 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productBox.class.php';
/**
title=productModel->getProjectPairsByProduct();
cid=1
pid=1
返回产品1关联的项目11名字 >> 项目1
返回产品1关联的项目21名字 >> 项目11
传入不存在的产品 >> 没有数据
返回id为15的项目名 >> 项目5
传入不存在的项目id >> 没有数据
*/
$tester = new productBox('admin');
r($tester->getProjectPairsByProductID(1)) && p('11') && e('项目1'); // 返回产品1关联的项目11名字
r($tester->getProjectPairsByProductID(1)) && p('21') && e('项目11'); // 返回产品1关联的项目21名字
r($tester->getProjectPairsByProductID(101)) && p() && e('没有数据'); // 传入不存在的产品
r($tester->getAppendProject(15)) && p('15') && e('项目5'); // 返回id为15的项目名
r($tester->getAppendProject(701)) && p() && e('没有数据'); // 传入不存在的项目id
-25
View File
@@ -1,25 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/productBox.class.php';
su('admin');
/**
title=测试productModel->isClickable();
cid=1
pid=1
status为normal,action为close >> true
status为close,action为close >> false
status为normal,action为start >> true
status为close,action为start >> true
*/
$adminTester = new productBox('admin');
r($adminTester->testIsClickable(2, 'close')) && p() && e('true'); // status为normal,action为close
r($adminTester->testIsClickable(75, 'close')) && p() && e('false'); // status为close,action为close
r($adminTester->testIsClickable(2, 'start')) && p() && e('true'); // status为normal,action为start
r($adminTester->testIsClickable(75, 'start')) && p() && e('true'); // status为close,action为start
-69
View File
@@ -1,69 +0,0 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php'; su('admin');
/**
title=测试productModel->update();
cid=1
pid=1
测试更新产品名称 >> name,正常产品2,john
测试更新产品代号 >> code,code2,newcode1
测试更新产品名称和代号 >> name,john,jack;code,newcode1,newcode2
测试不更改产品名称 >> 没有数据更新
测试不更改产品代号 >> 没有数据更新
测试同一项目集下产品名称不能重复 >> 『产品名称』已经有『jack』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
测试同一项目集下产品代号不能重复 >> 『产品代号』已经有『newcode2』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
*/
function updateObject($module, $objectID, $param = array())
{
global $tester;
$objectModel = $tester->loadModel($module);
$object = $objectModel->getById($objectID);
foreach($object as $field => $value)
{
if(in_array($field, array_keys($param)))
{
$_POST[$field] = $param[$field];
}
else
{
$_POST[$field] = $value;
}
}
$change = $objectModel->update($objectID);
if($change == array()) $change = '没有数据更新';
unset($_POST);
if(dao::isError())
{
return dao::getError();
}
else
{
return $change;
}
}
$case1 = array('name' => 'john');
$case2 = array('code' => 'newcode1');
$case3 = array('name' => 'jack', 'code' => 'newcode2');
$case4 = array('name' => 'jack');
$case5 = array('code' => 'newcode2');
$case6 = array('name' => 'jack');
$case7 = array('code' => 'newcode2');
r(updateObject('product', 2, $case1)) && p('0:field,old,new') && e('name,正常产品2,john'); // 测试更新产品名称
r(updateObject('product', 2, $case2)) && p('0:field,old,new') && e('code,code2,newcode1'); // 测试更新产品代号
r(updateObject('product', 2, $case3)) && p('0:field,old,new;1:field,old,new') && e('name,john,jack;code,newcode1,newcode2'); // 测试更新产品名称和代号
r(updateObject('product', 2, $case4)) && p() && e('没有数据更新'); // 测试不更改产品名称
r(updateObject('product', 2, $case5)) && p() && e('没有数据更新'); // 测试不更改产品代号
r(updateObject('product', 13, $case6)) && p('name:0') && e('『产品名称』已经有『jack』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试同一项目集下产品名称不能重复
r(updateObject('product', 13, $case7)) && p('code:0') && e('『产品代号』已经有『newcode2』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); // 测试同一项目集下产品代号不能重复
system("./ztest init");
File diff suppressed because it is too large Load Diff
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
#This script is use to rename files
for file in * ;
do mv $file `echo $file | tr 'A-Z' 'a-z'`;
done
-5
View File
@@ -1,5 +0,0 @@
#!/bin/bash
#This script is use to rename files
for file in * ;
do mv $file `echo $file | tr 'A-Z' 'a-z'`;
done
Regular → Executable
+5 -1
View File
@@ -10,6 +10,10 @@ title=userModel->authorizeTest();
cid=1
pid=1
获取用户的权限,返回权限列表 >> 1
获取用户的权限,返回权限列表 >> 1
获取空用户名的权限,返回空 >> 0
*/
$user = new userTest();
@@ -18,4 +22,4 @@ $rights = $user->authorizeTest('test2');
r($rights['rights']) && p('action:comment') && e('1'); //获取用户的权限,返回权限列表
r($rights['rights']) && p('testtask:activate') && e('1'); //获取用户的权限,返回权限列表
r($user->authorizeTest('sadf!!@#a')) && p('projects') && e(''); //获取不存在的用户的权限,返回空
r($user->authorizeTest('')) && p('') && e('0'); //获取空用户名的权限,返回空
r($user->authorizeTest('')) && p('') && e('0'); //获取空用户名的权限,返回空
Regular → Executable
+3 -9
View File
@@ -10,14 +10,8 @@ title=userModel->batchCreateTest();
cid=1
pid=1
密码较弱的情况 >> 您的密码强度小于系统设定。
Visions为空的情况 >> 『版本类型』不能为空。
用户名为空的情况 >> 『用户名』不能为空。
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
两次密码不相同的情况 >> 两次密码应该相同。
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
获取插入的第一个用户的account >> newtestuser1
获取插入的最后一个用户的realname >> 新测试用户3
*/
@@ -33,4 +27,4 @@ $normalUser['password'] = array(1 => 'e10adc3949ba59abbe56e057f20f883e', 2 => 'e
r($user->batchCreateUserTest($normalUser)) && p('0:account') && e('newtestuser1'); //获取插入的第一个用户的account
r($user->batchCreateUserTest($normalUser)) && p('2:realname') && e('新测试用户3'); //获取插入的最后一个用户的realname
system("./ztest init");
system("./ztest init");
Regular → Executable
+3 -9
View File
@@ -10,14 +10,8 @@ title=userModel->batchEditTest();
cid=1
pid=1
密码较弱的情况 >> 您的密码强度小于系统设定。
Visions为空的情况 >> 『版本类型』不能为空。
用户名为空的情况 >> 『用户名』不能为空。
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
两次密码不相同的情况 >> 两次密码应该相同。
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
获取编辑后的第一个用户的account >> newtestuser1
获取编辑的最后一个用户的真实姓名 >> 新测试用户3
*/
@@ -33,4 +27,4 @@ $normalUser['password'] = array(998 => 'e10adc3949ba59abbe56e057f20f883e', 999 =
r($user->batchEditUserTest($normalUser)) && p('998:account') && e('newtestuser1'); //获取编辑后的第一个用户的account
r($user->batchEditUserTest($normalUser)) && p('1000:realname') && e('新测试用户3'); //获取编辑的最后一个用户的真实姓名
system("./ztest init");
system("./ztest init");
+4 -8
View File
@@ -10,14 +10,10 @@ title=userModel->checkPasswordTest();
cid=1
pid=1
密码较弱的情况 >> 您的密码强度小于系统设定。
Visions为空的情况 >> 『版本类型』不能为空。
用户名为空的情况 >> 『用户名』不能为空。
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
正常的用户密码 >> 无报错
两次密码不相同的情况 >> 两次密码应该相同。
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
密码强度小于系统设定 >> 您的密码强度小于系统设定
使用常见简单密码,给出错误提示 >> 密码不能使用【123456,password,12345,12345678,qwerty,123456789,1234,1234567,abc123,111111,123123】这些常用弱口令。
*/
@@ -41,4 +37,4 @@ r($user->checkPasswordTest($normalUser)) && p('password') && e('无
r($user->checkPasswordTest($differentPassword)) && p('password:0') && e('两次密码应该相同。'); //两次密码不相同的情况
r($user->checkPasswordTest($weakPassword)) && p('password1:0') && e('您的密码强度小于系统设定。'); //密码强度小于系统设定
r($user->checkPasswordTest($simplePassword)) && p('password1:0') && e('密码不能使用【123456,password,12345,12345678,qwerty,123456789,1234,1234567,abc123,111111,123123】这些常用弱口令。'); //使用常见简单密码,给出错误提示
system("./ztest init");
system("./ztest init");
+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
su('admin');
/**
title=userModel->computePasswordStrengthTest();
cid=1
pid=1
获取空密码的强度 >> 0
获取[123456]密码的强度 >> 0
获取[qaz123]密码的强度 >> 0
获取[qaz67911334]密码的强度 >> 1
获取[ZENFBQfy3xpRarDwG3lN]密码的强度 >> 2
*/
$user = new userTest();
r($user->computePasswordStrengthTest('')) && p() && e('0'); //获取空密码的强度
r($user->computePasswordStrengthTest('123456')) && p() && e('0'); //获取[123456]密码的强度
r($user->computePasswordStrengthTest('qaz123')) && p() && e('0'); //获取[qaz123]密码的强度
r($user->computePasswordStrengthTest('qaz67911334')) && p() && e('1'); //获取[qaz67911334]密码的强度
r($user->computePasswordStrengthTest('ZENFBQfy3xpRarDwG3lN')) && p() && e('2'); //获取[ZENFBQfy3xpRarDwG3lN]密码的强度
+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/user.class.php';
su('admin');
/**
title=userModel->computeUserViewTest();
cid=1
pid=1
获取admin账户可见的前两个项目ID >> ,1,3,
获取admin账户可见的前两个产品ID >> ,1,2,
获取user10账户可见的产品ID >> 99
用户名传null,则获取当前登录账户的views >> admin
*/
$user = new userTest();
$adminViews = $user->computeUserViewTest('admin', true);
$adminProjects = substr($adminViews->projects, 0, 5);
$adminProducts = substr($adminViews->products, 0, 5);
r($adminProjects) && p() && e(',1,3,'); //获取admin账户可见的前两个项目ID
r($adminProducts) && p() && e(',1,2,'); //获取admin账户可见的前两个产品ID
r($user->computeUserViewTest('user10')) && p('products') && e('99'); //获取user10账户可见的产品ID
r($user->computeUserViewTest('test2')) && p('projects') && e(''); //获取test2账户可见的项目ID
r($user->computeUserViewTest(null)) && p('account') && e('admin'); //用户名传null,则获取当前登录账户的views
system("./ztest init");
Regular → Executable
+1 -1
View File
@@ -57,4 +57,4 @@ r($user->createUserTest($differentPassword)) && p('password:0') && e('两次密
r($user->createUserTest($existUser)) && p('account:0') && e('『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。'); //插入重复的用户名,返回报错信息
r($user->createUserTest($normalUser)) && p('id,realname') && e('1001,新的测试用户'); //正常插入用户,返回新插入的ID、真实姓名
r($user->createUserTest($normalUser)) && p('realname') && e('新的测试用户'); //正常插入用户,返回新插入的真实姓名
system("./ztest init");
system("./ztest init");
+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/user.class.php';
su('admin');
/**
title=userModel->createContactListTest();
cid=1
pid=1
插入一条联系人列表,获取插入的联系人列表名称 >> 新的列表名称1
插入一条联系人列表,获取插入的联系人列表名称 >> 新的列表名称2
*/
$user = new userTest();
$userList = array('admin,test2,user29,assfjg');
r($user->createContactListTest('新的列表名称1', $userList)) && p('listName') && e('新的列表名称1'); //插入一条联系人列表,获取插入的联系人列表名称
r($user->createContactListTest('新的列表名称2', $userList)) && p('listName') && e('新的列表名称2'); //插入一条联系人列表,获取插入的联系人列表名称
r($user->createContactListTest('新的列表名称3', array())) && p('userList') && e(''); //插入一条联系人列表,获取插入的联系人列表
system("./ztest init");
+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/user.class.php';
su('admin');
/**
title=userModel->deleteContactListTest();
cid=1
pid=1
删除ID为1的联系人列表 >> 0
删除ID为2的联系人列表 >> 0
删除ID为null的联系人列表 >> 0
删除ID为1000的联系人列表 >> 0
*/
$user = new userTest();
r($user->deleteContactListTest(1)) && p('listName') && e('0'); //删除ID为1的联系人列表
r($user->deleteContactListTest(2)) && p('listName') && e('0'); //删除ID为2的联系人列表
r($user->deleteContactListTest(null)) && p('userLsit') && e('0'); //删除ID为null的联系人列表
r($user->deleteContactListTest(1000)) && p('userList') && e('0'); //删除ID为1000的联系人列表
system("./ztest init");
View File
Regular → Executable
View File
Regular → Executable
View File
+11 -5
View File
@@ -10,12 +10,18 @@ title=测试 userModel::getContactListByIDTest();
cid=1
pid=1
获取ID为1的联系人列表名称 >> 联系人列表1
获取ID为60的联系人列表创建者 >> admin
获取ID为1000的联系人列表,返回空 >> 0
获取ID为false的联系人列表,返回空 >> 0
获取ID为null的联系人列表,返回空 >> 0
*/
$user = new userTest();
r($user->getContactListByIDTest(1)) && p() && e('0'); //
r($user->getContactListByIDTest(2)) && p() && e('0'); //
r($user->getContactListByIDTest(1000)) && p() && e('0'); //
r($user->getContactListByIDTest(false)) && p() && e('0'); //
r($user->getContactListByIDTest(null)) && p() && e('0'); //
r($user->getContactListByIDTest(1)) && p('listName') && e('联系人列表1'); //获取ID为1的联系人列表名称
r($user->getContactListByIDTest(60)) && p('account') && e('admin'); //获取ID为60的联系人列表创建者
r($user->getContactListByIDTest(1000)) && p() && e('0'); //获取ID为1000的联系人列表,返回空
r($user->getContactListByIDTest(false)) && p() && e('0'); //获取ID为false的联系人列表,返回空
r($user->getContactListByIDTest(null)) && p() && e('0'); //获取ID为null的联系人列表,返回空
+3 -1
View File
@@ -10,6 +10,8 @@ title=测试 userModel::getContactListsTest();
cid=1
pid=1
获取admin的联系人列表 >> 0
*/
$user = new userTest();
$adminContactList1 = $user->getContactListsTest('admin', 'withempty|withnote');
@@ -17,4 +19,4 @@ $adminContactList2 = $user->getContactListsTest('admin', '');
$test2ContactList = $user->getContactListsTest('test2');
$emptyContactList = $user->getContactListsTest('', '');
r($adminContactList) && p() && e('0'); // 获取admin的联系人列表
r($adminContactList) && p() && e('0'); // 获取admin的联系人列表
+8 -2
View File
@@ -10,8 +10,14 @@ title=userModel->getContactUserPairsTest();
cid=1
pid=1
根据传入的accountList获取admin真实姓名 >> admin
根据传入的accountList获取test2真实姓名 >> 测试2
*/
$user = new userTest();
$accountList = array('admin', 'test2');
$accountList = array('admin', 'test2', 'asdffg', null);
r($user->getContactUserPairsTest($accountList)) && p('') && e(''); //
r($user->getContactUserPairsTest($accountList)) && p('admin') && e('admin'); //根据传入的accountList获取admin真实姓名
r($user->getContactUserPairsTest($accountList)) && p('test2') && e('测试2'); //根据传入的accountList获取test2真实姓名
r($user->getContactUserPairsTest($accountList)) && p('asdffg') && e(''); //根据传入的accountList获取asdffg真实姓名
r($user->getContactUserPairsTest($accountList)) && p('null') && e(''); //根据传入的accountList获取null真实姓名
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
su('admin');
/**
title=userModel->getDataInJSON();
cid=1
pid=1
传入admin用户信息,返回公司信息 >> 易软天创网络科技有限公司
传入admin用户信息,返回用户名信息 >> admin
传入null用户信息,返回公司信息 >> 易软天创网络科技有限公司
*/
$user = new userTest();
$admin = new stdclass();
$admin->id = 1;
$admin->account = 'admin';
$admin->password = '123456';
$admin->deleted = '1';
r($user->getDataInJSONTest($admin)) && p('user:company') && e('易软天创网络科技有限公司'); //传入admin用户信息,返回公司信息
r($user->getDataInJSONTest($admin)) && p('user:account') && e('admin'); //传入admin用户信息,返回用户名信息
r($user->getDataInJSONTest($admin)) && p('user:password') && e(''); //传入admin用户信息,返回密码信息
r($user->getDataInJSONTest(null)) && p('user:company') && e('易软天创网络科技有限公司'); //传入null用户信息,返回公司信息
Regular → Executable
+5 -1
View File
@@ -10,9 +10,13 @@ title=测试 userModel::getGroupsTest();
cid=1
pid=1
获取admin所在的分组,为空 >> 0
通过test2所在的分组数量,1个 >> 1
传空用户名,返回空 >> 0
*/
$user = new userTest();
r($user->getGroupsTest('admin')) && p() && e('0'); // 获取admin所在的分组,为空
r(count($user->getGroupsTest('test2'))) && p() && e('1'); // 通过test2所在的分组数量,1个
r($user->getGroupsTest('')) && p() && e('0'); // 传空用户名,返回空
r($user->getGroupsTest('')) && p() && e('0'); // 传空用户名,返回空
+6 -1
View File
@@ -10,10 +10,15 @@ title=测试 userModel::getGroupsByVisionsTest();
cid=1
pid=1
获取系统中所有研发界面分组的数量 >> 14
获取系统中所有迅捷界面分组的数量 >> 3
传空Visions,返回空数组 >> 0
获取系统中所有用户分组的数量 >> 17
*/
$user = new userTest();
r(count($user->getGroupsByVisionsTest(array('rnd')))) && p() && e('14'); // 获取系统中所有研发界面分组的数量
r(count($user->getGroupsByVisionsTest(array('lite')))) && p() && e('3'); // 获取系统中所有迅捷界面分组的数量
r($user->getGroupsByVisionsTest(array())) && p() && e('0'); // 传空Visions,返回空数组
r(count($user->getGroupsByVisionsTest(array('rnd','lite')))) && p() && e('17'); // 获取系统中所有用户分组的数量
r(count($user->getGroupsByVisionsTest(array('rnd','lite')))) && p() && e('17'); // 获取系统中所有用户分组的数量
Regular → Executable
View File
+5 -1
View File
@@ -10,6 +10,10 @@ title=测试 userModel::getListByAccount();
cid=1
pid=1
获取admin的联系人列表 >> 0
获取admin的联系人列表 >> 0
获取admin的联系人列表 >> 0
*/
$user = new userTest();
$adminContactList = $user->getListByAccountTest('admin');
@@ -18,4 +22,4 @@ $emptyContactList = $user->getListByAccountTest('');
r($adminContactList) && p() && e('0'); // 获取admin的联系人列表
r($test2ContactList) && p() && e('0'); // 获取admin的联系人列表
r($emptyContactList) && p() && e('0'); // 获取admin的联系人列表
r($emptyContactList) && p() && e('0'); // 获取admin的联系人列表
View File
Regular → Executable
+8 -1
View File
@@ -10,6 +10,13 @@ title=测试 userModel::getObjectsTest();
cid=1
pid=1
获取admin的所属项目列表,取ID为11的项目名字 >> 项目1
获取admin的所属项目列表,取ID为11的项目类型 >> project
获取admin的所属执行列表,取ID为120的项目名字 >> 迭代20
获取admin的已完成的所属项目列表,返回空 >> 0
获取test2用户的所属项目列表,返回空 >> 0
传入一个空用户名字段,返回空 >> 0
*/
$user = new userTest();
$adminProjects = $user->getObjectsTest('admin', 'project', 'all', 'id_desc');
@@ -23,4 +30,4 @@ r($adminProjects) && p('11:type') && e('project'); //获取admin的所属
r($adminExecutions) && p('120:name') && e('迭代20'); //获取admin的所属执行列表,取ID为120的项目名字
r($adminDoneProjects) && p('') && e('0'); //获取admin的已完成的所属项目列表,返回空
r($test2Projects) && p('') && e('0'); //获取test2用户的所属项目列表,返回空
r($emptyUser) && p('') && e('0'); //传入一个空用户名字段,返回空
r($emptyUser) && p('') && e('0'); //传入一个空用户名字段,返回空
Regular → Executable
View File
+7 -2
View File
@@ -10,10 +10,15 @@ title=测试 userModel::getParentStageAuthedUsersTest();
cid=1
pid=1
传入ID为0的情况获取有权限的用户 >> 0
传入一个阶段ID获取有权限的用户 >> admin
传入一个项目集ID获取有权限的用户 >> 0
传入一个看板类型的项目ID获取有权限的用户 >> admin
*/
$user = new userTest();
r($user->getParentStageAuthedUsersTest(0)) && p() && e('0'); //传入ID为0的情况获取有权限的用户
r($user->getParentStageAuthedUsersTest(131)) && p('wwccss') && e('wwccss'); //传入一个阶段ID获取有权限的用户
r($user->getParentStageAuthedUsersTest(131)) && p('admin') && e('admin'); //传入一个阶段ID获取有权限的用户
r($user->getParentStageAuthedUsersTest(1)) && p() && e('0'); //传入一个项目集ID获取有权限的用户
r($user->getParentStageAuthedUsersTest(161)) && p('wwccss') && e('wwccss'); //传入一个看板类型的项目ID获取有权限的用户
r($user->getParentStageAuthedUsersTest(161)) && p('admin') && e('admin'); //传入一个看板类型的项目ID获取有权限的用户
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
su('admin');
/**
title=userModel->getProductMembersTest();
cid=1
pid=1
获取ID为1的产品的团队成员,判断是否包含pm92 >> pm92
获取ID为4的产品的团队成员,判断是否包含user5 >> user5
获取ID为2的产品的干系人,判断是否包含po3 >> po3
获取ID为3的产品的干系人,判断是否包含user14 >> user14
*/
$user = new userTest();
$products = array(1 => 1, 2 => 2, 3 => 3, 4 => 4);
$members = $user->getProductMembersTest($products);
$teamGroups = $members[0];
$stakeholderGroups = $members[0];
r($teamGroups) && p('1:pm92') && e('pm92'); //获取ID为1的产品的团队成员,判断是否包含pm92
r($teamGroups) && p('4:user5') && e('user5'); //获取ID为4的产品的团队成员,判断是否包含user5
r($stakeholderGroups) && p('2:po3') && e('po3'); //获取ID为2的产品的干系人,判断是否包含po3
r($stakeholderGroups) && p('3:user14') && e('user14'); //获取ID为3的产品的干系人,判断是否包含user14
system("./ztest init");
View File
View File
Regular → Executable
View File
+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/user.class.php';
su('admin');
/**
title=userModel->getWeakUsersTest();
cid=1
pid=1
获取密码较弱的用户 >> 0
*/
$user = new userTest();
a($user->getWeakUsersTest());die;
r($user->getWeakUsersTest()) && p('') && e('0'); //获取密码较弱的用户
Regular → Executable
+5 -1
View File
@@ -10,10 +10,14 @@ title=userModel->identifyTest();
cid=1
pid=1
用户名密码皆正确,返回验证登录的用户 >> admin
验证一个不存在的用户,返回空 >> 0
验证一个不传用户名和密码的用户,返回空 >> 0
*/
$user = new userTest();
r($user->identifyTest('admin', '78302615c8b79cac8df6d2607f8a83ee')) && p('realname') && e('admin'); //用户名密码皆正确,返回验证登录的用户
r($user->identifyTest('asdjaf12', '78302615c8b79cac8df6d2607f8a83ee')) && p() && e('0'); //验证一个不存在的用户,返回空
r($user->identifyTest('', '')) && p() && e('0'); //验证一个不传用户名和密码的用户,返回空
r($user->identifyTest('', '')) && p() && e('0'); //验证一个不传用户名和密码的用户,返回空
Regular → Executable
+5 -1
View File
@@ -10,6 +10,10 @@ title=userModel->loginTest();
cid=1
pid=1
使用admin登录,返回此用户为超级管理员 >> 1
使用Admin登录,返回权限列表的数量 >> 3
使用空账号登录,返回权限列表数量为0 >> 0
*/
$userClass = new userTest();
@@ -26,4 +30,4 @@ $emptyAccount = $userClass->loginTest($emptyAccount);
r($admin) && p('admin') && e('1'); //使用admin登录,返回此用户为超级管理员
r(count($admin->rights)) && p() && e('3'); //使用Admin登录,返回权限列表的数量
r(count($emptyAccount->group)) && p() && e('0'); //使用空账号登录,返回权限列表数量为0
r(count($emptyAccount->group)) && p() && e('0'); //使用空账号登录,返回权限列表数量为0
+4 -8
View File
@@ -10,14 +10,10 @@ title=userModel->resetPasswordTest();
cid=1
pid=1
密码较弱的情况 >> 您的密码强度小于系统设定。
Visions为空的情况 >> 『版本类型』不能为空。
用户名为空的情况 >> 『用户名』不能为空。
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
重设用户密码,返回重设后的加密后的密码 >> 367ef140036b0feb2f90d70d33255eea
两次密码不相同的情况 >> 两次密码应该相同。
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
密码强度小于系统设定 >> 您的密码强度小于系统设定
使用常见简单密码,给出错误提示 >> 密码不能使用【123456,password,12345,12345678,qwerty,123456789,1234,1234567,abc123,111111,123123】这些常用弱口令。
*/
@@ -42,4 +38,4 @@ r($user->resetPasswordTest($normalUser)) && p('password') && e('367ef
r($user->resetPasswordTest($differentPassword)) && p('password:0') && e('两次密码应该相同。'); //两次密码不相同的情况
r($user->resetPasswordTest($weakPassword)) && p('password1:0') && e('您的密码强度小于系统设定。'); //密码强度小于系统设定
r($user->resetPasswordTest($simplePassword)) && p('password1:0') && e('密码不能使用【123456,password,12345,12345678,qwerty,123456789,1234,1234567,abc123,111111,123123】这些常用弱口令。'); //使用常见简单密码,给出错误提示
system("./ztest init");
system("./ztest init");
Regular → Executable
+4 -8
View File
@@ -10,14 +10,10 @@ title=userModel->updateUserTest();
cid=1
pid=1
密码较弱的情况 >> 您的密码强度小于系统设定。
Visions为空的情况 >> 『版本类型』不能为空
用户名为空的情况 >> 『用户名』不能为空。
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
编辑用户,返回新的用户名 >> newtestuser4
编辑用户,有重名用户的情况 >> 『用户名』已经有『newtestuser4』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原
两次密码不相同的情况 >> 两次密码应该相同。
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
用户名包含特殊字符的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上
*/
@@ -44,4 +40,4 @@ r($user->updateUserTest(1000, $normalUser)) && p('account') && e('new
r($user->updateUserTest(1000, $existUser)) && p('account:0') && e('『用户名』已经有『newtestuser4』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原。');//编辑用户,有重名用户的情况
r($user->updateUserTest(1000, $differentPassword)) && p('password:0') && e('两次密码应该相同。'); //两次密码不相同的情况
r($user->updateUserTest(1000, $specialUser)) && p('account:0') && e('『用户名』只能是字母、数字或下划线的组合三位以上。'); //用户名包含特殊字符的情况
system("./ztest init");
system("./ztest init");
+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/user.class.php';
su('admin');
/**
title=userModel->updateContactList();
cid=1
pid=1
更新ID为1的联系人列表,获取更新的联系人列表名称 >> 新的列表名称1
更新ID为2的联系人列表,获取更新的联系人列表名称 >> 新的列表名称2
更新ID为1000的联系人列表,获取更新的联系人列表 >> 0
*/
$user = new userTest();
$userList = array('admin,test2,user29,assfjg');
r($user->updateContactListTest(1, '新的列表名称1', $userList)) && p('listName') && e('新的列表名称1'); //更新ID为1的联系人列表,获取更新的联系人列表名称
r($user->updateContactListTest(2, '新的列表名称2', $userList)) && p('listName') && e('新的列表名称2'); //更新ID为2的联系人列表,获取更新的联系人列表名称
r($user->updateContactListTest(3, '新的列表名称3', '')) && p('userLsit') && e(''); //更新ID为3的联系人列表,获取更新的联系人列表
r($user->updateContactListTest(1000, '新的列表名称4', $userList)) && p('userList') && e('0'); //更新ID为1000的联系人列表,获取更新的联系人列表
system("./ztest init");
+3 -8
View File
@@ -10,14 +10,9 @@ title=userModel->updatePasswordTest();
cid=1
pid=1
密码较弱的情况 >> 您的密码强度小于系统设定。
Visions为空的情况 >> 『版本类型』不能为空。
用户名为空的情况 >> 『用户名』不能为空。
用户名特殊的情况 >> 『用户名』只能是字母、数字或下划线的组合三位以上。
编辑用户密码,返回编辑后的密码 >> dcf859ce8dd8f998bdfe4ae6c22c329e
两次密码不相同的情况 >> 两次密码应该相同。
插入重复的用户名,返回报错信息 >> 『用户名』已经有『admin』这条记录了。如果您确定该记录已删除,请到后台-系统-数据-回收站还原
正常插入用户,返回新插入的ID、真实姓名 >> 1001,新的测试用户
正常插入用户,返回新插入的真实姓名 >> 新的测试用户
密码小于设定强度的情况 >> 您的密码强度小于系统设定
*/
@@ -38,4 +33,4 @@ r($user->updatePasswordTest(1000, $normalUser)) && p('password') && e
r($user->updatePasswordTest(1000, $differentPassword)) && p('password:0') && e('两次密码应该相同。'); //两次密码不相同的情况
r($user->updatePasswordTest(1000, $weakPassword)) && p('password1:0') && e('您的密码强度小于系统设定。'); //密码小于设定强度的情况
system("./ztest init");
system("./ztest init");
BIN
View File
Binary file not shown.