ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 27 of file PCInteractiveImageTest.php.

Member Function Documentation

◆ getInteractiveImageInPage()

PCInteractiveImageTest::getInteractiveImageInPage ( ilPageObject  $page)
protected

Definition at line 216 of file PCInteractiveImageTest.php.

217 {
218 $pc = new ilPCInteractiveImage(
219 $page,
220 null,
221 $this->getObjectAdapterMock()
222 );
223 $pc->setMediaObject($this->getMediaObjectMock());
224 $pc->createAlias($page, "pg");
225 $page->addHierIDs();
226 $page->insertPCIds();
227 $pc->setHierId("1");
228 $pc->setPCId($page->getPCIdForHierId("1"));
229 $pc->setDomNode($pc->getDomNode());
230 return $pc;
231 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addHierIDs()
Add hierarchical ID (e.g.
insertPCIds()
Insert Page Content IDs.
getPCIdForHierId(string $hier_id)

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMediaObjectMock()

PCInteractiveImageTest::getMediaObjectMock ( )
protected
Returns
(ilObjMediaObject&\PHPUnit\Framework\MockObject\MockObject)|\PHPUnit\Framework\MockObject\MockObject

Reimplemented from COPageTestBase.

Definition at line 32 of file PCInteractiveImageTest.php.

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

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

+ Here is the caller graph for this function:

◆ getObjectAdapterMock()

PCInteractiveImageTest::getObjectAdapterMock ( )
protected
Returns
(\ILIAS\Repository\Object\ObjectAdapter&\PHPUnit\Framework\MockObject\MockObject)|\PHPUnit\Framework\MockObject\MockObject

Definition at line 48 of file PCInteractiveImageTest.php.

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

Referenced by getInteractiveImageInPage().

+ Here is the caller graph for this function:

◆ testAddContentPopup()

PCInteractiveImageTest::testAddContentPopup ( )

Definition at line 113 of file PCInteractiveImageTest.php.

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

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

+ Here is the call graph for this function:

◆ testAddTriggerArea()

PCInteractiveImageTest::testAddTriggerArea ( )

Definition at line 233 of file PCInteractiveImageTest.php.

233 : void
234 {
235 $page = $this->getEmptyPageWithDom();
236 $pc = $this->getInteractiveImageInPage($page);
237
238 $pc->addTriggerArea(
239 $pc->getStandardAliasItem(),
241 "20,20,200,200",
242 "Area Title"
243 );
244 $page->stripHierIDs();
245 $page->stripPCIDs();
246
247 $expected = <<<EOT
248<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>
249EOT;
250
251 $this->assertXmlEquals(
252 $expected,
253 $page->getXMLFromDom()
254 );
255 }
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...

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

+ Here is the call graph for this function:

◆ testAddTriggerMarker()

PCInteractiveImageTest::testAddTriggerMarker ( )

Definition at line 257 of file PCInteractiveImageTest.php.

257 : void
258 {
259 $page = $this->getEmptyPageWithDom();
260 $pc = $this->getInteractiveImageInPage($page);
261
262 $pc->addTriggerMarker(
263 );
264 $page->stripHierIDs();
265 $page->stripPCIDs();
266
267 $expected = <<<EOT
268<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>
269EOT;
270
271 $this->assertXmlEquals(
272 $expected,
273 $page->getXMLFromDom()
274 );
275 }

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

+ Here is the call graph for this function:

◆ testConstruction()

PCInteractiveImageTest::testConstruction ( )

Definition at line 58 of file PCInteractiveImageTest.php.

58 : void
59 {
60 $page = $this->getEmptyPageWithDom();
61 $pc = new ilPCInteractiveImage($page);
62 $this->assertEquals(
63 ilPCInteractiveImage::class,
64 get_class($pc)
65 );
66 }

References COPageTestBase\getEmptyPageWithDom().

+ Here is the call graph for this function:

◆ testCreate()

PCInteractiveImageTest::testCreate ( )

Definition at line 68 of file PCInteractiveImageTest.php.

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

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

+ Here is the call graph for this function:

◆ testCreateAlias()

PCInteractiveImageTest::testCreateAlias ( )

Definition at line 79 of file PCInteractiveImageTest.php.

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

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

+ Here is the call graph for this function:

◆ testDeletePopup()

PCInteractiveImageTest::testDeletePopup ( )

Definition at line 188 of file PCInteractiveImageTest.php.

188 : void
189 {
190 $page = $this->getEmptyPageWithDom();
191 $pc = new ilPCInteractiveImage($page);
192 $pc->setMediaObject($this->getMediaObjectMock());
193 $pc->createAlias($page, "pg");
194 $pc->addContentPopup();
195 $pc->addContentPopup();
196 $page->addHierIDs();
197 $popups = $pc->savePopups(
198 [
199 "1_1:" => "Test Title 1",
200 "1_2:" => "Test Title 2"
201 ]
202 );
203 $pc->deletePopup("1_1", "");
204 $page->stripHierIDs();
205
206 $expected = <<<EOT
207<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>
208EOT;
209
210 $this->assertXmlEquals(
211 $expected,
212 $page->getXMLFromDom()
213 );
214 }

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

+ Here is the call graph for this function:

◆ testDeleteTrigger()

PCInteractiveImageTest::testDeleteTrigger ( )

Definition at line 302 of file PCInteractiveImageTest.php.

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

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

+ Here is the call graph for this function:

◆ testDump()

PCInteractiveImageTest::testDump ( )

Definition at line 96 of file PCInteractiveImageTest.php.

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

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

+ Here is the call graph for this function:

◆ testGetPopups()

PCInteractiveImageTest::testGetPopups ( )

Definition at line 134 of file PCInteractiveImageTest.php.

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

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

+ Here is the call graph for this function:

◆ testGetTriggerNodes()

PCInteractiveImageTest::testGetTriggerNodes ( )

Definition at line 277 of file PCInteractiveImageTest.php.

277 : void
278 {
279 $page = $this->getEmptyPageWithDom();
280 $pc = $this->getInteractiveImageInPage($page);
281 $pc->addTriggerMarker();
282 $page->stripPCIDs();
283 $nodes = $pc->getTriggerNodes("1", "");
284 $this->assertEquals(
285 "Trigger",
286 $nodes->item(0)->nodeName
287 );
288 }

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

+ Here is the call graph for this function:

◆ testGetTriggers()

PCInteractiveImageTest::testGetTriggers ( )

Definition at line 290 of file PCInteractiveImageTest.php.

290 : void
291 {
292 $page = $this->getEmptyPageWithDom();
293 $pc = $this->getInteractiveImageInPage($page);
294 $pc->addTriggerMarker();
295 $triggers = $pc->getTriggers();
296 $this->assertEquals(
297 "Marker",
298 $triggers[0]["Type"]
299 );
300 }

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

+ Here is the call graph for this function:

◆ testSavePopups()

PCInteractiveImageTest::testSavePopups ( )

Definition at line 159 of file PCInteractiveImageTest.php.

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

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

+ Here is the call graph for this function:

◆ testSetOverlays()

PCInteractiveImageTest::testSetOverlays ( )

Definition at line 329 of file PCInteractiveImageTest.php.

329 : void
330 {
331 $page = $this->getEmptyPageWithDom();
332 $pc = $this->getInteractiveImageInPage($page);
333
334 $pc->addTriggerArea(
335 $pc->getStandardAliasItem(),
337 "20,20,200,200",
338 "Area Title"
339 );
340 $pc->setTriggerOverlays([
341 "1" => "image1.jpg"
342 ]);
343
344 $page->stripHierIDs();
345 $page->stripPCIDs();
346
347 $expected = <<<EOT
348<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>
349EOT;
350
351 $this->assertXmlEquals(
352 $expected,
353 $page->getXMLFromDom()
354 );
355 }

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

+ Here is the call graph for this function:

◆ testSetTriggerMarkerPositions()

PCInteractiveImageTest::testSetTriggerMarkerPositions ( )

Definition at line 385 of file PCInteractiveImageTest.php.

385 : void
386 {
387 $page = $this->getEmptyPageWithDom();
388 $pc = $this->getInteractiveImageInPage($page);
389
390 $pc->addTriggerMarker();
391 $pc->setTriggerMarkerPositions(
392 ["1" => "50,100"]
393 );
394
395 $page->stripHierIDs();
396 $page->stripPCIDs();
397
398 $expected = <<<EOT
399<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>
400EOT;
401
402 $this->assertXmlEquals(
403 $expected,
404 $page->getXMLFromDom()
405 );
406 }

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

+ Here is the call graph for this function:

◆ testSetTriggerOverlayPositions()

PCInteractiveImageTest::testSetTriggerOverlayPositions ( )

Definition at line 357 of file PCInteractiveImageTest.php.

357 : void
358 {
359 $page = $this->getEmptyPageWithDom();
360 $pc = $this->getInteractiveImageInPage($page);
361
362 $pc->addTriggerArea(
363 $pc->getStandardAliasItem(),
365 "20,20,200,200",
366 "Area Title"
367 );
368 $pc->setTriggerOverlayPositions([
369 "1" => "10,20"
370 ]);
371
372 $page->stripHierIDs();
373 $page->stripPCIDs();
374
375 $expected = <<<EOT
376<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>
377EOT;
378
379 $this->assertXmlEquals(
380 $expected,
381 $page->getXMLFromDom()
382 );
383 }

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

+ Here is the call graph for this function:

◆ testSetTriggerPopupPositions()

PCInteractiveImageTest::testSetTriggerPopupPositions ( )

Definition at line 408 of file PCInteractiveImageTest.php.

408 : void
409 {
410 $page = $this->getEmptyPageWithDom();
411 $pc = $this->getInteractiveImageInPage($page);
412
413 $pc->addTriggerMarker();
414 $pc->setTriggerPopupPositions(
415 ["1" => "40,30"]
416 );
417
418 $page->stripHierIDs();
419 $page->stripPCIDs();
420
421 $expected = <<<EOT
422<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>
423EOT;
424
425 $this->assertXmlEquals(
426 $expected,
427 $page->getXMLFromDom()
428 );
429 }

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

+ Here is the call graph for this function:

◆ testSetTriggerPopups()

PCInteractiveImageTest::testSetTriggerPopups ( )

Definition at line 454 of file PCInteractiveImageTest.php.

454 : void
455 {
456 $page = $this->getEmptyPageWithDom();
457 $pc = $this->getInteractiveImageInPage($page);
458
459 $pc->addTriggerMarker();
460 $pc->setTriggerPopups(
461 ["1" => "1"]
462 );
463
464 $page->stripHierIDs();
465 $page->stripPCIDs();
466
467 $expected = <<<EOT
468<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>
469EOT;
470
471 $this->assertXmlEquals(
472 $expected,
473 $page->getXMLFromDom()
474 );
475 }

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

+ Here is the call graph for this function:

◆ testSetTriggerPopupSize()

PCInteractiveImageTest::testSetTriggerPopupSize ( )

Definition at line 431 of file PCInteractiveImageTest.php.

431 : void
432 {
433 $page = $this->getEmptyPageWithDom();
434 $pc = $this->getInteractiveImageInPage($page);
435
436 $pc->addTriggerMarker();
437 $pc->setTriggerPopupSize(
438 ["1" => "220,330"]
439 );
440
441 $page->stripHierIDs();
442 $page->stripPCIDs();
443
444 $expected = <<<EOT
445<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>
446EOT;
447
448 $this->assertXmlEquals(
449 $expected,
450 $page->getXMLFromDom()
451 );
452 }

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

+ Here is the call graph for this function:

◆ testSetTriggerTitles()

PCInteractiveImageTest::testSetTriggerTitles ( )

Definition at line 477 of file PCInteractiveImageTest.php.

477 : void
478 {
479 $page = $this->getEmptyPageWithDom();
480 $pc = $this->getInteractiveImageInPage($page);
481
482 $pc->addTriggerMarker();
483 $pc->setTriggerTitles(
484 ["1" => "My Title"]
485 );
486
487 $page->stripHierIDs();
488 $page->stripPCIDs();
489
490 $expected = <<<EOT
491<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>
492EOT;
493
494 $this->assertXmlEquals(
495 $expected,
496 $page->getXMLFromDom()
497 );
498 }

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

+ Here is the call graph for this function:

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