ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMembershipTest.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
35 {
36  protected $backupGlobals = FALSE;
37 
38  protected function setUp()
39  {
40  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
41  ilUnitUtil::performInitialisation();
42  }
43 
50  public function testMembership()
51  {
52  include_once './Services/Membership/classes/class.ilWaitingList.php';
53  include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
54 
55  $wait = new ilCourseWaitingList(999999);
56  $ret = $wait->addToList(111111);
57  $this->assertEquals($ret,true);
58 
59  $wait->updateSubscriptionTime(111111,time());
60  $wait->removeFromList(111111);
61 
62  $wait->addToList(111111);
63  $ret = $wait->isOnList(111111);
64  $this->assertEquals($ret,true);
65 
66  $wait->addToList(111111);
68 
69  $wait->addToList(111111);
71  }
72 
78  public function testSubscription()
79  {
80  include_once './Services/Membership/classes/class.ilParticipants.php';
81  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
82 
84  $part->addSubscriber(111111);
85  $part->updateSubscriptionTime(111111,time());
86  $part->updateSubject(111111,'hallo');
87 
88  $is = $part->isSubscriber(111111);
89  $this->assertEquals($is,true);
90 
91  $is = ilParticipants::_isSubscriber(999999,111111);
92  $this->assertEquals($is,true);
93 
94  $part->deleteSubscriber(111111);
95  $is = $part->isSubscriber(111111);
96  $this->assertEquals($is,false);
97  }
98 }
99 ?>
static _isSubscriber($a_obj_id, $a_usr_id)
check if user is subscriber
static _deleteUser($a_usr_id)
Delete user.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
testSubscription()
IL_Init
Unit tests for tree table needsInstalledILIAS.
$ret
Definition: parser.php:6
static _deleteAll($a_obj_id)
delete all
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
testMembership()
Waiting list tes IL_Init.