◆ getItemForHierId()
PCFileListTest::getItemForHierId |
( |
ilPageObject |
$page, |
|
|
string |
$hier_id |
|
) |
| |
|
protected |
◆ getPageWithFileList()
PCFileListTest::getPageWithFileList |
( |
| ) |
|
|
protected |
Definition at line 177 of file PCFileListTest.php.
178 {
181 $pc->create($page, "pg");
182 $pc->appendItem("10", "file_loc", "image/jpeg");
183 $pc->appendItem("20", "file_loc2", "image/png");
184 $page->addHierIDs();
185 $page->insertPCIds();
186 $pc->setHierId("1");
187 return $page;
188 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
References COPageTestBase\getEmptyPageWithDom().
Referenced by testDeleteItem(), testMoveItemDown(), testMoveItemUp(), testNewItemAfter(), and testNewItemBefore().
◆ testAppendItem()
PCFileListTest::testAppendItem |
( |
| ) |
|
Definition at line 47 of file PCFileListTest.php.
47 : void
48 {
51 $pc->create($page, "pg");
52 $pc->appendItem("10", "file_loc", "image/jpeg");
53 $expected = <<<EOT
54<PageObject HierId=
"pg"><PageContent><FileList><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_10"></
Identifier><Location
Type=
"LocalFile">file_loc</Location><Format>image/jpeg</Format></FileItem></FileList></PageContent></PageObject>
55EOT;
56
58 $expected,
59 $page->getXMLFromDom()
60 );
61 }
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().
◆ testClasses()
PCFileListTest::testClasses |
( |
| ) |
|
Definition at line 149 of file PCFileListTest.php.
149 : void
150 {
153 $pc->create($page, "pg");
154 $pc->appendItem("10", "file_loc", "image/jpeg");
155 $pc->appendItem("20", "file_loc2", "image/png");
156 $page->addHierIDs();
157 $pc->setHierId("1");
158 $pc->saveStyleClasses([
159 "1_1:" => "Class1",
160 "1_2:" => "Class2",
161 ]);
162 $classes = $pc->getAllClasses();
163
164 $this->assertEquals(
165 [
166 "1_1:" => "Class1",
167 "1_2:" => "Class2",
168 ],
169 $pc->getAllClasses()
170 );
171 }
References COPageTestBase\getEmptyPageWithDom().
◆ testConstruction()
PCFileListTest::testConstruction |
( |
| ) |
|
◆ testCreate()
PCFileListTest::testCreate |
( |
| ) |
|
◆ testDeleteFileItem()
PCFileListTest::testDeleteFileItem |
( |
| ) |
|
Definition at line 109 of file PCFileListTest.php.
109 : void
110 {
113 $pc->create($page, "pg");
114 $pc->appendItem("10", "file_loc", "image/jpeg");
115 $page->addHierIDs();
116 $pc->setHierId("1");
117 $pc->deleteFileItems(["1_1:"]);
118
120 '<PageObject HierId="pg"><PageContent HierId="1"><FileList></FileList></PageContent></PageObject>',
121 $page->getXMLFromDom()
122 );
123 }
References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().
◆ testDeleteItem()
PCFileListTest::testDeleteItem |
( |
| ) |
|
Definition at line 237 of file PCFileListTest.php.
237 : void
238 {
241 $item->deleteItem();
242 $page->stripHierIDs();
243 $page->stripPCIDs();
244
245 $expected = <<<EOT
246<PageObject><PageContent><FileList><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_10"/><Location
Type=
"LocalFile">file_loc</Location><Format>image/jpeg</Format></FileItem></FileList></PageContent></PageObject>
247EOT;
248
250 $expected,
251 $page->getXMLFromDom()
252 );
253 }
getItemForHierId(ilPageObject $page, string $hier_id)
References COPageTestBase\assertXmlEquals(), getItemForHierId(), and getPageWithFileList().
◆ testFileList()
PCFileListTest::testFileList |
( |
| ) |
|
Definition at line 89 of file PCFileListTest.php.
89 : void
90 {
93 $pc->create($page, "pg");
94 $pc->appendItem("10", "file_loc", "image/jpeg");
95 $page->addHierIDs();
96 $pc->setHierId("1");
97 $this->assertEquals(
98 [ 0 =>
99 ["entry" => "il__file_10",
100 "id" => "10",
101 "pc_id" => "",
102 "hier_id" => "1_1",
103 "class" => ""]
104 ],
105 $pc->getFileList()
106 );
107 }
References COPageTestBase\getEmptyPageWithDom().
◆ testListTitle()
PCFileListTest::testListTitle |
( |
| ) |
|
Definition at line 63 of file PCFileListTest.php.
63 : void
64 {
67 $pc->create($page, "pg");
68 $pc->setListTitle("MyTitle", "en");
69 $expected = <<<EOT
70<PageObject HierId=
"pg"><PageContent><FileList><
Title Language=
"en">MyTitle</
Title></FileList></PageContent></PageObject>
71EOT;
72
74 $expected,
75 $page->getXMLFromDom()
76 );
77
78 $this->assertEquals(
79 "MyTitle",
80 $pc->getListTitle()
81 );
82
83 $this->assertEquals(
84 "en",
85 $pc->getLanguage()
86 );
87 }
References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().
◆ testMoveItemDown()
PCFileListTest::testMoveItemDown |
( |
| ) |
|
Definition at line 255 of file PCFileListTest.php.
255 : void
256 {
259 $item->moveItemDown();
260 $page->stripHierIDs();
261 $page->stripPCIDs();
262
263 $expected = <<<EOT
264<PageObject><PageContent><FileList><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_20"/><Location
Type=
"LocalFile">file_loc2</Location><Format>image/png</Format></FileItem><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_10"/><Location
Type=
"LocalFile">file_loc</Location><Format>image/jpeg</Format></FileItem></FileList></PageContent></PageObject>
265EOT;
266
268 $expected,
269 $page->getXMLFromDom()
270 );
271 }
References COPageTestBase\assertXmlEquals(), getItemForHierId(), and getPageWithFileList().
◆ testMoveItemUp()
PCFileListTest::testMoveItemUp |
( |
| ) |
|
Definition at line 273 of file PCFileListTest.php.
273 : void
274 {
277 $item->moveItemUp();
278 $page->stripHierIDs();
279 $page->stripPCIDs();
280
281 $expected = <<<EOT
282<PageObject><PageContent><FileList><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_20"/><Location
Type=
"LocalFile">file_loc2</Location><Format>image/png</Format></FileItem><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_10"/><Location
Type=
"LocalFile">file_loc</Location><Format>image/jpeg</Format></FileItem></FileList></PageContent></PageObject>
283EOT;
284
286 $expected,
287 $page->getXMLFromDom()
288 );
289 }
References COPageTestBase\assertXmlEquals(), getItemForHierId(), and getPageWithFileList().
◆ testNewItemAfter()
PCFileListTest::testNewItemAfter |
( |
| ) |
|
Definition at line 201 of file PCFileListTest.php.
201 : void
202 {
205 $item->newItemAfter("30", "file_loc3", "image/gif");
206 $page->stripHierIDs();
207 $page->stripPCIDs();
208
209 $expected = <<<EOT
210<PageObject><PageContent><FileList><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_10"/><Location
Type=
"LocalFile">file_loc</Location><Format>image/jpeg</Format></FileItem><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_30"/><Location
Type=
"LocalFile">file_loc3</Location><Format>image/gif</Format></FileItem><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_20"/><Location
Type=
"LocalFile">file_loc2</Location><Format>image/png</Format></FileItem></FileList></PageContent></PageObject>
211EOT;
212
214 $expected,
215 $page->getXMLFromDom()
216 );
217 }
References COPageTestBase\assertXmlEquals(), getItemForHierId(), and getPageWithFileList().
◆ testNewItemBefore()
PCFileListTest::testNewItemBefore |
( |
| ) |
|
Definition at line 219 of file PCFileListTest.php.
219 : void
220 {
223 $item->newItemBefore("30", "file_loc3", "image/gif");
224 $page->stripHierIDs();
225 $page->stripPCIDs();
226
227 $expected = <<<EOT
228<PageObject><PageContent><FileList><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_10"/><Location
Type=
"LocalFile">file_loc</Location><Format>image/jpeg</Format></FileItem><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_30"/><Location
Type=
"LocalFile">file_loc3</Location><Format>image/gif</Format></FileItem><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_20"/><Location
Type=
"LocalFile">file_loc2</Location><Format>image/png</Format></FileItem></FileList></PageContent></PageObject>
229EOT;
230
232 $expected,
233 $page->getXMLFromDom()
234 );
235 }
References COPageTestBase\assertXmlEquals(), getItemForHierId(), and getPageWithFileList().
◆ testPositions()
PCFileListTest::testPositions |
( |
| ) |
|
Definition at line 125 of file PCFileListTest.php.
125 : void
126 {
129 $pc->create($page, "pg");
130 $pc->appendItem("10", "file_loc", "image/jpeg");
131 $pc->appendItem("20", "file_loc2", "image/png");
132 $page->addHierIDs();
133 $pc->setHierId("1");
134
135 $pc->savePositions([
136 "1_1:" => 20,
137 "1_2:" => 10,
138 ]);
139 $page->stripHierIDs();
140 $expected = <<<EOT
141<PageObject><PageContent><FileList><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_20"></
Identifier><Location
Type=
"LocalFile">file_loc2</Location><Format>image/png</Format></FileItem><FileItem><
Identifier Catalog=
"ILIAS" Entry=
"il__file_10"></
Identifier><Location
Type=
"LocalFile">file_loc</Location><Format>image/jpeg</Format></FileItem></FileList></PageContent></PageObject>
142EOT;
144 $expected,
145 $page->getXMLFromDom()
146 );
147 }
References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().
The documentation for this class was generated from the following file: