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

Class ilSettingTest needsInstalledILIAS. More...

+ Inheritance diagram for ilSettingTest:
+ Collaboration diagram for ilSettingTest:

Public Member Functions

 testSetGetSettings ()
 IL_Init More...
 
 testDeletion ()
 IL_Init More...
 
 testLikeDeletion ()
 IL_Init More...
 

Protected Member Functions

 setUp ()
 

Protected Attributes

 $backupGlobals = false
 

Detailed Description

Class ilSettingTest needsInstalledILIAS.

Definition at line 28 of file ilSettingTest.php.

Member Function Documentation

◆ setUp()

ilSettingTest::setUp ( )
protected

Definition at line 32 of file ilSettingTest.php.

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

◆ testDeletion()

ilSettingTest::testDeletion ( )

IL_Init

Definition at line 53 of file ilSettingTest.php.

54  {
55  // set two things for two modules
56  $set = new ilSetting("test_module");
57  $set->set("foo", "bar");
58  $set = new ilSetting("test_module2");
59  $set->set("foo2", "bar2");
60  $set = new ilSetting("test_module");
61  $set->deleteAll();
62 
63  $value = $set->get("foo", false, true) . "-"; // should be "-" now
64 
65  $set = new ilSetting("test_module2");
66  $value .= $set->get("foo2"); // should be "-bar2" now
67 
68  $this->assertEquals("-bar2", $value);
69  }

◆ testLikeDeletion()

ilSettingTest::testLikeDeletion ( )

IL_Init

Definition at line 74 of file ilSettingTest.php.

75  {
76  $set = new ilSetting("test_module3");
77  $set->set("foo", "plus");
78  $set->set("fooplus", "bar");
79  $set->set("barplus", "foo");
80  $set->deleteLike("foo%");
81 
82  $value = $set->get("foo") . "-" .
83  $set->get("fooplus") . "-" .
84  $set->get("barplus");
85 
86  $this->assertEquals("--foo", $value);
87  }

◆ testSetGetSettings()

ilSettingTest::testSetGetSettings ( )

IL_Init

Definition at line 41 of file ilSettingTest.php.

42  {
43  $set = new ilSetting("test_module");
44  $set->set("foo", "bar");
45  $value = $set->get("foo");
46 
47  $this->assertEquals("bar", $value);
48  }

Field Documentation

◆ $backupGlobals

ilSettingTest::$backupGlobals = false
protected

Definition at line 30 of file ilSettingTest.php.


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