1 | <?php |
||
11 | class DisplayMapTest extends TestCase { |
||
12 | |||
13 | private $originalHeight; |
||
14 | private $originalWidth; |
||
15 | |||
16 | public function setUp() { |
||
20 | |||
21 | public function tearDown() { |
||
25 | |||
26 | public function testMapIdIsSet() { |
||
32 | |||
33 | private function parse( string $textToParse ): string { |
||
38 | |||
39 | public function testServiceSelectionWorks() { |
||
45 | |||
46 | public function testSingleCoordinatesAreIncluded() { |
||
52 | |||
53 | public function testMultipleCoordinatesAreIncluded() { |
||
59 | |||
60 | public function testWhenValidZoomIsSpecified_itGetsUsed() { |
||
66 | |||
67 | public function testWhenZoomIsNotSpecifiedAndThereIsOnlyOneLocation_itIsDefaulted() { |
||
73 | |||
74 | public function testWhenZoomIsNotSpecifiedAndThereAreMultipleLocations_itIsDefaulted() { |
||
80 | |||
81 | public function testWhenZoomIsInvalid_itIsDefaulted() { |
||
87 | |||
88 | public function testTagIsRendered() { |
||
94 | |||
95 | public function testTagServiceParameterIsUsed() { |
||
101 | |||
102 | public function testWhenThereAreNoLocations_locationsArrayIsEmpty() { |
||
108 | |||
109 | public function testLocationTitleGetsIncluded() { |
||
115 | |||
116 | public function testLocationDescriptionGetsIncluded() { |
||
122 | |||
123 | public function testRectangleDisplay() { |
||
129 | |||
130 | public function testCircleDisplay() { |
||
136 | |||
137 | public function testRectangleFillOpacityIsUsed() { |
||
143 | |||
144 | public function testRectangleFillColorIsUsed() { |
||
150 | |||
151 | public function testServiceSelectionWorksWhenItIsPrecededByMultipleParameters() { |
||
159 | |||
160 | public function testDimensionDefaultsAsInteger() { |
||
174 | |||
175 | // TODO: need DI to test |
||
176 | // public function testWhenLocationHasVisitedIconModifier_itIsUsed() { |
||
177 | // $this->assertContains( |
||
178 | // '"visitedicon":"VisitedIcon.png"', |
||
179 | // $this->parse( '{{#display_map:1,1~title~text~icon~group~inline label~VisitedIcon.png}}' ) |
||
180 | // ); |
||
181 | // } |
||
182 | // |
||
183 | // public function testWhenLocationHasVisitedIconModifierWithNamespacePrefix_thePrefixGetsRemoved() { |
||
184 | // $this->assertContains(MapsMapperTest |
||
185 | // '"visitedicon":"VisitedIcon.png"', |
||
186 | // $this->parse( '{{#display_map:1,1~title~text~icon~group~inline label~File:VisitedIcon.png}}' ) |
||
187 | // ); |
||
188 | // } |
||
189 | // |
||
190 | // public function testWhenVisitedIconParameterIsProvidedWithNamespacePrefix_thePrefixGetsRemoved() { |
||
191 | // $this->assertContains( |
||
192 | // '"visitedicon":"VisitedIcon.png"', |
||
193 | // $this->parse( '{{#display_map:1,1|visitedicon=File:VisitedIcon.png}}' ) |
||
194 | // ); |
||
195 | // } |
||
196 | // |
||
197 | // public function testWhenLocationHasIconModifierWithNamespacePrefix_thePrefixGetsRemoved() { |
||
198 | // $this->assertContains( |
||
199 | // '"icon":"Icon.png"', |
||
200 | // $this->parse( '{{#display_map:1,1~title~text~File:Icon.png}}' ) |
||
201 | // ); |
||
202 | // } |
||
203 | |||
204 | public function testWhenIconParameterIsProvidedButEmpty_itIsDefaulted() { |
||
212 | |||
213 | public function testWhenLocationHasNoTitleAndText_textFieldIsEmptyString() { |
||
219 | |||
220 | } |