ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PCMapTest Class Reference
+ Inheritance diagram for PCMapTest:
+ Collaboration diagram for PCMapTest:

Public Member Functions

 testConstruction ()
 
 testCreate ()
 
 testLatitude ()
 
 testLongitude ()
 
 testZoom ()
 
 testLayout ()
 
 testCaption ()
 

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

Member Function Documentation

◆ testCaption()

PCMapTest::testCaption ( )

Definition at line 149 of file PCMapTest.php.

149 : void
150 {
151 $page = $this->getEmptyPageWithDom();
152 $pc = new ilPCMap($page);
153 $pc->create($page, "pg");
154 $pc->setCaption("Moin");
155
156 $this->assertEquals(
157 "Moin",
158 $pc->getCaption()
159 );
160
161 $page->stripHierIDs();
162
163 $expected = <<<EOT
164<PageObject><PageContent><Map Latitude="0" Longitude="0" Zoom="3"><MapCaption>Moin</MapCaption></Map></PageContent></PageObject>
165EOT;
166 $this->assertXmlEquals(
167 $expected,
168 $page->getXMLFromDom()
169 );
170 }
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 COPageTestBase\assertXmlEquals(), and COPageTestBase\getEmptyPageWithDom().

+ Here is the call graph for this function:

◆ testConstruction()

PCMapTest::testConstruction ( )

Definition at line 26 of file PCMapTest.php.

26 : void
27 {
28 $page = $this->getEmptyPageWithDom();
29 $pc = new ilPCMap($page);
30 $this->assertEquals(
31 ilPCMap::class,
32 get_class($pc)
33 );
34 }

References COPageTestBase\getEmptyPageWithDom().

+ Here is the call graph for this function:

◆ testCreate()

PCMapTest::testCreate ( )

Definition at line 36 of file PCMapTest.php.

36 : void
37 {
38 $page = $this->getEmptyPageWithDom();
39 $pc = new ilPCMap($page);
40 $pc->create($page, "pg");
41 $this->assertXmlEquals(
42 '<PageObject HierId="pg"><PageContent><Map Latitude="0" Longitude="0" Zoom="3"></Map></PageContent></PageObject>',
43 $page->getXMLFromDom()
44 );
45 }

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

+ Here is the call graph for this function:

◆ testLatitude()

PCMapTest::testLatitude ( )

Definition at line 47 of file PCMapTest.php.

47 : void
48 {
49 $page = $this->getEmptyPageWithDom();
50 $pc = new ilPCMap($page);
51 $pc->create($page, "pg");
52 $pc->setLatitude(23.24);
53
54 $this->assertEquals(
55 23.24,
56 $pc->getLatitude()
57 );
58
59 $page->stripHierIDs();
60
61 $expected = <<<EOT
62<PageObject><PageContent><Map Latitude="23.24" Longitude="0" Zoom="3"></Map></PageContent></PageObject>
63EOT;
64 $this->assertXmlEquals(
65 $expected,
66 $page->getXMLFromDom()
67 );
68 }

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

+ Here is the call graph for this function:

◆ testLayout()

PCMapTest::testLayout ( )

Definition at line 116 of file PCMapTest.php.

116 : void
117 {
118 $page = $this->getEmptyPageWithDom();
119 $pc = new ilPCMap($page);
120 $pc->create($page, "pg");
121 $pc->setLayout("200", "100", "Right");
122
123 $this->assertEquals(
124 "200",
125 $pc->getWidth()
126 );
127
128 $this->assertEquals(
129 "100",
130 $pc->getHeight()
131 );
132
133 $this->assertEquals(
134 "Right",
135 $pc->getHorizontalAlign()
136 );
137
138 $page->stripHierIDs();
139
140 $expected = <<<EOT
141<PageObject><PageContent><Map Latitude="0" Longitude="0" Zoom="3"><Layout Width="200" Height="100" HorizontalAlign="Right"/></Map></PageContent></PageObject>
142EOT;
143 $this->assertXmlEquals(
144 $expected,
145 $page->getXMLFromDom()
146 );
147 }

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

+ Here is the call graph for this function:

◆ testLongitude()

PCMapTest::testLongitude ( )

Definition at line 70 of file PCMapTest.php.

70 : void
71 {
72 $page = $this->getEmptyPageWithDom();
73 $pc = new ilPCMap($page);
74 $pc->create($page, "pg");
75 $pc->setLongitude(44.24);
76
77 $this->assertEquals(
78 44.24,
79 $pc->getLongitude()
80 );
81
82 $page->stripHierIDs();
83
84 $expected = <<<EOT
85<PageObject><PageContent><Map Latitude="0" Longitude="44.24" Zoom="3"></Map></PageContent></PageObject>
86EOT;
87 $this->assertXmlEquals(
88 $expected,
89 $page->getXMLFromDom()
90 );
91 }

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

+ Here is the call graph for this function:

◆ testZoom()

PCMapTest::testZoom ( )

Definition at line 93 of file PCMapTest.php.

93 : void
94 {
95 $page = $this->getEmptyPageWithDom();
96 $pc = new ilPCMap($page);
97 $pc->create($page, "pg");
98 $pc->setZoom(7);
99
100 $this->assertEquals(
101 7,
102 $pc->getZoom()
103 );
104
105 $page->stripHierIDs();
106
107 $expected = <<<EOT
108<PageObject><PageContent><Map Latitude="0" Longitude="0" Zoom="7"></Map></PageContent></PageObject>
109EOT;
110 $this->assertXmlEquals(
111 $expected,
112 $page->getXMLFromDom()
113 );
114 }

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

+ Here is the call graph for this function:

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