ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ImageMapEditSessionRepositoryTest.php
Go to the documentation of this file.
1<?php
2
19use PHPUnit\Framework\TestCase;
20
27{
28 //protected $backupGlobals = false;
29 protected \ILIAS\MediaObjects\ImageMap\ImageMapEditSessionRepository $repo;
30
31 protected function setUp(): void
32 {
33 parent::setUp();
34 $this->repo = new \ILIAS\MediaObjects\ImageMap\ImageMapEditSessionRepository();
35 $this->repo->clear();
36 }
37
38 protected function tearDown(): void
39 {
40 }
41
45 public function testClear(): void
46 {
48
49 $repo->setCoords("1,2,3");
50 $repo->setAreaNr(4);
51 $repo->setLinkType("int");
52 $repo->clear();
53 $this->assertEquals(
54 "",
55 $repo->getCoords()
56 );
57 $this->assertEquals(
58 0,
59 $repo->getAreaNr()
60 );
61 $this->assertEquals(
62 "",
63 $repo->getLinkType()
64 );
65 }
66
67 public function testTargetScript(): void
68 {
70 $repo->setTargetScript("ilias.php?a=1");
71 $this->assertEquals(
72 "ilias.php?a=1",
73 $repo->getTargetScript()
74 );
75 }
76
77 public function testLinkType(): void
78 {
80 $repo->setLinkType("ext");
81 $this->assertEquals(
82 "ext",
83 $repo->getLinkType()
84 );
85 }
86
87 public function testAreaNr(): void
88 {
90 $repo->setAreaNr(4);
91 $this->assertEquals(
92 4,
93 $repo->getAreaNr()
94 );
95 }
96
97 public function testCoords(): void
98 {
100 $repo->setCoords("7,8,9,2");
101 $this->assertEquals(
102 "7,8,9,2",
103 $repo->getCoords()
104 );
105 }
106
107 public function testAreaType(): void
108 {
110 $repo->setAreaType("Rect");
111 $this->assertEquals(
112 "Rect",
113 $repo->getAreaType()
114 );
115 }
116
117 public function testExternalLink(): void
118 {
120 $repo->setExternalLink("https://www.ilias.de");
121 $this->assertEquals(
122 "https://www.ilias.de",
123 $repo->getExternalLink()
124 );
125 }
126}
ILIAS MediaObjects ImageMap ImageMapEditSessionRepository $repo