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

Public Member Functions

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

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.

References COPageTestBase\assertXmlEquals().

58  : void
59  {
60  $page = new ilUnitTestPageObject(0);
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  }
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:

◆ testAddHierIdsWithContent()

PageObjectTest::testAddHierIdsWithContent ( )

Definition at line 71 of file PageObjectTest.php.

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

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>
100 EOT;
101 
102  $this->assertXmlEquals(
103  $expected,
104  $page->getXMLFromDom()
105  );
106  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const TEMPLATE_TWO_COLUMN
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
Class ilPCDataTable.
+ Here is the call graph for this function:

◆ testConstruction()

PageObjectTest::testConstruction ( )

Definition at line 26 of file PageObjectTest.php.

26  : void
27  {
28  $page = new ilUnitTestPageObject(0);
29  $this->assertEquals(
30  ilUnitTestPageObject::class,
31  get_class($page)
32  );
33  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ testGeneratePCId()

PageObjectTest::testGeneratePCId ( )

Definition at line 108 of file PageObjectTest.php.

References $id, and COPageTestBase\getEmptyPageWithDom().

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
+ Here is the call graph for this function:

◆ testGetXMLFromDom()

PageObjectTest::testGetXMLFromDom ( )

Definition at line 46 of file PageObjectTest.php.

References COPageTestBase\assertXmlEquals().

46  : void
47  {
48  $page = new ilUnitTestPageObject(0);
49 
50  $page->setXMLContent("<PageObject></PageObject>");
51  $page->buildDom();
52  $this->assertXmlEquals(
53  "<PageObject></PageObject>",
54  $page->getXMLFromDom()
55  );
56  }
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:

◆ testSetXMLContent()

PageObjectTest::testSetXMLContent ( )

Definition at line 35 of file PageObjectTest.php.

35  : void
36  {
37  $page = new ilUnitTestPageObject(0);
38 
39  $page->setXMLContent("<PageObject></PageObject>");
40  $this->assertEquals(
41  "<PageObject></PageObject>",
42  $page->getXMLContent()
43  );
44  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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