diff --git a/test/class/user.class.php b/test/class/user.class.php index 523ea0beab..51e4393123 100755 --- a/test/class/user.class.php +++ b/test/class/user.class.php @@ -869,4 +869,67 @@ class userTest { 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(); + } } diff --git a/test/model/user/authorize.php b/test/model/user/authorize.php index dd2254e3ca..f18ddb114e 100755 --- a/test/model/user/authorize.php +++ b/test/model/user/authorize.php @@ -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'); //获取空用户名的权限,返回空 \ No newline at end of file +r($user->authorizeTest('')) && p('') && e('0'); //获取空用户名的权限,返回空 diff --git a/test/model/user/batchcreate.php b/test/model/user/batchcreate.php index 2348dd02e7..b2cd91abf9 100755 --- a/test/model/user/batchcreate.php +++ b/test/model/user/batchcreate.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/batchedit.php b/test/model/user/batchedit.php index 88c35c9071..0dd027f8c0 100755 --- a/test/model/user/batchedit.php +++ b/test/model/user/batchedit.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/checkpassword.php b/test/model/user/checkpassword.php index 9143d3e1ce..756acc6773 100755 --- a/test/model/user/checkpassword.php +++ b/test/model/user/checkpassword.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/checkproductpriv.php b/test/model/user/checkproductpriv.php index 55406d1411..96cf3d64cd 100755 --- a/test/model/user/checkproductpriv.php +++ b/test/model/user/checkproductpriv.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->checkProductPrivTest(); +title=测试 userModel->checkProductPriv(); cid=1 pid=1 diff --git a/test/model/user/checkprogrampriv.php b/test/model/user/checkprogrampriv.php index 24c4bff585..e1716754fb 100755 --- a/test/model/user/checkprogrampriv.php +++ b/test/model/user/checkprogrampriv.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->checkProgramPrivTest(); +title=测试 userModel->checkProgramPriv(); cid=1 pid=1 diff --git a/test/model/user/checkprojectpriv.php b/test/model/user/checkprojectpriv.php index ec85d9892e..c445579e66 100755 --- a/test/model/user/checkprojectpriv.php +++ b/test/model/user/checkprojectpriv.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->checkProjectPrivTest(); +title=测试 userModel->checkProjectPriv(); cid=1 pid=1 diff --git a/test/model/user/checksprintpriv.php b/test/model/user/checksprintpriv.php index d033a09585..87e47795c7 100755 --- a/test/model/user/checksprintpriv.php +++ b/test/model/user/checksprintpriv.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->checkSprintPrivTest(); +title=测试 userModel->checkSprintPriv(); cid=1 pid=1 diff --git a/test/model/user/computepasswordstrengthtest.php b/test/model/user/computepasswordstrengthtest.php index 39381672e6..679d7d138a 100755 --- a/test/model/user/computepasswordstrengthtest.php +++ b/test/model/user/computepasswordstrengthtest.php @@ -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]密码的强度 \ No newline at end of file +r($user->computePasswordStrengthTest('ZENFBQfy3xpRarDwG3lN')) && p() && e('2'); //获取[ZENFBQfy3xpRarDwG3lN]密码的强度 diff --git a/test/model/user/computeuserview.php b/test/model/user/computeuserview.php index e2c3dd3133..560162bafa 100755 --- a/test/model/user/computeuserview.php +++ b/test/model/user/computeuserview.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->computeUserViewTest(); +title=测试 userModel->computeUserView(); cid=1 pid=1 diff --git a/test/model/user/create.php b/test/model/user/create.php index 50ca8882e7..f8aa8a4ca5 100755 --- a/test/model/user/create.php +++ b/test/model/user/create.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/createcontactlist.php b/test/model/user/createcontactlist.php index 8af810363a..de200d564c 100644 --- a/test/model/user/createcontactlist.php +++ b/test/model/user/createcontactlist.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/deletecontactlist.php b/test/model/user/deletecontactlist.php index d7afb2c1e5..8345fb9a19 100644 --- a/test/model/user/deletecontactlist.php +++ b/test/model/user/deletecontactlist.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/getavatarpairs.php b/test/model/user/getavatarpairs.php index 37c6e80893..b59acb7e98 100755 --- a/test/model/user/getavatarpairs.php +++ b/test/model/user/getavatarpairs.php @@ -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"的用户的头像路径 \ No newline at end of file +r($user->getAvatarPairsTest()) && p('user99') && e('/home/z/user/15.png'); //查找account为"user99"的用户的头像路径 diff --git a/test/model/user/getbyid.php b/test/model/user/getbyid.php index 533b877ebe..016ed64221 100755 --- a/test/model/user/getbyid.php +++ b/test/model/user/getbyid.php @@ -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(''); // 通过默认字段获取不存在的用户 \ No newline at end of file +r($user->getByIDTest('error', 'account')) && p('account') && e(''); // 通过默认字段获取不存在的用户 diff --git a/test/model/user/getbyquery.php b/test/model/user/getbyquery.php index c3cd097b94..345a77376a 100755 --- a/test/model/user/getbyquery.php +++ b/test/model/user/getbyquery.php @@ -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'); //获取第一个外部用户的真实姓名 \ No newline at end of file +r($outsideUsers) && p('0:realname') && e('用户1'); //获取第一个外部用户的真实姓名 diff --git a/test/model/user/getcommiters.php b/test/model/user/getcommiters.php index d6466aafbc..dfcdd017dc 100755 --- a/test/model/user/getcommiters.php +++ b/test/model/user/getcommiters.php @@ -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'); //获取系统中源代码账号不为空的用户数量 \ No newline at end of file +r(count($commiters)) && p() && e('1000'); //获取系统中源代码账号不为空的用户数量 diff --git a/test/model/user/getcontactlistbyid.php b/test/model/user/getcontactlistbyid.php index bdfbc68554..431dbb1189 100755 --- a/test/model/user/getcontactlistbyid.php +++ b/test/model/user/getcontactlistbyid.php @@ -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的联系人列表,返回空 \ No newline at end of file +r($user->getContactListByIDTest(null)) && p() && e('0'); //获取ID为null的联系人列表,返回空 diff --git a/test/model/user/getcontactlists.php b/test/model/user/getcontactlists.php index e0566b2eb5..b5d92a828c 100755 --- a/test/model/user/getcontactlists.php +++ b/test/model/user/getcontactlists.php @@ -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的联系人列表 \ No newline at end of file +r($adminContactList) && p() && e('0'); // 获取admin的联系人列表 diff --git a/test/model/user/getcontactuserpairs.php b/test/model/user/getcontactuserpairs.php index 8440daeb33..c4eb2d59af 100755 --- a/test/model/user/getcontactuserpairs.php +++ b/test/model/user/getcontactuserpairs.php @@ -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真实姓名 \ No newline at end of file +r($user->getContactUserPairsTest($accountList)) && p('null') && e(''); //根据传入的accountList获取null真实姓名 diff --git a/test/model/user/getdatainjson.php b/test/model/user/getdatainjson.php index 117cf50b01..5906407d65 100644 --- a/test/model/user/getdatainjson.php +++ b/test/model/user/getdatainjson.php @@ -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用户信息,返回公司信息 \ No newline at end of file +r($user->getDataInJSONTest(null)) && p('user:company') && e('易软天创网络科技有限公司'); //传入null用户信息,返回公司信息 diff --git a/test/model/user/getgroups.php b/test/model/user/getgroups.php index 513c8eb460..bed4872331 100755 --- a/test/model/user/getgroups.php +++ b/test/model/user/getgroups.php @@ -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'); // 传空用户名,返回空 \ No newline at end of file +r($user->getGroupsTest('')) && p() && e('0'); // 传空用户名,返回空 diff --git a/test/model/user/getgroupsbyvisions.php b/test/model/user/getgroupsbyvisions.php index cb7998f81f..51a79fd348 100755 --- a/test/model/user/getgroupsbyvisions.php +++ b/test/model/user/getgroupsbyvisions.php @@ -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'); // 获取系统中所有用户分组的数量 \ No newline at end of file +r(count($user->getGroupsByVisionsTest(array('rnd','lite')))) && p() && e('17'); // 获取系统中所有用户分组的数量 diff --git a/test/model/user/getlist.php b/test/model/user/getlist.php index 4cc11069ae..abb3fa8847 100755 --- a/test/model/user/getlist.php +++ b/test/model/user/getlist.php @@ -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'); //查找系统中不存在的用户,输出错误提示 \ No newline at end of file +r($user->getListTest()) && p('1000:realname') && e('Error: Cannot get index 1000'); //查找系统中不存在的用户,输出错误提示 diff --git a/test/model/user/getlistbyaccount.php b/test/model/user/getlistbyaccount.php index d5c4294612..17776ff9db 100755 --- a/test/model/user/getlistbyaccount.php +++ b/test/model/user/getlistbyaccount.php @@ -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的联系人列表 \ No newline at end of file +r($emptyContactList) && p() && e('0'); // 获取admin的联系人列表 diff --git a/test/model/user/getlistbyaccounts.php b/test/model/user/getlistbyaccounts.php index 3e25f2c71d..a87c65c402 100755 --- a/test/model/user/getlistbyaccounts.php +++ b/test/model/user/getlistbyaccounts.php @@ -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的用户信息 \ No newline at end of file +r($user->getListByAccountsTest($accounts, $count[0])) && p('0:realname') && e('Error: Cannot get index 0.'); //按照给定的用户名列表查询用户信息,获取用户ID为0的用户信息 diff --git a/test/model/user/getobjects.php b/test/model/user/getobjects.php index d814c4c8ec..1775d4c4a9 100755 --- a/test/model/user/getobjects.php +++ b/test/model/user/getobjects.php @@ -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'); //传入一个空用户名字段,返回空 \ No newline at end of file +r($emptyUser) && p('') && e('0'); //传入一个空用户名字段,返回空 diff --git a/test/model/user/getpairs.php b/test/model/user/getpairs.php index 2d6e4fd5f4..95da465942 100755 --- a/test/model/user/getpairs.php +++ b/test/model/user/getpairs.php @@ -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参数来将系统中的项目经理用户放到返回值前列 \ No newline at end of file +r($firstPM) && p('outside100') && e('O:其他100'); //使用pmfirst参数来将系统中的项目经理用户放到返回值前列 diff --git a/test/model/user/getparentstageauthedusers.php b/test/model/user/getparentstageauthedusers.php index 08c4905f95..0300ed3249 100755 --- a/test/model/user/getparentstageauthedusers.php +++ b/test/model/user/getparentstageauthedusers.php @@ -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获取有权限的用户 \ No newline at end of file +r($user->getParentStageAuthedUsersTest(161)) && p('admin') && e('admin'); //传入一个看板类型的项目ID获取有权限的用户 diff --git a/test/model/user/getpersonaldata.php b/test/model/user/getpersonaldata.php new file mode 100755 index 0000000000..8cb9002cfa --- /dev/null +++ b/test/model/user/getpersonaldata.php @@ -0,0 +1,21 @@ +#!/usr/bin/env php +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'); //当获取一个空用户的数据时,系统默认返回当前登录用户的数据 diff --git a/test/model/user/getproductmembers.php b/test/model/user/getproductmembers.php index 91d93393ad..7f62580569 100755 --- a/test/model/user/getproductmembers.php +++ b/test/model/user/getproductmembers.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/getproductviewlistusers.php b/test/model/user/getproductviewlistusers.php index 4fcf559135..bf7da36c9b 100755 --- a/test/model/user/getproductviewlistusers.php +++ b/test/model/user/getproductviewlistusers.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->getProductViewListUsersTest(); +title=测试 userModel->getProductViewListUsers(); cid=1 pid=1 diff --git a/test/model/user/getprogramauthedusers.php b/test/model/user/getprogramauthedusers.php index f3cb11f1f5..e359354c2b 100755 --- a/test/model/user/getprogramauthedusers.php +++ b/test/model/user/getprogramauthedusers.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->getProgramAuthedUsersTest(); +title=测试 userModel->getProgramAuthedUsers(); cid=1 pid=1 diff --git a/test/model/user/getprojectauthedusers.php b/test/model/user/getprojectauthedusers.php index 630da656c5..9dd80c4565 100755 --- a/test/model/user/getprojectauthedusers.php +++ b/test/model/user/getprojectauthedusers.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->getProjectAuthedUsersTest(); +title=测试 userModel->getProjectAuthedUsers(); cid=1 pid=1 diff --git a/test/model/user/getrealnameandemails.php b/test/model/user/getrealnameandemails.php index 5dda0f0dc9..436f41664e 100755 --- a/test/model/user/getrealnameandemails.php +++ b/test/model/user/getrealnameandemails.php @@ -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中获取到的用户邮箱数量 \ No newline at end of file +r(count($emails)) && p() && e('2'); //从accounts中获取到的用户邮箱数量 diff --git a/test/model/user/getteammemberpairstest.php b/test/model/user/getteammemberpairs.php similarity index 93% rename from test/model/user/getteammemberpairstest.php rename to test/model/user/getteammemberpairs.php index 07276220ad..aed84a877d 100755 --- a/test/model/user/getteammemberpairstest.php +++ b/test/model/user/getteammemberpairs.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->getTeamMemberPairsTest(); +title=测试 userModel->getTeamMemberPairs(); cid=1 pid=1 diff --git a/test/model/user/getuserdetailsforapi.php b/test/model/user/getuserdetailsforapi.php new file mode 100755 index 0000000000..800ceb9035 --- /dev/null +++ b/test/model/user/getuserdetailsforapi.php @@ -0,0 +1,20 @@ +#!/usr/bin/env php +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的头像信息 diff --git a/test/model/user/getuserdisplayinfos.php b/test/model/user/getuserdisplayinfos.php index 8366fa54f2..2b3e9dd87b 100755 --- a/test/model/user/getuserdisplayinfos.php +++ b/test/model/user/getuserdisplayinfos.php @@ -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的真实姓名 \ No newline at end of file +r($user->getUserDisplayInfosTest($accounts)) && p('cccfff:realname') && e('Error: Cannot get index cccfff.'); //查找获取到的用户名为cccfff的真实姓名 diff --git a/test/model/user/getuserroles.php b/test/model/user/getuserroles.php index 8f2efdde53..6c170d30fd 100755 --- a/test/model/user/getuserroles.php +++ b/test/model/user/getuserroles.php @@ -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中获取到的键值对数量 \ No newline at end of file +r(count($user->getUserRolesTest($accounts, false))) && p() && e(2); //从指定accounts中获取到的键值对数量 diff --git a/test/model/user/getusertemplates.php b/test/model/user/getusertemplates.php new file mode 100755 index 0000000000..afdb94f578 --- /dev/null +++ b/test/model/user/getusertemplates.php @@ -0,0 +1,16 @@ +#!/usr/bin/env php +getVisionListTest(); + +r(count($visions)) && p() && e('2'); //获取系统visions的数量 +r($visions) && p('rnd') && e('研发综合界面'); //获取test2用户的真实姓名 diff --git a/test/model/user/getweakusers.php b/test/model/user/getweakusers.php index 876e09d912..efd4808d3a 100644 --- a/test/model/user/getweakusers.php +++ b/test/model/user/getweakusers.php @@ -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'); //获取密码较弱的用户 \ No newline at end of file +r($user->getWeakUsersTest()) && p('') && e('0'); //获取密码较弱的用户 diff --git a/test/model/user/grantuserviewtest.php b/test/model/user/grantuserviewtest.php index f68662a615..b2e981e2db 100755 --- a/test/model/user/grantuserviewtest.php +++ b/test/model/user/grantuserviewtest.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->grantUserViewTest(); +title=测试 userModel->grantUserView(); cid=1 pid=1 diff --git a/test/model/user/identify.php b/test/model/user/identify.php index 8bbbd7c80a..33e7c8e07d 100755 --- a/test/model/user/identify.php +++ b/test/model/user/identify.php @@ -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'); //验证一个不传用户名和密码的用户,返回空 \ No newline at end of file +r($user->identifyTest('', '')) && p() && e('0'); //验证一个不传用户名和密码的用户,返回空 diff --git a/test/model/user/login.php b/test/model/user/login.php index e7153b6034..d731ca8cef 100755 --- a/test/model/user/login.php +++ b/test/model/user/login.php @@ -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 \ No newline at end of file +r(count($emptyAccount->group)) && p() && e('0'); //使用空账号登录,返回权限列表数量为0 diff --git a/test/model/user/resetpassword.php b/test/model/user/resetpassword.php index 021425e251..35a633cae2 100755 --- a/test/model/user/resetpassword.php +++ b/test/model/user/resetpassword.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/saveusertemplate.php b/test/model/user/saveusertemplate.php new file mode 100755 index 0000000000..154714b6f4 --- /dev/null +++ b/test/model/user/saveusertemplate.php @@ -0,0 +1,38 @@ +#!/usr/bin/env php +这是一段模板内容

'; + +$tpl2['title'] = 'Admin的模板二'; +$tpl2['content'] = '

这是二段模板内容

'; + +$tpl3['title'] = 'Admin的模板三'; +$tpl3['content'] = '

这是三段模板内容

'; + +$_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('

这是一段模板内容

'); //查看插入的模板二的内容 + +system("./ztest init"); diff --git a/test/model/user/update.php b/test/model/user/update.php index b0d51613e3..e58500070c 100755 --- a/test/model/user/update.php +++ b/test/model/user/update.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/updatecontactList.php b/test/model/user/updatecontactList.php index 6ca6649ded..73e33a6f4f 100644 --- a/test/model/user/updatecontactList.php +++ b/test/model/user/updatecontactList.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/updatepassword.php b/test/model/user/updatepassword.php index b78d289c7f..222328587e 100755 --- a/test/model/user/updatepassword.php +++ b/test/model/user/updatepassword.php @@ -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"); \ No newline at end of file +system("./ztest init"); diff --git a/test/model/user/updateprogramview.php b/test/model/user/updateprogramview.php index 4298b7071e..2ccf57c7f4 100755 --- a/test/model/user/updateprogramview.php +++ b/test/model/user/updateprogramview.php @@ -6,7 +6,7 @@ su('admin'); /** -title=userModel->updateProgramViewTest(); +title=测试 userModel->updateProgramView(); cid=1 pid=1