ILIAS
release_4-4 Revision
◀ 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
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
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
ilXHTMLPageTest.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
ilXHTMLPageTest
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
include_once(
"./Services/XHTMLPage/classes/class.ilXHTMLPage.php"
);
40
41
$page =
new
ilXHTMLPage
();
42
$page->setContent(
"aaa"
);
43
$page->save();
44
$page_id = $page->getId();
45
46
// save/read
47
$page =
new
ilXHTMLPage
($page_id);
48
if
($page->getContent() ==
"aaa"
)
49
{
50
$result
.=
"saveread-"
;
51
}
52
$page->setContent(
"bbb"
);
53
$page->save();
54
55
// lookups
56
if
(
ilXHTMLPage::_lookupContent
($page_id) ==
"bbb"
)
57
{
58
$result
.=
"lookupContent-"
;
59
}
60
61
if
(
ilXHTMLPage::_lookupSavedContent
($page_id) ==
"aaa"
)
62
{
63
$result
.=
"lookupSavedContent-"
;
64
}
65
66
// undo
67
$page->undo();
68
69
if
(
ilXHTMLPage::_lookupContent
($page_id) ==
"aaa"
)
70
{
71
$result
.=
"undo1-"
;
72
}
73
74
if
(
ilXHTMLPage::_lookupSavedContent
($page_id) ==
"bbb"
)
75
{
76
$result
.=
"undo2-"
;
77
}
78
79
// clear
80
$page->clear();
81
if
(
ilXHTMLPage::_lookupContent
($page_id) ==
""
)
82
{
83
$result
.=
"clear1-"
;
84
}
85
86
if
(
ilXHTMLPage::_lookupSavedContent
($page_id) ==
"aaa"
)
87
{
88
$result
.=
"clear2-"
;
89
}
90
91
$this->assertEquals(
"saveread-lookupContent-lookupSavedContent-undo1-undo2-clear1-clear2-"
,
$result
);
92
}
93
94
}
95
?>
ilXHTMLPageTest\setUp
setUp()
Definition:
ilXHTMLPageTest.php:28
$result
$result
Definition:
CleanUpTest.php:407
PHPUnit_Framework_TestCase
ilXHTMLPageTest\testSetGetSettings
testSetGetSettings()
IL_Init
Definition:
ilXHTMLPageTest.php:37
ilXHTMLPageTest\$backupGlobals
$backupGlobals
Definition:
ilXHTMLPageTest.php:26
ilXHTMLPageTest
Definition:
ilXHTMLPageTest.php:24
ilXHTMLPage
XHTML Page class.
Definition:
class.ilXHTMLPage.php:16
ilXHTMLPage\_lookupSavedContent
_lookupSavedContent($a_id)
Lookup Saved Content.
Definition:
class.ilXHTMLPage.php:108
ilXHTMLPage\_lookupContent
_lookupContent($a_id)
Lookup Content.
Definition:
class.ilXHTMLPage.php:93
Services
XHTMLPage
test
ilXHTMLPageTest.php
Generated on Mon Dec 21 2020 19:01:26 for ILIAS by
1.8.13 (using
Doxyfile
)