Merge branch 'sgm_usercase' into 'master'
Sgm usercase See merge request easycorp/zentaopms!2355
This commit is contained in:
@@ -710,4 +710,226 @@ class userTest
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $members;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get product members.
|
||||
*
|
||||
* @param string $account
|
||||
* @param bool $force
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function grantUserViewTest($account = '', $acls = array(), $projects = '')
|
||||
{
|
||||
$userView = $this->objectModel->grantUserView($account, $acls, $projects);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $userView;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update program view.
|
||||
*
|
||||
* @param array $programIdList
|
||||
* @param array $users
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function updateProgramViewTest($programIdList = array(), $users = array())
|
||||
{
|
||||
$this->objectModel->updateProgramView($programIdList, $users);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $this->objectModel->grantUserView(current($users));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test check program priv.
|
||||
*
|
||||
* @param object $program
|
||||
* @param string $account
|
||||
* @param array $stakeholders
|
||||
* @param array $whiteList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkProgramPrivTest($program, $account, $stakeholders, $whiteList)
|
||||
{
|
||||
return $this->objectModel->checkProgramPriv($program, $account, $stakeholders, $whiteList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test check project priv.
|
||||
*
|
||||
* @param object $project
|
||||
* @param string $account
|
||||
* @param array $stakeholders
|
||||
* @param array $teams
|
||||
* @param array $whiteList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkProjectPrivTest($project, $account, $stakeholders, $teams, $whiteList)
|
||||
{
|
||||
return $this->objectModel->checkProjectPriv($project, $account, $stakeholders, $teams, $whiteList);
|
||||
}
|
||||
/**
|
||||
* Test check sprint priv.
|
||||
*
|
||||
* @param object $sprint
|
||||
* @param string $account
|
||||
* @param array $stakeholders
|
||||
* @param array $teams
|
||||
* @param array $whiteList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkSprintPrivTest($sprint, $account, $stakeholders, $teams, $whiteList)
|
||||
{
|
||||
return $this->objectModel->checkSprintPriv($sprint, $account, $stakeholders, $teams, $whiteList);
|
||||
}
|
||||
/**
|
||||
* Test check product priv.
|
||||
*
|
||||
* @param object $program
|
||||
* @param string $account
|
||||
* @param array $groups
|
||||
* @param array $teams
|
||||
* @param array $stakeholders
|
||||
* @param array $whiteList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function checkProductPrivTest($product, $account, $groups, $teams, $stakeholders, $whiteList)
|
||||
{
|
||||
return $this->objectModel->checkProductPriv($product, $account, $groups, $teams, $stakeholders, $whiteList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get project authed users.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param array $stakeholders
|
||||
* @param array $teams
|
||||
* @param array $whiteList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProjectAuthedUsersTest($projectID, $stakeholders, $teams, $whiteList)
|
||||
{
|
||||
global $tester;
|
||||
$project = $tester->loadModel('project')->getByID($projectID);
|
||||
return $this->objectModel->getProjectAuthedUsers($project, $stakeholders, $teams, $whiteList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get program authed users.
|
||||
*
|
||||
* @param int $projectID
|
||||
* @param array $stakeholders
|
||||
* @param array $whiteList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProgramAuthedUsersTest($programID, $stakeholders, $whiteList)
|
||||
{
|
||||
global $tester;
|
||||
$program = $tester->loadModel('program')->getByID($programID);
|
||||
return $this->objectModel->getProgramAuthedUsers($program, $stakeholders, $whiteList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get product view list users.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param array $teams
|
||||
* @param array $stakeholders
|
||||
* @param array $whiteList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getProductViewListUsersTest($productID, $teams, $stakeholders, $whiteList)
|
||||
{
|
||||
global $tester;
|
||||
$product = $tester->loadModel('product')->getByID($productID);
|
||||
return $this->objectModel->getProductViewListUsers($product, $teams, $stakeholders, $whiteList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get product view list users.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $type
|
||||
* @param string $params
|
||||
* @param array $usersToAppended
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getTeamMemberPairsTest($objectID, $type, $params, $usersToAppended)
|
||||
{
|
||||
return $this->objectModel->getTeamMemberPairs($objectID, $type, $params, $usersToAppended);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test save user template.
|
||||
*
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function saveUserTemplate($type)
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel->saveUserTemplate($type);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $this->objectModel->getUserTemplates($type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user templates.
|
||||
*
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getUserTemplates($type)
|
||||
{
|
||||
return $this->objectModel->getUserTemplates($type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get person data.
|
||||
*
|
||||
* @param string $account
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getPersonalDataTest($account)
|
||||
{
|
||||
return $this->objectModel->getPersonalData($account);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get user details for api.
|
||||
*
|
||||
* @param array $userList
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getUserDetailsForAPITest($userList)
|
||||
{
|
||||
return $this->objectModel->getUserDetailsForAPI($userList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get vision list.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getVisionListTest()
|
||||
{
|
||||
return $this->objectModel->getVisionList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->authorizeTest();
|
||||
title=测试 userModel->authorize();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -19,7 +19,7 @@ pid=1
|
||||
$user = new userTest();
|
||||
$rights = $user->authorizeTest('test2');
|
||||
|
||||
r($rights['rights']) && p('action:comment') && e('1'); //获取用户的权限,返回权限列表
|
||||
r($rights['rights']) && p('testtask:activate') && e('1'); //获取用户的权限,返回权限列表
|
||||
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'); //获取空用户名的权限,返回空
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->batchCreateTest();
|
||||
title=测试 userModel->batchCreate();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -27,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");
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->batchEditTest();
|
||||
title=测试 userModel->batchEdit();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -27,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");
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->checkPasswordTest();
|
||||
title=测试 userModel->checkPassword();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -37,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");
|
||||
|
||||
Executable
+29
@@ -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->checkProductPriv();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$product = new stdclass();
|
||||
$product->id = 1;
|
||||
$product->name = '测试产品';
|
||||
$product->PO = 'test2';
|
||||
$product->openedBy = 'pm1';
|
||||
|
||||
$stakeholders['user10'] = 'user10';
|
||||
$whiteList['user60'] = 'user60';
|
||||
|
||||
r($user->checkProductPrivTest('', 'admin')) && p() && e('1'); //传入admin,判断admin用户是否有权限
|
||||
r($user->checkProductPrivTest($product, 'test3')) && p() && e('0'); //传入产品、用户名,判断test3用户是否对此产品有权限
|
||||
r($user->checkProductPrivTest($product, 'test2')) && p() && e('1'); //传入产品、用户名,判断test2用户是否对此产品有权限
|
||||
r($user->checkProductPrivTest($product, 'user10', array(), array(), $stakeholders)) && p() && e('1'); //传入产品、用户名、干系人、白名单,判断user10用户是否对此产品有权限
|
||||
r($user->checkProductPrivTest($product, 'user60', array(), array(), $stakeholders, array(), $whiteList)) && p() && e('1'); //传入产品、用户名、干系人、白名单,判断user60用户是否对此产品有权限
|
||||
Executable
+29
@@ -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->checkProgramPriv();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$program = new stdclass();
|
||||
$program->id = 1;
|
||||
$program->name = '测试项目集';
|
||||
$program->PM = 'test2';
|
||||
$program->openedBy = 'pm1';
|
||||
|
||||
$stakeholders['user10'] = 'user10';
|
||||
$whiteList['user60'] = 'user60';
|
||||
|
||||
r($user->checkProgramPrivTest('', 'admin')) && p() && e('1'); //传入admin,判断admin用户是否有权限
|
||||
r($user->checkProgramPrivTest($program, 'test3')) && p() && e('0'); //传入项目集、用户名,判断test3用户是否对此项目集有权限
|
||||
r($user->checkProgramPrivTest($program, 'test2')) && p() && e('1'); //传入项目集、用户名,判断test2用户是否对此项目集有权限
|
||||
r($user->checkProgramPrivTest($program, 'user10', $stakeholders, array())) && p() && e('1'); //传入项目集、用户名、干系人、白名单,判断user10用户是否对此项目集有权限
|
||||
r($user->checkProgramPrivTest($program, 'user60', $stakeholders, $whiteList)) && p() && e('1'); //传入项目集、用户名、干系人、白名单,判断user60用户是否对此项目集有权限
|
||||
Executable
+29
@@ -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->checkProjectPriv();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$project = new stdclass();
|
||||
$project->id = 10;
|
||||
$project->name = '测试项目';
|
||||
$project->PM = 'test2';
|
||||
$project->openedBy = 'pm1';
|
||||
|
||||
$stakeholders['user10'] = 'user10';
|
||||
$whiteList['user60'] = 'user60';
|
||||
|
||||
r($user->checkProjectPrivTest('', 'admin')) && p() && e('1'); //传入admin,判断admin用户是否有权限
|
||||
r($user->checkProjectPrivTest($project, 'test3')) && p() && e('0'); //传入项目、用户名,判断test3用户是否对此项目有权限
|
||||
r($user->checkProjectPrivTest($project, 'test2')) && p() && e('1'); //传入项目、用户名,判断test2用户是否对此项目有权限
|
||||
r($user->checkProjectPrivTest($project, 'user10', $stakeholders, array(), array())) && p() && e('1'); //传入项目、用户名、干系人、白名单,判断user10用户是否对此项目有权限
|
||||
r($user->checkProjectPrivTest($project, 'user60', $stakeholders, array(), $whiteList)) && p() && e('1'); //传入项目、用户名、干系人、白名单,判断user60用户是否对此项目有权限
|
||||
Executable
+29
@@ -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->checkSprintPriv();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$sprint = new stdclass();
|
||||
$sprint->id = 1;
|
||||
$sprint->name = '测试项目集';
|
||||
$sprint->PM = 'test2';
|
||||
$sprint->openedBy = 'pm1';
|
||||
|
||||
$stakeholders['user10'] = 'user10';
|
||||
$whiteList['user60'] = 'user60';
|
||||
|
||||
r($user->checkSprintPrivTest('', 'admin')) && p() && e('1'); //传入admin,判断admin用户是否有权限
|
||||
r($user->checkSprintPrivTest($sprint, 'test3')) && p() && e('0'); //传入执行、用户名,判断test3用户是否对此执行有权限
|
||||
r($user->checkSprintPrivTest($sprint, 'test2')) && p() && e('1'); //传入执行、用户名,判断test2用户是否对此执行有权限
|
||||
r($user->checkSprintPrivTest($sprint, 'user10', $stakeholders, array(), array())) && p() && e('1'); //传入执行、用户名、干系人、白名单,判断user10用户是否对此执行有权限
|
||||
r($user->checkSprintPrivTest($sprint, 'user60', $stakeholders, array(), $whiteList)) && p() && e('1'); //传入执行、用户名、干系人、白名单,判断user60用户是否对此执行有权限
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->computePasswordStrengthTest();
|
||||
title=测试 userModel->computePasswordStrength();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -24,4 +24,4 @@ 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]密码的强度
|
||||
r($user->computePasswordStrengthTest('ZENFBQfy3xpRarDwG3lN')) && p() && e('2'); //获取[ZENFBQfy3xpRarDwG3lN]密码的强度
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->computeUserViewTest();
|
||||
title=测试 userModel->computeUserView();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -19,13 +19,19 @@ pid=1
|
||||
|
||||
$user = new userTest();
|
||||
|
||||
$adminViews = $user->computeUserViewTest('admin', true);
|
||||
$adminProjects = substr($adminViews->projects, 0, 5);
|
||||
$adminViews = $user->computeUserViewTest('admin');
|
||||
$adminPrograms = substr($adminViews->programs, 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");
|
||||
$computedAdminViews = $user->computeUserViewTest('admin', true);
|
||||
$computedAdminPrograms = substr($computedAdminViews->programs, 0, 3);
|
||||
$computedAdminProducts = substr($computedAdminViews->products, 0, 5);
|
||||
|
||||
r($adminPrograms) && p() && e(',1,2,'); //获取强制计算前admin账户可见的前两个项目集ID
|
||||
r($adminProducts) && p() && e(',1,2,'); //获取强制计算前admin账户可见的前两个产品ID
|
||||
r($computedAdminPrograms) && p() && e('5,6'); //获取强制计算前admin账户可见的前两个项目集ID
|
||||
r($computedAdminProducts) && p() && e(',11,12,'); //获取强制计算前admin账户可见的前两个产品ID
|
||||
r($user->computeUserViewTest('user10')) && p('products') && e('99'); //获取user10账户可见的产品ID
|
||||
r($user->computeUserViewTest('test2')) && p('projects') && e(',12'); //获取test2账户可见的项目ID
|
||||
r($user->computeUserViewTest(null)) && p('account') && e('admin'); //用户名传null,则获取当前登录账户的views
|
||||
system("./ztest init");
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->createUserTest();
|
||||
title=测试 userModel->createUser();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->createContactListTest();
|
||||
title=测试 userModel->createContactList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -21,4 +21,4 @@ r($user->createContactListTest('新的列表名称1', $userList)) && p('listName
|
||||
r($user->createContactListTest('新的列表名称2', $userList)) && p('listName') && e('新的列表名称2'); //插入一条联系人列表,获取插入的联系人列表名称
|
||||
r($user->createContactListTest('新的列表名称3', array())) && p('userList') && e(''); //插入一条联系人列表,获取插入的联系人列表
|
||||
|
||||
system("./ztest init");
|
||||
system("./ztest init");
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->deleteContactListTest();
|
||||
title=测试 userModel->deleteContactList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -23,4 +23,4 @@ r($user->deleteContactListTest(2)) && p('listName') && e('0'); //删除ID为
|
||||
r($user->deleteContactListTest(null)) && p('userLsit') && e('0'); //删除ID为null的联系人列表
|
||||
r($user->deleteContactListTest(1000)) && p('userList') && e('0'); //删除ID为1000的联系人列表
|
||||
|
||||
system("./ztest init");
|
||||
system("./ztest init");
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
title=测试 userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -17,4 +17,4 @@ pid=1
|
||||
$user = new userTest();
|
||||
|
||||
r(count($user->getAvatarPairsTest())) && p() && e('999'); //所有用户头像的数量
|
||||
r($user->getAvatarPairsTest()) && p('user99') && e('/home/z/user/15.png'); //查找account为"user99"的用户的头像路径
|
||||
r($user->getAvatarPairsTest()) && p('user99') && e('/home/z/user/15.png'); //查找account为"user99"的用户的头像路径
|
||||
|
||||
@@ -22,4 +22,4 @@ r($user->getByIDTest('admin', 'account')) && p('account') && e('admin'); //
|
||||
r($user->getByIDTest('admin')) && p('account') && e('admin'); // 通过默认字段获取存在的用户
|
||||
r($user->getByIDTest(1)) && p('account') && e(''); // 通过默认字段获取不存在的用户
|
||||
r($user->getByIDTest(100000, 'id')) && p('account') && e(''); // 通过id字段获取不存在的用户
|
||||
r($user->getByIDTest('error', 'account')) && p('account') && e(''); // 通过默认字段获取不存在的用户
|
||||
r($user->getByIDTest('error', 'account')) && p('account') && e(''); // 通过默认字段获取不存在的用户
|
||||
|
||||
@@ -21,4 +21,4 @@ $outsideUsers = $user->getByQueryTest('outside');
|
||||
|
||||
r(count($insideQAUsers)) && p() && e('303'); //对比获取到的内部用户的数量
|
||||
r($insideQAUsers) && p('302:account') && e('admin'); //按ID倒序查询内部用户,获取最后一个用户的account
|
||||
r($outsideUsers) && p('0:realname') && e('用户1'); //获取第一个外部用户的真实姓名
|
||||
r($outsideUsers) && p('0:realname') && e('用户1'); //获取第一个外部用户的真实姓名
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
title=测试 userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -19,4 +19,4 @@ $user = new userTest();
|
||||
$commiters = $user->getCommitersTest();
|
||||
|
||||
r($commiters) && p('qd100') && e('高层管理100'); //获取源代码账号为qd100的用户真实姓名
|
||||
r(count($commiters)) && p() && e('1000'); //获取系统中源代码账号不为空的用户数量
|
||||
r(count($commiters)) && p() && e('1000'); //获取系统中源代码账号不为空的用户数量
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel::getContactListByIDTest();
|
||||
title=测试 userModel::getContactListByID();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -24,4 +24,4 @@ r($user->getContactListByIDTest(1)) && p('listName') && e('联系人列表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的联系人列表,返回空
|
||||
r($user->getContactListByIDTest(null)) && p() && e('0'); //获取ID为null的联系人列表,返回空
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel::getContactListsTest();
|
||||
title=测试 userModel::getContactLists();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -19,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的联系人列表
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getContactUserPairsTest();
|
||||
title=userModel->getContactUserPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -20,4 +20,4 @@ $accountList = array('admin', 'test2', 'asdffg', null);
|
||||
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真实姓名
|
||||
r($user->getContactUserPairsTest($accountList)) && p('null') && e(''); //根据传入的accountList获取null真实姓名
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getDataInJSON();
|
||||
title=测试 userModel->getDataInJSON();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -26,4 +26,4 @@ $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用户信息,返回公司信息
|
||||
r($user->getDataInJSONTest(null)) && p('user:company') && e('易软天创网络科技有限公司'); //传入null用户信息,返回公司信息
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel::getGroupsTest();
|
||||
title=测试 userModel::getGroups();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -19,4 +19,4 @@ $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,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel::getGroupsByVisionsTest();
|
||||
title=测试 userModel::getGroupsByVisions();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -21,4 +21,4 @@ $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'); // 获取系统中所有用户分组的数量
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getList();
|
||||
title=测试 userModel->getList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -22,4 +22,4 @@ a($user->getListTest());die;
|
||||
r($user->getListTest()) && p('1:realname') && e('开发1'); //查找系统中第二个未删除的、内部用户真实姓名,根据account正序排
|
||||
r($user->getListTest()) && p('998:realname') && e('测试99'); //查找系统中未删除的、根据account正序排的最后一个用户的姓名
|
||||
r($user->getListTest(true)) && p() && e('999'); //查找系统中所有未删除的、内部用户的数量
|
||||
r($user->getListTest()) && p('1000:realname') && e('Error: Cannot get index 1000'); //查找系统中不存在的用户,输出错误提示
|
||||
r($user->getListTest()) && p('1000:realname') && e('Error: Cannot get index 1000'); //查找系统中不存在的用户,输出错误提示
|
||||
|
||||
@@ -22,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的联系人列表
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getListByAccountsTest();
|
||||
title=测试 userModel->getListByAccounts();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -21,4 +21,4 @@ $count = array(0 => false, 1 => true);
|
||||
$user = new userTest();
|
||||
r($user->getListByAccountsTest($accounts, $count[0])) && p('1:realname,role') && e('admin,qa'); //按照给定的用户名列表查询用户信息,获取用户ID为1的用户真实姓名和角色
|
||||
r($user->getListByAccountsTest($accounts, $count[1])) && p() && e('3'); //按照给定的用户名列表查询用户信息,获取查询出的用户列表数量
|
||||
r($user->getListByAccountsTest($accounts, $count[0])) && p('0:realname') && e('Error: Cannot get index 0.'); //按照给定的用户名列表查询用户信息,获取用户ID为0的用户信息
|
||||
r($user->getListByAccountsTest($accounts, $count[0])) && p('0:realname') && e('Error: Cannot get index 0.'); //按照给定的用户名列表查询用户信息,获取用户ID为0的用户信息
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel::getObjectsTest();
|
||||
title=测试 userModel::getObjects();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -30,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'); //传入一个空用户名字段,返回空
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
title=测试 userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -44,4 +44,4 @@ r(count($usersInAccountsWithclosed)) && p() && e('2'); //
|
||||
r(count($limit2Users)) && p() && e('2'); //使用limit参数来限制最多获取2个用户键值对
|
||||
r(count($limit50Users)) && p() && e('50'); //使用limit参数来限制最多获取50个用户键值对
|
||||
r($firstPO) && p('pd58') && e('P:测试主管58'); //使用pofirst参数来将系统中的产品经理用户放到返回值前列
|
||||
r($firstPM) && p('outside100') && e('O:其他100'); //使用pmfirst参数来将系统中的项目经理用户放到返回值前列
|
||||
r($firstPM) && p('outside100') && e('O:其他100'); //使用pmfirst参数来将系统中的项目经理用户放到返回值前列
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel::getParentStageAuthedUsersTest();
|
||||
title=测试 userModel::getParentStageAuthedUsers();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -21,4 +21,4 @@ $user = new userTest();
|
||||
r($user->getParentStageAuthedUsersTest(0)) && p() && e('0'); //传入ID为0的情况获取有权限的用户
|
||||
r($user->getParentStageAuthedUsersTest(131)) && p('admin') && e('admin'); //传入一个阶段ID获取有权限的用户
|
||||
r($user->getParentStageAuthedUsersTest(1)) && p() && e('0'); //传入一个项目集ID获取有权限的用户
|
||||
r($user->getParentStageAuthedUsersTest(161)) && p('admin') && e('admin'); //传入一个看板类型的项目ID获取有权限的用户
|
||||
r($user->getParentStageAuthedUsersTest(161)) && p('admin') && e('admin'); //传入一个看板类型的项目ID获取有权限的用户
|
||||
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/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::getPersonalData();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
$user = new userTest();
|
||||
$adminData = $user->getPersonalDataTest('admin');
|
||||
$test2Data = $user->getPersonalDataTest('test2');
|
||||
$emptyData = $user->getPersonalDataTest('');
|
||||
|
||||
r($adminData) && p('createdBugs') && e('270'); //获取admin用户的createdBugs数量
|
||||
r($test2Data) && p('createdCases') && e('4'); //获取test2用户createdCases数量
|
||||
r($emptyData) && p('createdTodos') && e('2'); //当获取一个空用户的数据时,系统默认返回当前登录用户的数据
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getProductMembersTest();
|
||||
title=测试 userModel->getProductMembers();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -29,4 +29,4 @@ r($teamGroups) && p('4:user5') && e('user5'); //获取ID为4的产品
|
||||
r($stakeholderGroups) && p('2:po3') && e('po3'); //获取ID为2的产品的干系人,判断是否包含po3
|
||||
r($stakeholderGroups) && p('3:user14') && e('user14'); //获取ID为3的产品的干系人,判断是否包含user14
|
||||
|
||||
system("./ztest init");
|
||||
system("./ztest init");
|
||||
|
||||
Executable
+29
@@ -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->getProductViewListUsers();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$stakeholders['test9'] = 'test9';
|
||||
$stakeholders['test10'] = 'test10';
|
||||
|
||||
$teams['pm7'] = 'pm7';
|
||||
$teams['pm8'] = 'pm8';
|
||||
|
||||
$whiteList['user35'] = 'user35';
|
||||
$whiteList['user35'] = 'user35';
|
||||
$whiteList['astaw'] = 'astaw';
|
||||
|
||||
r(count($user->getProductViewListUsersTest(1, $stakeholders, $teams, $whiteList))) && p() && e('11'); //获取对ID为1的产品有权限的用户
|
||||
r($user->getProductViewListUsersTest(1, $stakeholders, $teams, $whiteList)) && p('test9') && e('test9'); //获取对ID为1的产品有权限的用户
|
||||
r($user->getProductViewListUsersTest(1, $stakeholders, $teams, $whiteList)) && p('admin') && e('admin'); //获取对ID为1的产品有权限的用户
|
||||
r($user->getProductViewListUsersTest(2, $stakeholders, $teams, $whiteList)) && p('astaw') && e('astaw'); //获取对ID为2的产品有权限的用户
|
||||
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel->getProgramAuthedUsers();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$stakeholders['test9'] = 'test9';
|
||||
$stakeholders['test10'] = 'test10';
|
||||
|
||||
$whiteList['user35'] = 'user35';
|
||||
$whiteList['user35'] = 'user35';
|
||||
$whiteList['astaw'] = 'astaw';
|
||||
|
||||
r(count($user->getProgramAuthedUsersTest(1, $stakeholders, $whiteList))) && p() && e('6'); //获取对ID为1的项目集有权限的用户数量
|
||||
r($user->getProgramAuthedUsersTest(1, $stakeholders, $whiteList)) && p('test9') && e('test9'); //获取对ID为1的项目集有权限的用户
|
||||
r($user->getProgramAuthedUsersTest(1, $stakeholders, $whiteList)) && p('admin') && e('admin'); //获取对ID为1的项目集有权限的用户
|
||||
r($user->getProgramAuthedUsersTest(2, $stakeholders, $whiteList)) && p('astaw') && e('astaw'); //获取对ID为2的项目集有权限的用户
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel->getProjectAuthedUsers();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
$stakeholders['test9'] = 'test9';
|
||||
$stakeholders['test10'] = 'test10';
|
||||
|
||||
$teams['pm7'] = 'pm7';
|
||||
$teams['pm8'] = 'pm8';
|
||||
|
||||
$whiteList['user35'] = 'user35';
|
||||
$whiteList['user35'] = 'user35';
|
||||
$whiteList['astaw'] = 'astaw';
|
||||
|
||||
r($user->getProjectAuthedUsersTest(1, $stakeholders, $teams, $whiteList)) && p('test9') && e('test9'); //获取对ID为1的产品有权限的用户
|
||||
r($user->getProjectAuthedUsersTest(1, $stakeholders, $teams, $whiteList)) && p('admin') && e('admin'); //获取对ID为1的产品有权限的用户
|
||||
r($user->getProjectAuthedUsersTest(2, $stakeholders, $teams, $whiteList)) && p('astaw') && e('astaw'); //获取对ID为2的产品有权限的用户
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
title=测试 userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -20,4 +20,4 @@ $user = new userTest();
|
||||
$emails = $user->getRealNameAndEmailsTest($accounts);
|
||||
|
||||
r($emails['admin']) && p('email') && e('833482@qq.com'); //获取admin的邮箱
|
||||
r(count($emails)) && p() && e('2'); //从accounts中获取到的用户邮箱数量
|
||||
r(count($emails)) && p() && e('2'); //从accounts中获取到的用户邮箱数量
|
||||
|
||||
Executable
+19
@@ -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->getTeamMemberPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
|
||||
r(count($user->getTeamMemberPairsTest(11, 'project'))) && p() && e('3'); //获取ID为11的项目的团队成员数量
|
||||
r(count($user->getTeamMemberPairsTest(11, 'project', '', array('test2')))) && p() && e('4'); //获取ID为11的项目的团队成员数量,追加用户test2
|
||||
r($user->getTeamMemberPairsTest(110, 'execution')) && p('test1') && e('T:测试1'); //获取ID为110的执行的团队成员成员
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel::getUserDetailsForAPI();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
$user = new userTest();
|
||||
$userList = array('admin', 'test2', 'user10', '');
|
||||
$users = $user->getUserDetailsForAPITest($userList);
|
||||
|
||||
r($users) && p('admin:url') && e('guser-profile-1.'); //获取admin用户的url
|
||||
r($users) && p('test2:realname') && e('测试2'); //获取test2用户的真实姓名
|
||||
r($users) && p('user10:avatar') && e('http:///home/z/tmp/10.png'); //获取user10的头像信息
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
title=测试 userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -23,4 +23,4 @@ $user = new userTest();
|
||||
r($user->getUserDisplayInfosTest($accounts)) && p('dev33:realname') && e('项目经理33'); //查找获取到的用户名为dev33的真实姓名
|
||||
r($user->getUserDisplayInfosTest($accounts)) && p('user10:avatar') && e('/home/z/tmp/10.png'); //查找获取到的用户名为user10的头像
|
||||
r($user->getUserDisplayInfosTest($accounts, 0, 'outside')) && p('outside1:avatar') && e('/home/z/tmp/18.png'); //查找获取到的用户名为outside1的外部用户的头像信息
|
||||
r($user->getUserDisplayInfosTest($accounts)) && p('cccfff:realname') && e('Error: Cannot get index cccfff.'); //查找获取到的用户名为cccfff的真实姓名
|
||||
r($user->getUserDisplayInfosTest($accounts)) && p('cccfff:realname') && e('Error: Cannot get index cccfff.'); //查找获取到的用户名为cccfff的真实姓名
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getPairs();
|
||||
title=测试 userModel->getPairs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -21,4 +21,4 @@ $user = new userTest();
|
||||
r($user->getUserRolesTest($accounts, true)) && p('dev33') && e('dev'); //获取用户名和职位Key的键值对
|
||||
r($user->getUserRolesTest($accounts, false)) && p('dev33') && e('研发'); //获取用户名和职位Value的键值对
|
||||
r(count($user->getUserRolesTest($accounts, true))) && p() && e(2); //从指定accounts中获取到的键值对数量
|
||||
r(count($user->getUserRolesTest($accounts, false))) && p() && e(2); //从指定accounts中获取到的键值对数量
|
||||
r(count($user->getUserRolesTest($accounts, false))) && p() && e(2); //从指定accounts中获取到的键值对数量
|
||||
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/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::getUserTemplates();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
$user = new userTest();
|
||||
|
||||
//r() && p('') && e(''); //
|
||||
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel::getVisionList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
$user = new userTest();
|
||||
$visions = $user->getVisionListTest();
|
||||
|
||||
r(count($visions)) && p() && e('2'); //获取系统visions的数量
|
||||
r($visions) && p('rnd') && e('研发综合界面'); //获取test2用户的真实姓名
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->getWeakUsersTest();
|
||||
title=测试 userModel->getWeakUsers();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -16,4 +16,4 @@ pid=1
|
||||
$user = new userTest();
|
||||
a($user->getWeakUsersTest());die;
|
||||
|
||||
r($user->getWeakUsersTest()) && p('') && e('0'); //获取密码较弱的用户
|
||||
r($user->getWeakUsersTest()) && p('') && e('0'); //获取密码较弱的用户
|
||||
|
||||
Executable
+32
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel->grantUserView();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
|
||||
$adminViews = $user->grantUserViewTest('admin');
|
||||
$test2Views = $user->grantUserViewTest('test2');
|
||||
$user10Views = $user->grantUserViewTest('user10');
|
||||
$nullViews = $user->grantUserViewTest(null);
|
||||
|
||||
$adminProjects = substr($adminViews->projects, 0, 5);
|
||||
$adminProducts = substr($adminViews->products, 0, 5);
|
||||
$test2Projects = substr($test2Views->projects, 0, 5);
|
||||
$user10Projects = substr($user10Views->projects, 0, 5);
|
||||
|
||||
r($adminProjects) && p() && e('12,13'); //获取admin账户可见的前两个项目的ID
|
||||
r($adminProducts) && p() && e('11,12'); //获取admin账户可见的前两个产品的ID
|
||||
r($test2Projects) && p() && e('12,11'); //获取test2账户可见的前两个项目的ID
|
||||
r($user10Projects) && p() && e('19,11'); //获取user10账户可见的前两个项目的ID
|
||||
r($nullViews) && p() && e(''); //获取null账户可见的项目、产品等
|
||||
system("./ztest init");
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->identifyTest();
|
||||
title=测试 userModel->identify();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -20,4 +20,4 @@ $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'); //验证一个不传用户名和密码的用户,返回空
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->loginTest();
|
||||
title=测试 userModel->login();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -30,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
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->resetPasswordTest();
|
||||
title=测试 userModel->resetPassword();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -38,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");
|
||||
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/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::saveUserTemplate();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
$user = new userTest();
|
||||
$tpl1['title'] = 'Admin的模板一';
|
||||
$tpl1['content'] = '<p>这是一段模板内容</p>';
|
||||
|
||||
$tpl2['title'] = 'Admin的模板二';
|
||||
$tpl2['content'] = '<p>这是二段模板内容</p>';
|
||||
|
||||
$tpl3['title'] = 'Admin的模板三';
|
||||
$tpl3['content'] = '<p>这是三段模板内容</p>';
|
||||
|
||||
$_POST = $tpl1;
|
||||
$tpls1 = $user->saveUserTemplate('bug');
|
||||
|
||||
$_POST = $tpl2;
|
||||
$tpls2 = $user->saveUserTemplate('task');
|
||||
|
||||
$_POST = $tpl3;
|
||||
$tpls3 = $user->saveUserTemplate('task');
|
||||
|
||||
r(count($tpls1)) && p() && e('1'); //插入一条Bug用户模板,查看数量
|
||||
r(count($tpls3)) && p() && e('2'); //插入两条任务类型的用户模板,查看数量
|
||||
r($tpls2) && p('0:title') && e('Admin的模板二'); //查看插入的模板二的名字
|
||||
r($tpls2) && p('0:content') && e('<p>这是一段模板内容</p>'); //查看插入的模板二的内容
|
||||
|
||||
system("./ztest init");
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->updateUserTest();
|
||||
title=测试 userModel->updateUser();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -40,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");
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->updateContactList();
|
||||
title=测试 userModel->updateContactList();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -23,4 +23,4 @@ r($user->updateContactListTest(2, '新的列表名称2', $userList)) && p('l
|
||||
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");
|
||||
system("./ztest init");
|
||||
|
||||
@@ -6,7 +6,7 @@ su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=userModel->updatePasswordTest();
|
||||
title=测试 userModel->updatePassword();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
@@ -33,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");
|
||||
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/user.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 userModel->updateProgramView();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
|
||||
$programIdList = array('1', '2');
|
||||
|
||||
//r() && p() && e(''); //
|
||||
//system("./ztest init");
|
||||
Reference in New Issue
Block a user