* Add testcase of user module.
This commit is contained in:
@@ -932,4 +932,15 @@ class userTest
|
||||
{
|
||||
return $this->objectModel->getVisionList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get users who have authority to create stories.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getCanCreateStoryUsersTest()
|
||||
{
|
||||
return $this->objectModel->getCanCreateStoryUsers();
|
||||
}
|
||||
}
|
||||
|
||||
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->getCanCreateStoryUsers();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查找系统中有权限创建、批量创建需求的用户 >> A:admin;T:产品主管48
|
||||
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
r($user->getCanCreateStoryUsersTest()) && p('admin;td48') && e('A:admin;T:产品主管48'); //查找系统中有权限创建、批量创建需求的用户
|
||||
@@ -18,7 +18,7 @@ pid=1
|
||||
*/
|
||||
|
||||
$user = new userTest();
|
||||
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'); //查找系统中所有未删除的、内部用户的数量
|
||||
|
||||
Reference in New Issue
Block a user