ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
34 {
35  protected $backupGlobals = FALSE;
36 
37  protected function setUp()
38  {
39  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
40  ilUnitUtil::performInitialisation();
41  }
42 
49  public function testMembership()
50  {
51  include_once './Services/Membership/classes/class.ilWaitingList.php';
52  include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
53 
54  $wait = new ilCourseWaitingList(999999);
55  $ret = $wait->addToList(111111);
56  $this->assertEquals($ret,true);
57 
58  $wait->updateSubscriptionTime(111111,time());
59  $wait->removeFromList(111111);
60 
61  $wait->addToList(111111);
62  $ret = $wait->isOnList(111111);
63  $this->assertEquals($ret,true);
64 
65  $wait->addToList(111111);
67 
68  $wait->addToList(111111);
70  }
71 
77  public function testSubscription()
78  {
79  include_once './Services/Membership/classes/class.ilParticipants.php';
80  include_once './Modules/Course/classes/class.ilCourseParticipants.php';
81 
83  $part->addSubscriber(111111);
84  $part->updateSubscriptionTime(111111,time());
85  $part->updateSubject(111111,'hallo');
86 
87  $is = $part->isSubscriber(111111);
88  $this->assertEquals($is,true);
89 
90  $is = ilParticipants::_isSubscriber(999999,111111);
91  $this->assertEquals($is,true);
92 
93  $part->deleteSubscriber(111111);
94  $is = $part->isSubscriber(111111);
95  $this->assertEquals($is,false);
96  }
97 }
98 ?>