ILIAS
release_5-0 Revision 5.0.0-1144-gc4397b1f870
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Files
File List
+
Globals
+
All
$
(
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
v
w
x
+
Variables
$
(
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
ilSettingTest.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
24
class
ilSettingTest
extends
PHPUnit_Framework_TestCase
25
{
26
protected
$backupGlobals
= FALSE;
27
28
protected
function
setUp
()
29
{
30
include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php"
);
31
ilUnitUtil::performInitialisation();
32
}
33
37
public
function
testSetGetSettings
()
38
{
39
$set =
new
ilSetting
(
"test_module"
);
40
$set->set(
"foo"
,
"bar"
);
41
$value = $set->get(
"foo"
);
42
43
$this->assertEquals(
"bar"
, $value);
44
}
45
49
public
function
testDeletion
()
50
{
51
// set two things for two modules
52
$set =
new
ilSetting
(
"test_module"
);
53
$set->set(
"foo"
,
"bar"
);
54
$set =
new
ilSetting
(
"test_module2"
);
55
$set->set(
"foo2"
,
"bar2"
);
56
$set =
new
ilSetting
(
"test_module"
);
57
$set->deleteAll();
58
59
$value = $set->get(
"foo"
,
false
,
true
).
"-"
;
// should be "-" now
60
61
$set =
new
ilSetting
(
"test_module2"
);
62
$value.= $set->get(
"foo2"
);
// should be "-bar2" now
63
64
$this->assertEquals(
"-bar2"
, $value);
65
}
66
70
public
function
testLikeDeletion
()
71
{
72
$set =
new
ilSetting
(
"test_module3"
);
73
$set->set(
"foo"
,
"plus"
);
74
$set->set(
"fooplus"
,
"bar"
);
75
$set->set(
"barplus"
,
"foo"
);
76
$set->deleteLike(
"foo%"
);
77
78
$value = $set->get(
"foo"
).
"-"
.
79
$set->get(
"fooplus"
).
"-"
.
80
$set->get(
"barplus"
);
81
82
$this->assertEquals(
"--foo"
, $value);
83
}
84
85
}
86
?>
ilSetting
ILIAS Setting Class.
Definition:
class.ilSetting.php:32
ilSettingTest\$backupGlobals
$backupGlobals
Definition:
ilSettingTest.php:26
PHPUnit_Framework_TestCase
ilSettingTest
Definition:
ilSettingTest.php:24
ilSettingTest\testLikeDeletion
testLikeDeletion()
IL_Init
Definition:
ilSettingTest.php:70
ilSettingTest\setUp
setUp()
Definition:
ilSettingTest.php:28
ilSettingTest\testDeletion
testDeletion()
IL_Init
Definition:
ilSettingTest.php:49
ilSettingTest\testSetGetSettings
testSetGetSettings()
IL_Init
Definition:
ilSettingTest.php:37
Services
Administration
test
ilSettingTest.php
Generated on Mon Mar 31 2025 19:00:42 for ILIAS by
1.8.13 (using
Doxyfile
)