ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilCourseTest Class Reference

Class ilCourseTest needsInstalledILIAS. More...

+ Inheritance diagram for ilCourseTest:
+ Collaboration diagram for ilCourseTest:

Public Member Functions

 testMemberAgreement ()
 Test member agreement IL_Init. More...
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $backupGlobals = false
 
 $preserveGlobalState = false
 

Detailed Description

Class ilCourseTest needsInstalledILIAS.

Definition at line 28 of file ilCourseTest.php.

Member Function Documentation

◆ setUp()

ilCourseTest::setUp ( )
protected

Definition at line 33 of file ilCourseTest.php.

34  {
35  include_once("./Services/PHPUnit/classes/class.ilUnitUtil.php");
36  ilUnitUtil::performInitialisation();
37  }

◆ testMemberAgreement()

ilCourseTest::testMemberAgreement ( )

Test member agreement IL_Init.

Definition at line 43 of file ilCourseTest.php.

References $ilDB, ilMemberAgreement\_deleteByUser(), ilMemberAgreement\_hasAccepted(), ilMemberAgreement\_hasAgreements(), and ilMemberAgreement\_hasAgreementsByObjId().

44  {
45  include_once 'Services/Membership/classes/class.ilMemberAgreement.php';
46 
47  global $ilDB;
48 
49 
50  $agree = new ilMemberAgreement(9999, 8888);
51  $agree->read();
52  $agree->setAccepted(true);
53  $agree->save();
54 
55  $agree = new ilMemberAgreement(9999, 8888);
56  $agree->read();
57  $sta = $agree->isAccepted();
58  $this->assertEquals($sta, true);
59  $agree->delete();
60 
61  $agree = new ilMemberAgreement(9999, 8888);
62  $agree->read();
63  $sta = $agree->isAccepted();
64  $this->assertEquals($sta, false);
65 
66  $sta = ilMemberAgreement::_hasAccepted(9999, 8888);
67  $this->assertEquals($sta, false);
68 
69  $agree = new ilMemberAgreement(9999, 8888);
70  $agree->read();
71  $agree->setAccepted(true);
72  $agree->save();
73 
75  $this->assertEquals($sta, true);
76 
78  $this->assertEquals($sta, true);
79 
81  }
static _hasAccepted($a_usr_id, $a_obj_id)
Check if user has accepted agreement.
static _deleteByUser($a_usr_id)
Delete all entries by user.
static _hasAgreements()
Check if there is any user agreement.
static _hasAgreementsByObjId($a_obj_id)
Check if there is any user agreement.
global $ilDB
+ Here is the call graph for this function:

Field Documentation

◆ $backupGlobals

ilCourseTest::$backupGlobals = false
protected

Definition at line 30 of file ilCourseTest.php.

◆ $preserveGlobalState

ilCourseTest::$preserveGlobalState = false
protected

Definition at line 31 of file ilCourseTest.php.


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