10 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
11 ilUnitUtil::performInitialisation();
21 include_once(
"./Services/User/classes/class.ilObjUser.php");
35 "login" =>
"aatestuser",
37 "passwd" =>
"password",
40 "lastname" =>
"Mutzke",
41 "email" =>
"de@de.de",
42 "client_ip" =>
"1.2.3.4",
43 "ext_account" =>
"ext_mutzke"
45 $user->assignData(
$d);
48 $user->setLanguage(
"no");
51 $value.= $user->getFirstname().
"-";
54 $user->setFirstname(
"Maxi");
56 $value.= $user->getFirstname().
"-";
59 $user->refreshLogin();
66 $value.=
$n[
"lastname"].
"-";
84 $user->replacePassword(md5(
"password2"));
89 $user->updatePassword(
"password2",
"password3",
"password3");
94 $user->resetPassword(
"password4",
"password4");
101 $user->writePref(
"testpref",
"pref1");
103 $user->deletePref(
"testpref");
106 $value.=
"pref2".
"-";
110 $user->setActive(
false);
115 $user->setActive(
true);
129 $this->assertEquals(
"Max-Maxi-de@de.de-m-1.2.3.4-Mutzke-aatestuser-ext_mutzke-$id-no-le-".
130 "pw1-pw2-pw3-pw4-pref1-pref2-act1-act2-act3-",
141 include_once(
"./Services/User/classes/class.ilObjUser.php");
148 "login" =>
"aatestuser2",
150 "passwd" =>
"password",
152 "firstname" =>
"Heidi",
153 "lastname" =>
"Kabel",
154 "email" =>
"qwe@ty.de",
155 "ext_account" =>
"ext_"
157 $user->assignData(
$d);
158 $user->setActive(
true);
161 $user->setLanguage(
"de");
163 $id = $user->getId();
169 if (is_array($ids) && count($ids) == 1 && $ids[0] ==
"aatestuser2")
180 foreach ($acc as $k => $v)
181 if ($k == $id && $v ==
"ext_kabel")
212 $this->assertEquals(
"email1-email2-auth1-auth2-auth3-auth4-",
222 include_once(
"./Services/User/classes/class.ilObjUser.php");
229 "login" =>
"aatestuser3",
231 "passwd" =>
"password",
233 "firstname" =>
"Heidi",
234 "lastname" =>
"Kabel",
235 "email" =>
"de@de.de"
237 $user->assignData(
$d);
238 $user->setActive(
true);
241 $user->setLanguage(
"de");
243 $id = $user->getId();
245 $user->addDesktopItem(ROOT_FOLDER_ID,
"root");
246 if ($user->isDesktopItem(ROOT_FOLDER_ID,
"root"))
250 $user->setDesktopItemParameters(ROOT_FOLDER_ID,
"root",
"par1");
251 $di = $user->getDesktopItems();
252 if ($item = current($di))
254 if ($item[
"type"] ==
"root" && $item[
"ref_id"] == ROOT_FOLDER_ID)
260 $user->dropDesktopItem(ROOT_FOLDER_ID,
"root");
261 if (!$user->isDesktopItem(ROOT_FOLDER_ID,
"root"))
265 $user->_removeItemFromDesktops(ROOT_FOLDER_ID);
270 $this->assertEquals(
"desk1-desk2-desk3-",
280 include_once(
"./Services/User/classes/class.ilObjUser.php");
303 $this->assertEquals(
"",
318 "login" =>
"aatestuser3",
320 "passwd" =>
"password",
322 "firstname" =>
"Heidi",
323 "lastname" =>
"Kabel",
324 "email" =>
"de@de.de"
326 $user->assignData(
$d);
327 $user->setActive(
true);
330 $user->setLanguage(
"de");
332 $id = $user->getId();
334 $user->addObjectToClipboard($id,
"user",
"aatestuser");
335 $user->addObjectToClipboard(56,
"mump",
"mumpitz");
336 if ($user->clipboardHasObjectsOfType(
"user"))
341 $user->clipboardDeleteObjectsOfType(
"user");
342 if ($user->clipboardHasObjectsOfType(
"mump") &&
343 !$user->clipboardHasObjectsOfType(
"user"))
348 $objs = $user->getClipboardObjects(
"mump");
349 if (is_array($objs) && count($objs) == 1 && $objs[0][
"id"] == 56)
354 $objs = $user->getClipboardChilds(56,
"2008-10-10");
358 if (is_array($us) && count($us) == 1 && $us[0] == $id)
365 $this->assertEquals(
"clip1-clip2-clip3-clip4-",
377 include_once(
"./Services/User/classes/class.ilObjUser.php");
382 $this->assertEquals(
"",