10 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
20 include_once(
"./Services/User/classes/class.ilObjUser.php");
34 "login" =>
"aatestuser",
36 "passwd" =>
"password",
39 "lastname" =>
"Mutzke",
40 "email" =>
"de@de.de",
41 "client_ip" =>
"1.2.3.4",
42 "ext_account" =>
"ext_mutzke"
47 $user->setLanguage(
"no");
50 $value.=
$user->getFirstname().
"-";
53 $user->setFirstname(
"Maxi");
55 $value.=
$user->getFirstname().
"-";
58 $user->refreshLogin();
65 $value.=
$n[
"lastname"].
"-";
83 $user->replacePassword(md5(
"password2"));
88 $user->updatePassword(
"password2",
"password3",
"password3");
93 $user->resetPassword(
"password4",
"password4");
100 $user->writePref(
"testpref",
"pref1");
102 $user->deletePref(
"testpref");
105 $value.=
"pref2".
"-";
113 $user->writeAccepted();
120 $user->setActive(
false);
125 $user->setActive(
true);
139 $this->assertEquals(
"Max-Maxi-de@de.de-m-1.2.3.4-Mutzke-aatestuser-ext_mutzke-$id-no-le-".
140 "pw1-pw2-pw3-pw4-pref1-pref2-agr1-agr2-act1-act2-act3-",
150 include_once(
"./Services/User/classes/class.ilObjUser.php");
157 "login" =>
"aatestuser2",
159 "passwd" =>
"password",
161 "firstname" =>
"Heidi",
162 "lastname" =>
"Kabel",
163 "email" =>
"qwe@ty.de",
164 "ext_account" =>
"ext_"
167 $user->setActive(
true);
170 $user->setLanguage(
"de");
172 $id =
$user->getId();
178 if (is_array($ids) && count($ids) == 1 && $ids[0] ==
"aatestuser2")
189 foreach ($acc as $k => $v)
190 if ($k == $id && $v ==
"ext_kabel")
221 $this->assertEquals(
"email1-email2-auth1-auth2-auth3-auth4-",
230 include_once(
"./Services/User/classes/class.ilObjUser.php");
237 "login" =>
"aatestuser3",
239 "passwd" =>
"password",
241 "firstname" =>
"Heidi",
242 "lastname" =>
"Kabel",
243 "email" =>
"de@de.de"
246 $user->setActive(
true);
249 $user->setLanguage(
"de");
251 $id =
$user->getId();
253 $user->addDesktopItem(ROOT_FOLDER_ID,
"root");
254 if (
$user->isDesktopItem(ROOT_FOLDER_ID,
"root"))
258 $user->setDesktopItemParameters(ROOT_FOLDER_ID,
"root",
"par1");
259 $di =
$user->getDesktopItems();
260 if ($item = current($di))
262 if ($item[
"type"] ==
"root" && $item[
"ref_id"] == ROOT_FOLDER_ID)
268 $user->dropDesktopItem(ROOT_FOLDER_ID,
"root");
269 if (!
$user->isDesktopItem(ROOT_FOLDER_ID,
"root"))
273 $user->_removeItemFromDesktops(ROOT_FOLDER_ID);
278 $this->assertEquals(
"desk1-desk2-desk3-",
287 include_once(
"./Services/User/classes/class.ilObjUser.php");
310 $this->assertEquals(
"",
324 "login" =>
"aatestuser3",
326 "passwd" =>
"password",
328 "firstname" =>
"Heidi",
329 "lastname" =>
"Kabel",
330 "email" =>
"de@de.de"
333 $user->setActive(
true);
336 $user->setLanguage(
"de");
338 $id =
$user->getId();
340 $user->addObjectToClipboard($id,
"user",
"aatestuser");
341 $user->addObjectToClipboard(56,
"mump",
"mumpitz");
342 if (
$user->clipboardHasObjectsOfType(
"user"))
347 $user->clipboardDeleteObjectsOfType(
"user");
348 if (
$user->clipboardHasObjectsOfType(
"mump") &&
349 !
$user->clipboardHasObjectsOfType(
"user"))
354 $objs =
$user->getClipboardObjects(
"mump");
355 if (is_array($objs) && count($objs) == 1 && $objs[0][
"id"] == 56)
360 $objs =
$user->getClipboardChilds(56,
"2008-10-10");
364 if (is_array($us) && count($us) == 1 && $us[0] == $id)
371 $this->assertEquals(
"clip1-clip2-clip3-clip4-",
382 include_once(
"./Services/User/classes/class.ilObjUser.php");
387 $this->assertEquals(
"",