ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
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
28
class
ilXHTMLPageTest
extends
PHPUnit_Framework_TestCase
29
{
30
protected
$backupGlobals
=
false
;
31
32
protected
function
setUp
()
33
{
34
include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php"
);
35
ilUnitUtil::performInitialisation();
36
}
37
41
public
function
testSetGetSettings
()
42
{
43
include_once(
"./Services/XHTMLPage/classes/class.ilXHTMLPage.php"
);
44
45
$page =
new
ilXHTMLPage
();
46
$page->setContent(
"aaa"
);
47
$page->save();
48
$page_id = $page->getId();
49
50
// save/read
51
$page =
new
ilXHTMLPage
($page_id);
52
if
($page->getContent() ==
"aaa"
) {
53
$result
.=
"saveread-"
;
54
}
55
$page->setContent(
"bbb"
);
56
$page->save();
57
58
// lookups
59
if
(
ilXHTMLPage::_lookupContent
($page_id) ==
"bbb"
) {
60
$result
.=
"lookupContent-"
;
61
}
62
63
if
(
ilXHTMLPage::_lookupSavedContent
($page_id) ==
"aaa"
) {
64
$result
.=
"lookupSavedContent-"
;
65
}
66
67
// undo
68
$page->undo();
69
70
if
(
ilXHTMLPage::_lookupContent
($page_id) ==
"aaa"
) {
71
$result
.=
"undo1-"
;
72
}
73
74
if
(
ilXHTMLPage::_lookupSavedContent
($page_id) ==
"bbb"
) {
75
$result
.=
"undo2-"
;
76
}
77
78
// clear
79
$page->clear();
80
if
(
ilXHTMLPage::_lookupContent
($page_id) ==
""
) {
81
$result
.=
"clear1-"
;
82
}
83
84
if
(
ilXHTMLPage::_lookupSavedContent
($page_id) ==
"aaa"
) {
85
$result
.=
"clear2-"
;
86
}
87
88
$this->assertEquals(
"saveread-lookupContent-lookupSavedContent-undo1-undo2-clear1-clear2-"
,
$result
);
89
}
90
}
ilXHTMLPageTest\setUp
setUp()
Definition:
ilXHTMLPageTest.php:32
$result
$result
Definition:
CleanUpTest.php:463
ilXHTMLPage\_lookupContent
static _lookupContent($a_id)
Lookup Content.
Definition:
class.ilXHTMLPage.php:99
PHPUnit_Framework_TestCase
ilXHTMLPageTest\testSetGetSettings
testSetGetSettings()
IL_Init
Definition:
ilXHTMLPageTest.php:41
ilXHTMLPageTest\$backupGlobals
$backupGlobals
Definition:
ilXHTMLPageTest.php:30
ilXHTMLPageTest
Class ilXHTMLPageTest needsInstalledILIAS.
Definition:
ilXHTMLPageTest.php:28
ilXHTMLPage
XHTML Page class.
Definition:
class.ilXHTMLPage.php:16
php
ilXHTMLPage\_lookupSavedContent
static _lookupSavedContent($a_id)
Lookup Saved Content.
Definition:
class.ilXHTMLPage.php:115
Services
XHTMLPage
test
ilXHTMLPageTest.php
Generated on Thu Jan 16 2025 19:02:35 for ILIAS by
1.8.13 (using
Doxyfile
)