ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
PCSectionTest Class Reference
+ Inheritance diagram for PCSectionTest:
+ Collaboration diagram for PCSectionTest:

Public Member Functions

 testConstruction ()
 
 testCreate ()
 
 testCharacteristic ()
 
 testProtected ()
 
 testActiveFrom ()
 
 testActiveTo ()
 
 testPermission ()
 
 testPermissionRefId ()
 
 testExtLink ()
 
 testIntLink ()
 
 testNoLink ()
 
 testModel ()
 

Additional Inherited Members

- Protected Member Functions inherited from COPageTestBase
 setGlobalVariable (string $name, $value)
 
 setUp ()
 
 getIdGeneratorMock ()
 
 getPCDefinition ()
 
 setPCIdCnt (int $cnt)
 
 getIDManager (\ilPageObject $page)
 
 insertParagraphAt (\ilPageObject $page, string $hier_id, string $text="")
 
 tearDown ()
 
 normalize (string $html)
 
 assertXmlEquals (string $expected_xml_as_string, string $html_xml_string)
 
 getEmptyPageWithDom ()
 
 legacyHtmlToXml (string $content)
 
 getMediaObjectMock ()
 
- Protected Attributes inherited from COPageTestBase
int $pc_cnt
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file PCSectionTest.php.

Member Function Documentation

◆ testActiveFrom()

PCSectionTest::testActiveFrom ( )

Definition at line 91 of file PCSectionTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

91  : void
92  {
93  $page = $this->getEmptyPageWithDom();
94  $pc_sec = new ilPCSection($page);
95  $pc_sec->create($page, "pg");
96  $pc_sec->setActiveFrom(1234);
97 
98  $this->assertEquals(
99  1234,
100  $pc_sec->getActiveFrom()
101  );
102 
103  $expected = <<<EOT
104 <PageObject HierId="pg"><PageContent><Section Characteristic="Block" ActiveFrom="1234"></Section></PageContent></PageObject>
105 EOT;
106 
107  $this->assertXmlEquals(
108  $expected,
109  $page->getXMLFromDom()
110  );
111  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testActiveTo()

PCSectionTest::testActiveTo ( )

Definition at line 113 of file PCSectionTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

113  : void
114  {
115  $page = $this->getEmptyPageWithDom();
116  $pc_sec = new ilPCSection($page);
117  $pc_sec->create($page, "pg");
118  $pc_sec->setActiveTo(5678);
119 
120  $this->assertEquals(
121  5678,
122  $pc_sec->getActiveTo()
123  );
124 
125  $expected = <<<EOT
126 <PageObject HierId="pg"><PageContent><Section Characteristic="Block" ActiveTo="5678"></Section></PageContent></PageObject>
127 EOT;
128 
129  $this->assertXmlEquals(
130  $expected,
131  $page->getXMLFromDom()
132  );
133  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testCharacteristic()

PCSectionTest::testCharacteristic ( )

Definition at line 47 of file PCSectionTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

47  : void
48  {
49  $page = $this->getEmptyPageWithDom();
50  $pc_sec = new ilPCSection($page);
51  $pc_sec->create($page, "pg");
52  $pc_sec->setCharacteristic("MyChar");
53 
54  $this->assertEquals(
55  "MyChar",
56  $pc_sec->getCharacteristic()
57  );
58 
59  $expected = <<<EOT
60 <PageObject HierId="pg"><PageContent><Section Characteristic="MyChar"></Section></PageContent></PageObject>
61 EOT;
62 
63  $this->assertXmlEquals(
64  $expected,
65  $page->getXMLFromDom()
66  );
67  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testConstruction()

PCSectionTest::testConstruction ( )

Definition at line 26 of file PCSectionTest.php.

References COPageTestBase\getEmptyPageWithDom().

26  : void
27  {
28  $page = $this->getEmptyPageWithDom();
29  $pc_sec = new ilPCSection($page);
30  $this->assertEquals(
31  ilPCSection::class,
32  get_class($pc_sec)
33  );
34  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ testCreate()

PCSectionTest::testCreate ( )

Definition at line 36 of file PCSectionTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

36  : void
37  {
38  $page = $this->getEmptyPageWithDom();
39  $pc_sec = new ilPCSection($page);
40  $pc_sec->create($page, "pg");
41  $this->assertXmlEquals(
42  '<PageObject HierId="pg"><PageContent><Section Characteristic="Block"></Section></PageContent></PageObject>',
43  $page->getXMLFromDom()
44  );
45  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testExtLink()

PCSectionTest::testExtLink ( )

Definition at line 179 of file PCSectionTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

179  : void
180  {
181  $page = $this->getEmptyPageWithDom();
182  $pc_sec = new ilPCSection($page);
183  $pc_sec->create($page, "pg");
184  $pc_sec->setExtLink("https://www.ilias.de");
185 
186  $ext_link = $pc_sec->getLink();
187 
188  $this->assertEquals(
189  "ExtLink",
190  $ext_link["LinkType"]
191  );
192 
193  $this->assertEquals(
194  "https://www.ilias.de",
195  $ext_link["Href"]
196  );
197 
198  $expected = <<<EOT
199 <PageObject HierId="pg"><PageContent><Section Characteristic="Block"><ExtLink Href="https://www.ilias.de"></ExtLink></Section></PageContent></PageObject>
200 EOT;
201 
202  $this->assertXmlEquals(
203  $expected,
204  $page->getXMLFromDom()
205  );
206  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testIntLink()

PCSectionTest::testIntLink ( )

Definition at line 208 of file PCSectionTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

208  : void
209  {
210  $page = $this->getEmptyPageWithDom();
211  $pc_sec = new ilPCSection($page);
212  $pc_sec->create($page, "pg");
213  $pc_sec->setIntLink("mytype", "mytarget", "myframe");
214 
215  $link = $pc_sec->getLink();
216 
217  $this->assertEquals(
218  "IntLink",
219  $link["LinkType"]
220  );
221 
222  $this->assertEquals(
223  "mytype",
224  $link["Type"]
225  );
226 
227  $this->assertEquals(
228  "mytarget",
229  $link["Target"]
230  );
231 
232  $this->assertEquals(
233  "myframe",
234  $link["TargetFrame"]
235  );
236 
237  $expected = <<<EOT
238 <PageObject HierId="pg"><PageContent><Section Characteristic="Block"><IntLink Type="mytype" Target="mytarget" TargetFrame="myframe"></IntLink></Section></PageContent></PageObject>
239 EOT;
240 
241  $this->assertXmlEquals(
242  $expected,
243  $page->getXMLFromDom()
244  );
245  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testModel()

PCSectionTest::testModel ( )

Definition at line 280 of file PCSectionTest.php.

References COPageTestBase\getEmptyPageWithDom().

280  : void
281  {
282  $page = $this->getEmptyPageWithDom();
283  $pc_sec = new ilPCSection($page);
284  $pc_sec->create($page, "pg");
285 
286  $pc_sec->setProtected(true);
287 
288  $model = new stdClass();
289  $model->protected = true;
290 
291 
292  $this->assertEquals(
293  $model,
294  $pc_sec->getModel()
295  );
296  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ testNoLink()

PCSectionTest::testNoLink ( )

Definition at line 247 of file PCSectionTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

247  : void
248  {
249  $page = $this->getEmptyPageWithDom();
250  $pc_sec = new ilPCSection($page);
251  $pc_sec->create($page, "pg");
252 
253  $link = $pc_sec->getLink();
254 
255  $this->assertEquals(
256  "NoLink",
257  $link["LinkType"]
258  );
259 
260  $pc_sec->setIntLink("mytype", "mytarget", "myframe");
261  $pc_sec->setNoLink();
262 
263  $link = $pc_sec->getLink();
264 
265  $this->assertEquals(
266  "NoLink",
267  $link["LinkType"]
268  );
269 
270  $expected = <<<EOT
271 <PageObject HierId="pg"><PageContent><Section Characteristic="Block"></Section></PageContent></PageObject>
272 EOT;
273 
274  $this->assertXmlEquals(
275  $expected,
276  $page->getXMLFromDom()
277  );
278  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testPermission()

PCSectionTest::testPermission ( )

Definition at line 135 of file PCSectionTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

135  : void
136  {
137  $page = $this->getEmptyPageWithDom();
138  $pc_sec = new ilPCSection($page);
139  $pc_sec->create($page, "pg");
140  $pc_sec->setPermission("write");
141 
142  $this->assertEquals(
143  "write",
144  $pc_sec->getPermission()
145  );
146 
147  $expected = <<<EOT
148 <PageObject HierId="pg"><PageContent><Section Characteristic="Block" Permission="write"></Section></PageContent></PageObject>
149 EOT;
150 
151  $this->assertXmlEquals(
152  $expected,
153  $page->getXMLFromDom()
154  );
155  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testPermissionRefId()

PCSectionTest::testPermissionRefId ( )

Definition at line 157 of file PCSectionTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

157  : void
158  {
159  $page = $this->getEmptyPageWithDom();
160  $pc_sec = new ilPCSection($page);
161  $pc_sec->create($page, "pg");
162  $pc_sec->setPermissionRefId(10);
163 
164  $this->assertEquals(
165  10,
166  $pc_sec->getPermissionRefId()
167  );
168 
169  $expected = <<<EOT
170 <PageObject HierId="pg"><PageContent><Section Characteristic="Block" PermissionRefId="il__ref_10"></Section></PageContent></PageObject>
171 EOT;
172 
173  $this->assertXmlEquals(
174  $expected,
175  $page->getXMLFromDom()
176  );
177  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testProtected()

PCSectionTest::testProtected ( )

Definition at line 69 of file PCSectionTest.php.

References COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

69  : void
70  {
71  $page = $this->getEmptyPageWithDom();
72  $pc_sec = new ilPCSection($page);
73  $pc_sec->create($page, "pg");
74  $pc_sec->setProtected(true);
75 
76  $this->assertEquals(
77  true,
78  $pc_sec->getProtected()
79  );
80 
81  $expected = <<<EOT
82 <PageObject HierId="pg"><PageContent><Section Characteristic="Block" Protected="1"></Section></PageContent></PageObject>
83 EOT;
84 
85  $this->assertXmlEquals(
86  $expected,
87  $page->getXMLFromDom()
88  );
89  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: