ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC, $ilDB, ilMemberAgreement\_deleteByUser(), ilMemberAgreement\_hasAccepted(), ilMemberAgreement\_hasAgreements(), and ilMemberAgreement\_hasAgreementsByObjId().

44  {
45  include_once 'Services/Membership/classes/class.ilMemberAgreement.php';
46 
47  global $DIC;
48 
49  $ilDB = $DIC['ilDB'];
50 
51 
52  $agree = new ilMemberAgreement(9999, 8888);
53  $agree->read();
54  $agree->setAccepted(true);
55  $agree->save();
56 
57  $agree = new ilMemberAgreement(9999, 8888);
58  $agree->read();
59  $sta = $agree->isAccepted();
60  $this->assertEquals($sta, true);
61  $agree->delete();
62 
63  $agree = new ilMemberAgreement(9999, 8888);
64  $agree->read();
65  $sta = $agree->isAccepted();
66  $this->assertEquals($sta, false);
67 
68  $sta = ilMemberAgreement::_hasAccepted(9999, 8888);
69  $this->assertEquals($sta, false);
70 
71  $agree = new ilMemberAgreement(9999, 8888);
72  $agree->read();
73  $agree->setAccepted(true);
74  $agree->save();
75 
77  $this->assertEquals($sta, true);
78 
80  $this->assertEquals($sta, true);
81 
83  }
global $DIC
Definition: saml.php:7
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: