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

Public Member Functions

 testConstruction ()
 
 testCreate ()
 
 testCreateAlias ()
 
 testDump ()
 
 testAddContentPopup ()
 
 testGetPopups ()
 
 testSavePopups ()
 
 testDeletePopup ()
 
 testAddTriggerArea ()
 
 testAddTriggerMarker ()
 
 testGetTriggerNodes ()
 
 testGetTriggers ()
 
 testDeleteTrigger ()
 
 testSetOverlays ()
 
 testSetTriggerOverlayPositions ()
 
 testSetTriggerMarkerPositions ()
 
 testSetTriggerPopupPositions ()
 
 testSetTriggerPopupSize ()
 
 testSetTriggerPopups ()
 
 testSetTriggerTitles ()
 

Protected Member Functions

 getMediaObjectMock ()
 
 getObjectAdapterMock ()
 
 getInteractiveImageInPage (ilPageObject $page)
 
- 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 ()
 

Additional Inherited Members

- 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 26 of file PCInteractiveImageTest.php.

Member Function Documentation

◆ getInteractiveImageInPage()

PCInteractiveImageTest::getInteractiveImageInPage ( ilPageObject  $page)
protected

Definition at line 215 of file PCInteractiveImageTest.php.

References ilPageObject\addHierIDs(), getMediaObjectMock(), getObjectAdapterMock(), ilPageObject\getPCIdForHierId(), ilPageObject\insertPCIds(), and null.

Referenced by testAddTriggerArea(), testAddTriggerMarker(), testDeleteTrigger(), testGetTriggerNodes(), testGetTriggers(), testSetOverlays(), testSetTriggerMarkerPositions(), testSetTriggerOverlayPositions(), testSetTriggerPopupPositions(), testSetTriggerPopups(), testSetTriggerPopupSize(), and testSetTriggerTitles().

216  {
217  $pc = new ilPCInteractiveImage(
218  $page,
219  null,
220  $this->getObjectAdapterMock()
221  );
222  $pc->setMediaObject($this->getMediaObjectMock());
223  $pc->createAlias($page, "pg");
224  $page->addHierIDs();
225  $page->insertPCIds();
226  $pc->setHierId("1");
227  $pc->setPCId($page->getPCIdForHierId("1"));
228  $pc->setDomNode($pc->getDomNode());
229  return $pc;
230  }
getPCIdForHierId(string $hier_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
insertPCIds()
Insert Page Content IDs.
addHierIDs()
Add hierarchical ID (e.g.
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:
+ Here is the caller graph for this function:

◆ getMediaObjectMock()

PCInteractiveImageTest::getMediaObjectMock ( )
protected
Returns
(ilObjMediaObject&)|

Definition at line 31 of file PCInteractiveImageTest.php.

Referenced by getInteractiveImageInPage(), testAddContentPopup(), testCreateAlias(), testDeletePopup(), testDump(), testGetPopups(), and testSavePopups().

32  {
33  $media_item = new ilMediaItem();
34  $media_item->setWidth("100");
35  $media_item->setHeight("50");
36  $media_object = $this->getMockBuilder(ilObjMediaObject::class)
37  ->disableOriginalConstructor()
38  ->getMock();
39  $media_object->method("getMediaItem")
40  ->willReturnCallback(fn() => $media_item);
41  return $media_object;
42  }
Class ilMediaItem Media Item, component of a media object (file or reference)
+ Here is the caller graph for this function:

◆ getObjectAdapterMock()

PCInteractiveImageTest::getObjectAdapterMock ( )
protected
Returns
(&)|

Definition at line 47 of file PCInteractiveImageTest.php.

Referenced by getInteractiveImageInPage().

48  {
49  $object_adapter = $this->getMockBuilder(\ILIAS\Repository\Object\ObjectAdapter::class)
50  ->disableOriginalConstructor()
51  ->getMock();
52  $object_adapter->method("getTypeForObjId")
53  ->willReturnCallback(fn() => "dummy");
54  return $object_adapter;
55  }
Interface Observer Contains several chained tasks and infos about them.
+ Here is the caller graph for this function:

◆ testAddContentPopup()

PCInteractiveImageTest::testAddContentPopup ( )

Definition at line 112 of file PCInteractiveImageTest.php.

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

112  : void
113  {
114  $page = $this->getEmptyPageWithDom();
115  $pc = new ilPCInteractiveImage($page);
116  $pc->setMediaObject($this->getMediaObjectMock());
117  $pc->createAlias($page, "pg");
118  $pc->addContentPopup();
119 
120  //echo $page->getXMLFromDom();
121  //exit;
122 
123  $expected = <<<EOT
124 <PageObject HierId="pg"><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem><ContentPopup Title="" Nr="1"/></InteractiveImage></PageContent></PageObject>
125 EOT;
126 
127  $this->assertXmlEquals(
128  $expected,
129  $page->getXMLFromDom()
130  );
131  }
Title class.
Definition: Title.php:41
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:

◆ testAddTriggerArea()

PCInteractiveImageTest::testAddTriggerArea ( )

Definition at line 232 of file PCInteractiveImageTest.php.

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

232  : void
233  {
234  $page = $this->getEmptyPageWithDom();
235  $pc = $this->getInteractiveImageInPage($page);
236 
237  $pc->addTriggerArea(
238  $pc->getStandardAliasItem(),
239  IL_AREA_RECT,
240  "20,20,200,200",
241  "Area Title"
242  );
243  $page->stripHierIDs();
244  $page->stripPCIDs();
245 
246  $expected = <<<EOT
247 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/><MapArea Shape="Rect" Coords="20,20,200,200" Id="1"><ExtLink Href="#">Area Title</ExtLink></MapArea></MediaAliasItem><Trigger Type="Area" Title="Area Title" Nr="1" OverlayX="0" OverlayY="0" PopupX="0" PopupY="0" PopupWidth="150" PopupHeight="200"/></InteractiveImage></PageContent></PageObject>
248 EOT;
249 
250  $this->assertXmlEquals(
251  $expected,
252  $page->getXMLFromDom()
253  );
254  }
getInteractiveImageInPage(ilPageObject $page)
Title class.
Definition: Title.php:41
const IL_AREA_RECT
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:

◆ testAddTriggerMarker()

PCInteractiveImageTest::testAddTriggerMarker ( )

Definition at line 256 of file PCInteractiveImageTest.php.

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

256  : void
257  {
258  $page = $this->getEmptyPageWithDom();
259  $pc = $this->getInteractiveImageInPage($page);
260 
261  $pc->addTriggerMarker(
262  );
263  $page->stripHierIDs();
264  $page->stripPCIDs();
265 
266  $expected = <<<EOT
267 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem><Trigger Type="Marker" Nr="1" OverlayX="0" OverlayY="0" MarkerX="0" MarkerY="0" PopupX="0" PopupY="0" PopupWidth="150" PopupHeight="200"/></InteractiveImage></PageContent></PageObject>
268 EOT;
269 
270  $this->assertXmlEquals(
271  $expected,
272  $page->getXMLFromDom()
273  );
274  }
getInteractiveImageInPage(ilPageObject $page)
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testConstruction()

PCInteractiveImageTest::testConstruction ( )

Definition at line 57 of file PCInteractiveImageTest.php.

References COPageTestBase\getEmptyPageWithDom().

57  : void
58  {
59  $page = $this->getEmptyPageWithDom();
60  $pc = new ilPCInteractiveImage($page);
61  $this->assertEquals(
62  ilPCInteractiveImage::class,
63  get_class($pc)
64  );
65  }
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()

PCInteractiveImageTest::testCreate ( )

Definition at line 67 of file PCInteractiveImageTest.php.

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

67  : void
68  {
69  $page = $this->getEmptyPageWithDom();
70  $pc = new ilPCInteractiveImage($page);
71  $pc->create($page, "pg");
72  $this->assertXmlEquals(
73  '<PageObject HierId="pg"></PageObject>',
74  $page->getXMLFromDom()
75  );
76  }
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:

◆ testCreateAlias()

PCInteractiveImageTest::testCreateAlias ( )

Definition at line 78 of file PCInteractiveImageTest.php.

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

78  : void
79  {
80  $page = $this->getEmptyPageWithDom();
81  $pc = new ilPCInteractiveImage($page);
82  $pc->setMediaObject($this->getMediaObjectMock());
83  $pc->createAlias($page, "pg");
84 
85  $expected = <<<EOT
86 <PageObject HierId="pg"><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem></InteractiveImage></PageContent></PageObject>
87 EOT;
88 
89  $this->assertXmlEquals(
90  $expected,
91  $page->getXMLFromDom()
92  );
93  }
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:

◆ testDeletePopup()

PCInteractiveImageTest::testDeletePopup ( )

Definition at line 187 of file PCInteractiveImageTest.php.

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

187  : void
188  {
189  $page = $this->getEmptyPageWithDom();
190  $pc = new ilPCInteractiveImage($page);
191  $pc->setMediaObject($this->getMediaObjectMock());
192  $pc->createAlias($page, "pg");
193  $pc->addContentPopup();
194  $pc->addContentPopup();
195  $page->addHierIDs();
196  $popups = $pc->savePopups(
197  [
198  "1_1:" => "Test Title 1",
199  "1_2:" => "Test Title 2"
200  ]
201  );
202  $pc->deletePopup("1_1", "");
203  $page->stripHierIDs();
204 
205  $expected = <<<EOT
206 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem><ContentPopup Title="Test Title 2" Nr="2"/></InteractiveImage></PageContent></PageObject>
207 EOT;
208 
209  $this->assertXmlEquals(
210  $expected,
211  $page->getXMLFromDom()
212  );
213  }
Title class.
Definition: Title.php:41
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:

◆ testDeleteTrigger()

PCInteractiveImageTest::testDeleteTrigger ( )

Definition at line 301 of file PCInteractiveImageTest.php.

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

301  : void
302  {
303  $page = $this->getEmptyPageWithDom();
304  $pc = $this->getInteractiveImageInPage($page);
305 
306  $pc->addTriggerArea(
307  $pc->getStandardAliasItem(),
308  IL_AREA_RECT,
309  "20,20,200,200",
310  "Area Title"
311  );
312  $ma = $pc->getStandardAliasItem();
313  $pc->deleteTrigger($ma, "1");
314 
315  $page->stripHierIDs();
316  $page->stripPCIDs();
317 
318  $expected = <<<EOT
319 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem></InteractiveImage></PageContent></PageObject>
320 EOT;
321 
322  $this->assertXmlEquals(
323  $expected,
324  $page->getXMLFromDom()
325  );
326  }
getInteractiveImageInPage(ilPageObject $page)
const IL_AREA_RECT
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:

◆ testDump()

PCInteractiveImageTest::testDump ( )

Definition at line 95 of file PCInteractiveImageTest.php.

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

95  : void
96  {
97  $page = $this->getEmptyPageWithDom();
98  $pc = new ilPCInteractiveImage($page);
99  $pc->setMediaObject($this->getMediaObjectMock());
100  $pc->createAlias($page, "pg");
101 
102  $expected = <<<EOT
103 <PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem></InteractiveImage></PageContent>
104 EOT;
105 
106  $this->assertXmlEquals(
107  $expected,
108  $pc->dumpXML()
109  );
110  }
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:

◆ testGetPopups()

PCInteractiveImageTest::testGetPopups ( )

Definition at line 133 of file PCInteractiveImageTest.php.

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

133  : void
134  {
135  $page = $this->getEmptyPageWithDom();
136  $pc = new ilPCInteractiveImage($page);
137  $pc->setMediaObject($this->getMediaObjectMock());
138  $pc->createAlias($page, "pg");
139  $pc->addContentPopup();
140  $page->addHierIDs();
141  $popups = $pc->getPopups();
142 
143  $expected = [
144  0 => [
145  "title" => "",
146  "nr" => "1",
147  "pc_id" => "",
148  "hier_id" => "1_1"
149  ]
150  ];
151 
152  $this->assertEquals(
153  $expected,
154  $popups
155  );
156  }
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:

◆ testGetTriggerNodes()

PCInteractiveImageTest::testGetTriggerNodes ( )

Definition at line 276 of file PCInteractiveImageTest.php.

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

276  : void
277  {
278  $page = $this->getEmptyPageWithDom();
279  $pc = $this->getInteractiveImageInPage($page);
280  $pc->addTriggerMarker();
281  $page->stripPCIDs();
282  $nodes = $pc->getTriggerNodes("1", "");
283  $this->assertEquals(
284  "Trigger",
285  $nodes->item(0)->nodeName
286  );
287  }
getInteractiveImageInPage(ilPageObject $page)
+ Here is the call graph for this function:

◆ testGetTriggers()

PCInteractiveImageTest::testGetTriggers ( )

Definition at line 289 of file PCInteractiveImageTest.php.

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

289  : void
290  {
291  $page = $this->getEmptyPageWithDom();
292  $pc = $this->getInteractiveImageInPage($page);
293  $pc->addTriggerMarker();
294  $triggers = $pc->getTriggers();
295  $this->assertEquals(
296  "Marker",
297  $triggers[0]["Type"]
298  );
299  }
getInteractiveImageInPage(ilPageObject $page)
+ Here is the call graph for this function:

◆ testSavePopups()

PCInteractiveImageTest::testSavePopups ( )

Definition at line 158 of file PCInteractiveImageTest.php.

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

158  : void
159  {
160  $page = $this->getEmptyPageWithDom();
161  $pc = new ilPCInteractiveImage($page);
162  $pc->setMediaObject($this->getMediaObjectMock());
163  $pc->createAlias($page, "pg");
164  $pc->addContentPopup();
165  $page->addHierIDs();
166  $popups = $pc->savePopups(
167  [
168  "1_1:" => "Test Title"
169  ]
170  );
171 
172  $expected = [
173  0 => [
174  "title" => "Test Title",
175  "nr" => "1",
176  "pc_id" => "",
177  "hier_id" => "1_1"
178  ]
179  ];
180 
181  $this->assertEquals(
182  $expected,
183  $pc->getPopups()
184  );
185  }
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:

◆ testSetOverlays()

PCInteractiveImageTest::testSetOverlays ( )

Definition at line 328 of file PCInteractiveImageTest.php.

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

328  : void
329  {
330  $page = $this->getEmptyPageWithDom();
331  $pc = $this->getInteractiveImageInPage($page);
332 
333  $pc->addTriggerArea(
334  $pc->getStandardAliasItem(),
335  IL_AREA_RECT,
336  "20,20,200,200",
337  "Area Title"
338  );
339  $pc->setTriggerOverlays([
340  "1" => "image1.jpg"
341  ]);
342 
343  $page->stripHierIDs();
344  $page->stripPCIDs();
345 
346  $expected = <<<EOT
347 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/><MapArea Shape="Rect" Coords="20,20,200,200" Id="1"><ExtLink Href="#">Area Title</ExtLink></MapArea></MediaAliasItem><Trigger Type="Area" Title="Area Title" Nr="1" OverlayX="0" OverlayY="0" PopupX="0" PopupY="0" PopupWidth="150" PopupHeight="200" Overlay="image1.jpg"/></InteractiveImage></PageContent></PageObject>
348 EOT;
349 
350  $this->assertXmlEquals(
351  $expected,
352  $page->getXMLFromDom()
353  );
354  }
getInteractiveImageInPage(ilPageObject $page)
Title class.
Definition: Title.php:41
const IL_AREA_RECT
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:

◆ testSetTriggerMarkerPositions()

PCInteractiveImageTest::testSetTriggerMarkerPositions ( )

Definition at line 384 of file PCInteractiveImageTest.php.

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

384  : void
385  {
386  $page = $this->getEmptyPageWithDom();
387  $pc = $this->getInteractiveImageInPage($page);
388 
389  $pc->addTriggerMarker();
390  $pc->setTriggerMarkerPositions(
391  ["1" => "50,100"]
392  );
393 
394  $page->stripHierIDs();
395  $page->stripPCIDs();
396 
397  $expected = <<<EOT
398 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem><Trigger Type="Marker" Nr="1" OverlayX="0" OverlayY="0" MarkerX="50" MarkerY="100" PopupX="0" PopupY="0" PopupWidth="150" PopupHeight="200"/></InteractiveImage></PageContent></PageObject>
399 EOT;
400 
401  $this->assertXmlEquals(
402  $expected,
403  $page->getXMLFromDom()
404  );
405  }
getInteractiveImageInPage(ilPageObject $page)
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testSetTriggerOverlayPositions()

PCInteractiveImageTest::testSetTriggerOverlayPositions ( )

Definition at line 356 of file PCInteractiveImageTest.php.

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

356  : void
357  {
358  $page = $this->getEmptyPageWithDom();
359  $pc = $this->getInteractiveImageInPage($page);
360 
361  $pc->addTriggerArea(
362  $pc->getStandardAliasItem(),
363  IL_AREA_RECT,
364  "20,20,200,200",
365  "Area Title"
366  );
367  $pc->setTriggerOverlayPositions([
368  "1" => "10,20"
369  ]);
370 
371  $page->stripHierIDs();
372  $page->stripPCIDs();
373 
374  $expected = <<<EOT
375 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/><MapArea Shape="Rect" Coords="20,20,200,200" Id="1"><ExtLink Href="#">Area Title</ExtLink></MapArea></MediaAliasItem><Trigger Type="Area" Title="Area Title" Nr="1" OverlayX="10" OverlayY="20" PopupX="0" PopupY="0" PopupWidth="150" PopupHeight="200"/></InteractiveImage></PageContent></PageObject>
376 EOT;
377 
378  $this->assertXmlEquals(
379  $expected,
380  $page->getXMLFromDom()
381  );
382  }
getInteractiveImageInPage(ilPageObject $page)
Title class.
Definition: Title.php:41
const IL_AREA_RECT
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:

◆ testSetTriggerPopupPositions()

PCInteractiveImageTest::testSetTriggerPopupPositions ( )

Definition at line 407 of file PCInteractiveImageTest.php.

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

407  : void
408  {
409  $page = $this->getEmptyPageWithDom();
410  $pc = $this->getInteractiveImageInPage($page);
411 
412  $pc->addTriggerMarker();
413  $pc->setTriggerPopupPositions(
414  ["1" => "40,30"]
415  );
416 
417  $page->stripHierIDs();
418  $page->stripPCIDs();
419 
420  $expected = <<<EOT
421 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem><Trigger Type="Marker" Nr="1" OverlayX="0" OverlayY="0" MarkerX="0" MarkerY="0" PopupX="40" PopupY="30" PopupWidth="150" PopupHeight="200"/></InteractiveImage></PageContent></PageObject>
422 EOT;
423 
424  $this->assertXmlEquals(
425  $expected,
426  $page->getXMLFromDom()
427  );
428  }
getInteractiveImageInPage(ilPageObject $page)
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testSetTriggerPopups()

PCInteractiveImageTest::testSetTriggerPopups ( )

Definition at line 453 of file PCInteractiveImageTest.php.

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

453  : void
454  {
455  $page = $this->getEmptyPageWithDom();
456  $pc = $this->getInteractiveImageInPage($page);
457 
458  $pc->addTriggerMarker();
459  $pc->setTriggerPopups(
460  ["1" => "1"]
461  );
462 
463  $page->stripHierIDs();
464  $page->stripPCIDs();
465 
466  $expected = <<<EOT
467 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem><Trigger Type="Marker" Nr="1" OverlayX="0" OverlayY="0" MarkerX="0" MarkerY="0" PopupX="0" PopupY="0" PopupWidth="150" PopupHeight="200" PopupNr="1"/></InteractiveImage></PageContent></PageObject>
468 EOT;
469 
470  $this->assertXmlEquals(
471  $expected,
472  $page->getXMLFromDom()
473  );
474  }
getInteractiveImageInPage(ilPageObject $page)
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testSetTriggerPopupSize()

PCInteractiveImageTest::testSetTriggerPopupSize ( )

Definition at line 430 of file PCInteractiveImageTest.php.

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

430  : void
431  {
432  $page = $this->getEmptyPageWithDom();
433  $pc = $this->getInteractiveImageInPage($page);
434 
435  $pc->addTriggerMarker();
436  $pc->setTriggerPopupSize(
437  ["1" => "220,330"]
438  );
439 
440  $page->stripHierIDs();
441  $page->stripPCIDs();
442 
443  $expected = <<<EOT
444 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem><Trigger Type="Marker" Nr="1" OverlayX="0" OverlayY="0" MarkerX="0" MarkerY="0" PopupX="0" PopupY="0" PopupWidth="220" PopupHeight="330"/></InteractiveImage></PageContent></PageObject>
445 EOT;
446 
447  $this->assertXmlEquals(
448  $expected,
449  $page->getXMLFromDom()
450  );
451  }
getInteractiveImageInPage(ilPageObject $page)
assertXmlEquals(string $expected_xml_as_string, string $html_xml_string)
+ Here is the call graph for this function:

◆ testSetTriggerTitles()

PCInteractiveImageTest::testSetTriggerTitles ( )

Definition at line 476 of file PCInteractiveImageTest.php.

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

476  : void
477  {
478  $page = $this->getEmptyPageWithDom();
479  $pc = $this->getInteractiveImageInPage($page);
480 
481  $pc->addTriggerMarker();
482  $pc->setTriggerTitles(
483  ["1" => "My Title"]
484  );
485 
486  $page->stripHierIDs();
487  $page->stripPCIDs();
488 
489  $expected = <<<EOT
490 <PageObject><PageContent><InteractiveImage><MediaAlias OriginId="il__mob_0"/><MediaAliasItem Purpose="Standard"><Layout HorizontalAlign="Left"/></MediaAliasItem><Trigger Type="Marker" Nr="1" OverlayX="0" OverlayY="0" MarkerX="0" MarkerY="0" PopupX="0" PopupY="0" PopupWidth="150" PopupHeight="200" Title="My Title"/></InteractiveImage></PageContent></PageObject>
491 EOT;
492 
493  $this->assertXmlEquals(
494  $expected,
495  $page->getXMLFromDom()
496  );
497  }
getInteractiveImageInPage(ilPageObject $page)
Title class.
Definition: Title.php:41
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: