ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMembershipTest Class Reference

Unit tests for tree table needsInstalledILIAS. More...

+ Inheritance diagram for ilMembershipTest:
+ Collaboration diagram for ilMembershipTest:

Public Member Functions

 testMembership ()
 Waiting list tes IL_Init. More...
 
 testSubscription ()
 IL_Init More...
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $backupGlobals = false
 

Detailed Description

Unit tests for tree table needsInstalledILIAS.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 34 of file ilMembershipTest.php.

Member Function Documentation

◆ setUp()

ilMembershipTest::setUp ( )
protected

Definition at line 38 of file ilMembershipTest.php.

39  {
40  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
41  ilUnitUtil::performInitialisation();
42  }

◆ testMembership()

ilMembershipTest::testMembership ( )

Waiting list tes IL_Init.

Parameters

Definition at line 50 of file ilMembershipTest.php.

References $ret, ilWaitingList\_deleteAll(), and ilWaitingList\_deleteUser().

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  }
static _deleteUser($a_usr_id)
Delete user.
$ret
Definition: parser.php:6
static _deleteAll($a_obj_id)
delete all
+ Here is the call graph for this function:

◆ testSubscription()

ilMembershipTest::testSubscription ( )

IL_Init

Parameters

Definition at line 78 of file ilMembershipTest.php.

References ilCourseParticipants\_getInstanceByObjId(), and ilParticipants\_isSubscriber().

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  }
static _isSubscriber($a_obj_id, $a_usr_id)
check if user is subscriber
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
+ Here is the call graph for this function:

Field Documentation

◆ $backupGlobals

ilMembershipTest::$backupGlobals = false
protected

Definition at line 36 of file ilMembershipTest.php.


The documentation for this class was generated from the following file: