Lines Matching refs:auth
113 * @param auth_plugin_authpdo $auth
116 protected function runGeneralTests(auth_plugin_authpdo $auth, $users) { argument
118 $info = 'DSN: ' . $auth->getConf('dsn');
119 $this->assertTrue($auth->success, $info);
121 if($auth->canDo('getUsers')) {
122 $list = $auth->retrieveUsers();
126 if($auth->canDo('getGroups')) {
127 $list = $auth->retrieveGroups();
131 if($auth->canDo('getUserCount')) {
132 $count = $auth->getUserCount();
136 if($auth->canDo('addUser')) {
144 $ok = $auth->createUser(
152 $check = $auth->getUserData($newuser['user']);
163 * @param auth_plugin_authpdo $auth
166 protected function runUserTests(auth_plugin_authpdo $auth, $user) { argument
168 $info = 'DSN: ' . $auth->getConf('dsn') . ' User:' . $user['user'];
171 $this->assertTrue($auth->checkPass($user['user'], $user['pass']), $info);
172 $check = $auth->getUserData($user['user']);
180 if($auth->canDo('getUsers')) {
181 $list = $auth->retrieveUsers(0, -1, array('user' => $user['user']));
183 $list = $auth->retrieveUsers(0, -1, array('name' => $user['name']));
185 $list = $auth->retrieveUsers(0, -1, array('mail' => $user['mail']));
190 if($auth->canDo('getUserCount')) {
191 $count = $auth->getUserCount(array('user' => $user['user']));
193 $count = $auth->getUserCount(array('name' => $user['name']));
195 $count = $auth->getUserCount(array('mail' => $user['mail']));
200 if($auth->canDo('modGroups')) {
202 $ok = $auth->modifyUser($user['user'], array('grps' => array($newgroup)));
204 $check = $auth->getUserData($user['user']);
209 if($auth->canDo('modPass')) {
211 $ok = $auth->modifyUser($user['user'], array('pass' => $newpass));
213 $this->assertTrue($auth->checkPass($user['user'], $newpass), $info);
217 if($auth->canDo('modMail')) {
219 $ok = $auth->modifyUser($user['user'], array('mail' => $newmail));
221 $check = $auth->getUserData($user['user']);
226 if($auth->canDo('modName')) {
228 $ok = $auth->modifyUser($user['user'], array('name' => $newname));
230 $check = $auth->getUserData($user['user']);
235 if($auth->canDo('modLogin')) {
237 $ok = $auth->modifyUser($user['user'], array('user' => $newuser));
239 $check = $auth->getUserData($newuser);
242 $ok = $auth->modifyUser($newuser, array('user' => $user['user']));
247 if($auth->canDo('delUser')) {
248 $num = $auth->deleteUsers(array($user['user']));
250 $this->assertFalse($auth->getUserData($user['user']), $info);
306 $auth = new auth_plugin_authpdo();
308 $this->runGeneralTests($auth, $data['users']);
310 $this->runUserTests($auth, $user);