1 | <?php |
||
14 | class DisplayMapTest extends TestCase { |
||
15 | |||
16 | private $originalHeight; |
||
17 | private $originalWidth; |
||
18 | |||
19 | public function setUp(): void { |
||
23 | |||
24 | public function tearDown(): void { |
||
28 | |||
29 | public function testMapIdIsSet() { |
||
35 | |||
36 | private function parse( string $textToParse ): string { |
||
41 | |||
42 | public function testServiceSelectionWorks() { |
||
48 | |||
49 | public function testSingleCoordinatesAreIncluded() { |
||
55 | |||
56 | public function testMultipleCoordinatesAreIncluded() { |
||
62 | |||
63 | public function testWhenValidZoomIsSpecified_itGetsUsed() { |
||
69 | |||
70 | public function testWhenZoomIsNotSpecifiedAndThereIsOnlyOneLocation_itIsDefaulted() { |
||
76 | |||
77 | public function testWhenZoomIsNotSpecifiedAndThereAreMultipleLocations_itIsDefaulted() { |
||
83 | |||
84 | public function testWhenZoomIsInvalid_itIsDefaulted() { |
||
90 | |||
91 | public function testTagIsRendered() { |
||
97 | |||
98 | public function testTagServiceParameterIsUsed() { |
||
104 | |||
105 | public function testWhenThereAreNoLocations_locationsArrayIsEmpty() { |
||
111 | |||
112 | public function testLocationTitleGetsIncluded() { |
||
118 | |||
119 | public function testLocationDescriptionGetsIncluded() { |
||
125 | |||
126 | public function testRectangleDisplay() { |
||
132 | |||
133 | public function testCircleDisplay() { |
||
139 | |||
140 | public function testRectangleFillOpacityIsUsed() { |
||
146 | |||
147 | public function testRectangleFillColorIsUsed() { |
||
153 | |||
154 | public function testServiceSelectionWorksWhenItIsPrecededByMultipleParameters() { |
||
162 | |||
163 | public function testDimensionDefaultsAsInteger() { |
||
177 | |||
178 | // TODO: need DI to test |
||
179 | // public function testWhenLocationHasVisitedIconModifier_itIsUsed() { |
||
180 | // $this->assertContains( |
||
181 | // '"visitedicon":"VisitedIcon.png"', |
||
182 | // $this->parse( '{{#display_map:1,1~title~text~icon~group~inline label~VisitedIcon.png}}' ) |
||
183 | // ); |
||
184 | // } |
||
185 | // |
||
186 | // public function testWhenLocationHasVisitedIconModifierWithNamespacePrefix_thePrefixGetsRemoved() { |
||
187 | // $this->assertContains(MapsMapperTest |
||
188 | // '"visitedicon":"VisitedIcon.png"', |
||
189 | // $this->parse( '{{#display_map:1,1~title~text~icon~group~inline label~File:VisitedIcon.png}}' ) |
||
190 | // ); |
||
191 | // } |
||
192 | // |
||
193 | // public function testWhenVisitedIconParameterIsProvidedWithNamespacePrefix_thePrefixGetsRemoved() { |
||
194 | // $this->assertContains( |
||
195 | // '"visitedicon":"VisitedIcon.png"', |
||
196 | // $this->parse( '{{#display_map:1,1|visitedicon=File:VisitedIcon.png}}' ) |
||
197 | // ); |
||
198 | // } |
||
199 | // |
||
200 | // public function testWhenLocationHasIconModifierWithNamespacePrefix_thePrefixGetsRemoved() { |
||
201 | // $this->assertContains( |
||
202 | // '"icon":"Icon.png"', |
||
203 | // $this->parse( '{{#display_map:1,1~title~text~File:Icon.png}}' ) |
||
204 | // ); |
||
205 | // } |
||
206 | |||
207 | public function testWhenIconParameterIsProvidedButEmpty_itIsDefaulted() { |
||
215 | |||
216 | public function testWhenLocationHasNoTitleAndText_textFieldIsEmptyString() { |
||
222 | |||
223 | public function testGeoJsonSourceForFile() { |
||
233 | |||
234 | private function skipOn131() { |
||
239 | |||
240 | public function testGeoJsonSourceForPage() { |
||
259 | |||
260 | public function testGoogleMapsKmlFiltersInvalidFileNames() { |
||
268 | |||
269 | public function testLeafletImageLayersIgnoresNotFoundImages() { |
||
277 | |||
278 | public function testLeafletImageLayersIgnoresImageUrls() { |
||
286 | |||
287 | } |
||
288 |