ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
PageObjectTest Class Reference
+ Inheritance diagram for PageObjectTest:
+ Collaboration diagram for PageObjectTest:

Public Member Functions

 testConstruction ()
 
 testSetXMLContent ()
 
 testGetXMLFromDom ()
 
 testAddHierIds ()
 
 testAddHierIdsWithContent ()
 
 testGeneratePCId ()
 
 testGetLangVarXMLForValueEscapesXMLSpecialCharacters ()
 
 testGetCharacteristicLangVarXMLForValueEscapesXMLSpecialCharacters ()
 

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 PageObjectTest.php.

Member Function Documentation

◆ testAddHierIds()

PageObjectTest::testAddHierIds ( )

Definition at line 58 of file PageObjectTest.php.

58 : void
59 {
61
62 $page->setXMLContent("<PageObject></PageObject>");
63 $page->buildDom();
64 $page->addHierIDs();
65 $this->assertXmlEquals(
66 '<PageObject HierId="pg"></PageObject>',
67 $page->getXMLFromDom()
68 );
69 }
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $page, and COPageTestBase\assertXmlEquals().

+ Here is the call graph for this function:

◆ testAddHierIdsWithContent()

PageObjectTest::testAddHierIdsWithContent ( )

Definition at line 71 of file PageObjectTest.php.

71 : void
72 {
73 $page = $this->getEmptyPageWithDom();
74 $pc = new ilPCGrid($page);
75 $pc->create($page, "pg");
76 $pc->applyTemplate(
78 0,
79 0,
80 0,
81 0,
82 0
83 );
84
85 $page->addHierIDs();
86
87 $pc = new ilPCDataTable($page);
88 $pc->create($page, "1_2");
89 $row1 = $pc->addRow();
90 $pc->addCell($row1, "one", "en");
91 $pc->addCell($row1, "two", "en");
92 $row2 = $pc->addRow();
93 $pc->addCell($row2, "three", "en");
94 $pc->addCell($row2, "four", "en");
95
96 $page->addHierIDs();
97
98 $expected = <<<EOT
99<PageObject HierId="pg"><PageContent HierId="1"><Grid><GridCell WIDTH_XS="" WIDTH_S="12" WIDTH_M="6" WIDTH_L="6" WIDTH_XL="6" HierId="1_1"/><GridCell WIDTH_XS="" WIDTH_S="12" WIDTH_M="6" WIDTH_L="6" WIDTH_XL="6" HierId="1_2"><PageContent HierId="1_2_1"><Table Language="" DataTable="y"><TableRow HierId="1_2_1_1"><TableData HierId="1_2_1_1_1"><PageContent HierId="1_2_1_1_1_1"><Paragraph Language="en" Characteristic="TableContent">one</Paragraph></PageContent></TableData><TableData HierId="1_2_1_1_2"><PageContent HierId="1_2_1_1_2_1"><Paragraph Language="en" Characteristic="TableContent">two</Paragraph></PageContent></TableData></TableRow><TableRow HierId="1_2_1_2"><TableData HierId="1_2_1_2_1"><PageContent HierId="1_2_1_2_1_1"><Paragraph Language="en" Characteristic="TableContent">three</Paragraph></PageContent></TableData><TableData HierId="1_2_1_2_2"><PageContent HierId="1_2_1_2_2_1"><Paragraph Language="en" Characteristic="TableContent">four</Paragraph></PageContent></TableData></TableRow></Table></PageContent></GridCell></Grid></PageContent></PageObject>
100EOT;
101
102 $this->assertXmlEquals(
103 $expected,
104 $page->getXMLFromDom()
105 );
106 }
Class ilPCDataTable.
const TEMPLATE_TWO_COLUMN
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $page, COPageTestBase\assertXmlEquals(), COPageTestBase\getEmptyPageWithDom(), and ilPCGridGUI\TEMPLATE_TWO_COLUMN.

+ Here is the call graph for this function:

◆ testConstruction()

PageObjectTest::testConstruction ( )

Definition at line 26 of file PageObjectTest.php.

26 : void
27 {
29 $this->assertEquals(
30 ilUnitTestPageObject::class,
31 get_class($page)
32 );
33 }

References $page.

◆ testGeneratePCId()

PageObjectTest::testGeneratePCId ( )

Definition at line 108 of file PageObjectTest.php.

108 : void
109 {
110 $page = $this->getEmptyPageWithDom();
111 $id = $page->generatePCId();
112 $this->assertEquals(
113 32,
114 strlen($id)
115 );
116 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, $page, and COPageTestBase\getEmptyPageWithDom().

+ Here is the call graph for this function:

◆ testGetCharacteristicLangVarXMLForValueEscapesXMLSpecialCharacters()

PageObjectTest::testGetCharacteristicLangVarXMLForValueEscapesXMLSpecialCharacters ( )

Definition at line 131 of file PageObjectTest.php.

131 : void
132 {
134
135 $this->assertSame(
136 '<LV name="char_text_block_My&amp;Class" value="one &amp; two &apos; three &quot; four &lt; five &gt;"/>',
137 $page->getCharacteristicLangVarXMLForTesting(
138 'text_block',
139 'My&Class',
140 'one & two \' three " four < five >'
141 )
142 );
143 }

References $page.

◆ testGetLangVarXMLForValueEscapesXMLSpecialCharacters()

PageObjectTest::testGetLangVarXMLForValueEscapesXMLSpecialCharacters ( )

Definition at line 118 of file PageObjectTest.php.

118 : void
119 {
121
122 $this->assertSame(
123 '<LV name="some&amp;" value="one &amp; two &apos; three &quot; four &lt; five &gt;"/>',
124 $page->getLangVarXMLForValueForTesting(
125 'some&',
126 'one & two \' three " four < five >'
127 )
128 );
129 }

References $page.

◆ testGetXMLFromDom()

PageObjectTest::testGetXMLFromDom ( )

Definition at line 46 of file PageObjectTest.php.

46 : void
47 {
49
50 $page->setXMLContent("<PageObject></PageObject>");
51 $page->buildDom();
52 $this->assertXmlEquals(
53 "<PageObject></PageObject>",
54 $page->getXMLFromDom()
55 );
56 }

References $page, and COPageTestBase\assertXmlEquals().

+ Here is the call graph for this function:

◆ testSetXMLContent()

PageObjectTest::testSetXMLContent ( )

Definition at line 35 of file PageObjectTest.php.

35 : void
36 {
38
39 $page->setXMLContent("<PageObject></PageObject>");
40 $this->assertEquals(
41 "<PageObject></PageObject>",
42 $page->getXMLContent()
43 );
44 }

References $page.


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