Class ilObjUserTest needsInstalledILIAS.
More...
Class ilObjUserTest needsInstalledILIAS.
Definition at line 8 of file ilObjUserTest.php.
◆ setUp()
Definition at line 12 of file ilObjUserTest.php.
14 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
15 ilUnitUtil::performInitialisation();
◆ testAuthAndEmailMethods()
ilObjUserTest::testAuthAndEmailMethods |
( |
| ) |
|
Auth and email related methods IL_Init.
Definition at line 121 of file ilObjUserTest.php.
References $d, ilObjUser\_checkExternalAuthAccount(), ilObjUser\_externalAccountExists(), ilObjUser\_getExternalAccountsByAuthMode(), ilObjUser\_getLocalAccountsForEmail(), ilObjUser\_getLoginAttempts(), ilObjUser\_getNumberOfUsersPerAuthMode(), ilObjUser\_getUserIdsByEmail(), ilObjUser\_incrementLoginAttempts(), ilObjUser\_lookupAuthMode(), ilObjUser\_resetLoginAttempts(), ilObjUser\_setUserInactive(), ilObjUser\_writeAuthMode(), ilObjUser\_writeExternalAccount(), array, ilObjUser\getUserIdByEmail(), and IL_PASSWD_PLAIN.
123 include_once(
"./Services/User/classes/class.ilObjUser.php");
130 "login" =>
"aatestuser2",
132 "passwd" =>
"password",
134 "firstname" =>
"Heidi",
135 "lastname" =>
"Kabel",
136 "email" =>
"qwe@ty.de",
137 "ext_account" =>
"ext_" 139 $user->assignData(
$d);
140 $user->setActive(
true);
143 $user->setLanguage(
"de");
145 $id = $user->getId();
151 if (is_array($ids) && count($ids) == 1 && $ids[0] ==
"aatestuser2")
162 foreach ($acc as $k => $v)
163 if ($k == $id && $v ==
"ext_kabel")
194 $this->assertEquals(
"email1-email2-auth1-auth2-auth3-auth4-",
static _incrementLoginAttempts($a_usr_id)
static _getExternalAccountsByAuthMode($a_auth_mode, $a_read_auth_default=false)
Get list of external account by authentication method Note: If login == ext_account for two user with...
static _resetLoginAttempts($a_usr_id)
static _getLoginAttempts($a_usr_id)
for($col=0; $col< 50; $col++) $d
static _externalAccountExists($a_external_account, $a_auth_mode)
Check if an external account name already exists.
getUserIdByEmail($a_email)
STATIC METHOD get the user_id of an email address.
static _getLocalAccountsForEmail($a_email)
check whether external account and authentication method matches with a user
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
Create styles array
The data for the language used.
static _lookupAuthMode($a_usr_id)
lookup auth mode
static _setUserInactive($a_usr_id)
static _checkExternalAuthAccount($a_auth, $a_account)
check whether external account and authentication method matches with a user
static _getUserIdsByEmail($a_email)
STATIC METHOD get all user_ids of an email address.
static _writeAuthMode($a_usr_id, $a_auth_mode)
static _writeExternalAccount($a_usr_id, $a_ext_id)
◆ testClipboard()
ilObjUserTest::testClipboard |
( |
| ) |
|
Clipboard IL_Init.
Definition at line 293 of file ilObjUserTest.php.
References $d, ilObjUser\_getUsersForClipboadObject(), array, and IL_PASSWD_PLAIN.
300 "login" =>
"aatestuser3",
302 "passwd" =>
"password",
304 "firstname" =>
"Heidi",
305 "lastname" =>
"Kabel",
306 "email" =>
"de@de.de" 308 $user->assignData(
$d);
309 $user->setActive(
true);
312 $user->setLanguage(
"de");
314 $id = $user->getId();
316 $user->addObjectToClipboard($id,
"user",
"aatestuser");
317 $user->addObjectToClipboard(56,
"mump",
"mumpitz");
318 if ($user->clipboardHasObjectsOfType(
"user"))
323 $user->clipboardDeleteObjectsOfType(
"user");
324 if ($user->clipboardHasObjectsOfType(
"mump") &&
325 !$user->clipboardHasObjectsOfType(
"user"))
330 $objs = $user->getClipboardObjects(
"mump");
331 if (is_array($objs) && count($objs) == 1 && $objs[0][
"id"] == 56)
336 $objs = $user->getClipboardChilds(56,
"2008-10-10");
340 if (is_array($us) && count($us) == 1 && $us[0] == $id)
347 $this->assertEquals(
"clip1-clip2-clip3-clip4-",
static _getUsersForClipboadObject($a_type, $a_id)
get all users, that have a certain object within their clipboard
for($col=0; $col< 50; $col++) $d
Create styles array
The data for the language used.
◆ testCreateSetLookupDelete()
ilObjUserTest::testCreateSetLookupDelete |
( |
| ) |
|
Creates a user, sets preferences, lookups data, delete user IL_Init.
Definition at line 22 of file ilObjUserTest.php.
References $d, $n, ilObjUser\_loginExists(), ilObjUser\_lookupClientIP(), ilObjUser\_lookupEmail(), ilObjUser\_lookupExternalAccount(), ilObjUser\_lookupFields(), ilObjUser\_lookupGender(), ilObjUser\_lookupId(), ilObjUser\_lookupLanguage(), ilObjUser\_lookupLastLogin(), ilObjUser\_lookupLogin(), ilObjUser\_lookupName(), ilObjUser\_lookupPref(), ilObjUser\_readUsersProfileData(), ilObjUser\_toggleActiveStatusOfUsers(), array, ilObjUser\getStoredActive(), and IL_PASSWD_PLAIN.
24 include_once(
"./Services/User/classes/class.ilObjUser.php");
38 "login" =>
"aatestuser",
40 "passwd" =>
"password",
43 "lastname" =>
"Mutzke",
44 "email" =>
"de@de.de",
45 "client_ip" =>
"1.2.3.4",
46 "ext_account" =>
"ext_mutzke" 48 $user->assignData(
$d);
51 $user->setLanguage(
"no");
54 $value.= $user->getFirstname().
"-";
57 $user->setFirstname(
"Maxi");
59 $value.= $user->getFirstname().
"-";
62 $user->refreshLogin();
69 $value.=
$n[
"lastname"].
"-";
83 $user->writePref(
"testpref",
"pref1");
85 $user->deletePref(
"testpref");
92 $user->setActive(
false);
97 $user->setActive(
true);
111 $this->assertEquals(
"Max-Maxi-de@de.de-m-1.2.3.4-Mutzke-aatestuser-ext_mutzke-$id-no-le-".
112 "pref1-pref2-act1-act2-act3-",
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
static _lookupExternalAccount($a_user_id)
lookup external account for login and authmethod
static _lookupId($a_user_str)
Lookup id by login.
static _lookupClientIP($a_user_id)
Lookup client ip.
static _lookupGender($a_user_id)
Lookup gender.
static _toggleActiveStatusOfUsers($a_usr_ids, $a_status)
Toggle active status of users.
for($col=0; $col< 50; $col++) $d
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
static _loginExists($a_login, $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
Create styles array
The data for the language used.
static _lookupLanguage($a_usr_id)
static _lookupEmail($a_user_id)
Lookup email.
static _lookupPref($a_usr_id, $a_keyword)
getStoredActive($a_id)
get user active state
static _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
static _lookupLastLogin($a_user_id)
lookup last login
◆ testMiscellaneous()
ilObjUserTest::testMiscellaneous |
( |
| ) |
|
◆ testPersonalDesktopItems()
ilObjUserTest::testPersonalDesktopItems |
( |
| ) |
|
Personal Desktop Items IL_Init.
Definition at line 202 of file ilObjUserTest.php.
References $d, array, and IL_PASSWD_PLAIN.
204 include_once(
"./Services/User/classes/class.ilObjUser.php");
211 "login" =>
"aatestuser3",
213 "passwd" =>
"password",
215 "firstname" =>
"Heidi",
216 "lastname" =>
"Kabel",
217 "email" =>
"de@de.de" 219 $user->assignData(
$d);
220 $user->setActive(
true);
223 $user->setLanguage(
"de");
225 $id = $user->getId();
227 $user->addDesktopItem(ROOT_FOLDER_ID,
"root");
228 if ($user->isDesktopItem(ROOT_FOLDER_ID,
"root"))
232 $user->setDesktopItemParameters(ROOT_FOLDER_ID,
"root",
"par1");
233 $di = $user->getDesktopItems();
234 if ($item = current($di))
236 if ($item[
"type"] ==
"root" && $item[
"ref_id"] == ROOT_FOLDER_ID)
242 $user->dropDesktopItem(ROOT_FOLDER_ID,
"root");
243 if (!$user->isDesktopItem(ROOT_FOLDER_ID,
"root"))
247 $user->_removeItemFromDesktops(ROOT_FOLDER_ID);
252 $this->assertEquals(
"desk1-desk2-desk3-",
for($col=0; $col< 50; $col++) $d
Create styles array
The data for the language used.
◆ testSearch()
ilObjUserTest::testSearch |
( |
| ) |
|
Search methods IL_Init.
Definition at line 260 of file ilObjUserTest.php.
References ilObjUser\_getAllUserData(), array, and ilObjUser\searchUsers().
262 include_once(
"./Services/User/classes/class.ilObjUser.php");
285 $this->assertEquals(
"",
static _getAllUserData($a_fields=NULL, $active=-1)
STATIC METHOD get all user data.
static searchUsers($a_search_str, $active=1, $a_return_ids_only=false, $filter_settings=FALSE)
STATIC METHOD get the user_ids which correspond a search string.
Create styles array
The data for the language used.
◆ $backupGlobals
ilObjUserTest::$backupGlobals = FALSE |
|
protected |
The documentation for this class was generated from the following file: