ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
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
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
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
l
m
n
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
▼
ILIAS
Test List
Todo List
Deprecated List
►
Modules
►
Namespaces
►
Data Structures
▼
Files
►
File List
►
Globals
►
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
use
PHPUnit\Framework\TestCase
;
25
30
class
ilSettingTest
extends
TestCase
31
{
32
protected
$backupGlobals
=
false
;
33
34
protected
function
setUp
() : void
35
{
36
include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php"
);
37
ilUnitUtil::performInitialisation();
38
}
39
43
public
function
testSetGetSettings
()
44
{
45
$set =
new
ilSetting
(
"test_module"
);
46
$set->set(
"foo"
,
"bar"
);
47
$value = $set->get(
"foo"
);
48
49
$this->assertEquals(
"bar"
, $value);
50
}
51
55
public
function
testDeletion
()
56
{
57
// set two things for two modules
58
$set =
new
ilSetting
(
"test_module"
);
59
$set->set(
"foo"
,
"bar"
);
60
$set =
new
ilSetting
(
"test_module2"
);
61
$set->set(
"foo2"
,
"bar2"
);
62
$set =
new
ilSetting
(
"test_module"
);
63
$set->deleteAll();
64
65
$value = $set->get(
"foo"
,
false
,
true
) .
"-"
;
// should be "-" now
66
67
$set =
new
ilSetting
(
"test_module2"
);
68
$value .= $set->get(
"foo2"
);
// should be "-bar2" now
69
70
$this->assertEquals(
"-bar2"
, $value);
71
}
72
76
public
function
testLikeDeletion
()
77
{
78
$set =
new
ilSetting
(
"test_module3"
);
79
$set->set(
"foo"
,
"plus"
);
80
$set->set(
"fooplus"
,
"bar"
);
81
$set->set(
"barplus"
,
"foo"
);
82
$set->deleteLike(
"foo%"
);
83
84
$value = $set->get(
"foo"
) .
"-"
.
85
$set->get(
"fooplus"
) .
"-"
.
86
$set->get(
"barplus"
);
87
88
$this->assertEquals(
"--foo"
, $value);
89
}
90
}
ilSettingTest\$backupGlobals
$backupGlobals
Definition:
ilSettingTest.php:32
ilSettingTest
Class ilSettingTest needsInstalledILIAS.
Definition:
ilSettingTest.php:30
ilSettingTest\testLikeDeletion
testLikeDeletion()
IL_Init
Definition:
ilSettingTest.php:76
ilSettingTest\setUp
setUp()
Definition:
ilSettingTest.php:34
ilSettingTest\testDeletion
testDeletion()
IL_Init
Definition:
ilSettingTest.php:55
ilSettingTest\testSetGetSettings
testSetGetSettings()
IL_Init
Definition:
ilSettingTest.php:43
ilSetting
TestCase
Services
Administration
test
ilSettingTest.php
Generated on Sat Apr 5 2025 21:01:13 for ILIAS by
1.8.13 (using
Doxyfile
)