ILIAS  release_8 Revision v8.24
ImageMapEditSessionRepositoryTest.php
Go to the documentation of this file.
1<?php
2
3use PHPUnit\Framework\TestCase;
4
11{
12 //protected $backupGlobals = false;
13 protected \ILIAS\MediaObjects\ImageMap\ImageMapEditSessionRepository $repo;
14
15 protected function setUp(): void
16 {
17 parent::setUp();
18 $this->repo = new \ILIAS\MediaObjects\ImageMap\ImageMapEditSessionRepository();
19 $this->repo->clear();
20 }
21
22 protected function tearDown(): void
23 {
24 }
25
29 public function testClear(): void
30 {
32
33 $repo->setCoords("1,2,3");
34 $repo->setAreaNr(4);
35 $repo->setLinkType("int");
36 $repo->clear();
37 $this->assertEquals(
38 "",
39 $repo->getCoords()
40 );
41 $this->assertEquals(
42 0,
43 $repo->getAreaNr()
44 );
45 $this->assertEquals(
46 "",
47 $repo->getLinkType()
48 );
49 }
50
51 public function testTargetScript(): void
52 {
54 $repo->setTargetScript("ilias.php?a=1");
55 $this->assertEquals(
56 "ilias.php?a=1",
57 $repo->getTargetScript()
58 );
59 }
60
61 public function testLinkType(): void
62 {
64 $repo->setLinkType("ext");
65 $this->assertEquals(
66 "ext",
67 $repo->getLinkType()
68 );
69 }
70
71 public function testAreaNr(): void
72 {
74 $repo->setAreaNr(4);
75 $this->assertEquals(
76 4,
77 $repo->getAreaNr()
78 );
79 }
80
81 public function testCoords(): void
82 {
84 $repo->setCoords("7,8,9,2");
85 $this->assertEquals(
86 "7,8,9,2",
87 $repo->getCoords()
88 );
89 }
90
91 public function testAreaType(): void
92 {
94 $repo->setAreaType("Rect");
95 $this->assertEquals(
96 "Rect",
97 $repo->getAreaType()
98 );
99 }
100
101 public function testExternalLink(): void
102 {
104 $repo->setExternalLink("https://www.ilias.de");
105 $this->assertEquals(
106 "https://www.ilias.de",
107 $repo->getExternalLink()
108 );
109 }
110}
ILIAS MediaObjects ImageMap ImageMapEditSessionRepository $repo