@@ 10-24 (lines=15) @@ | ||
7 | { |
|
8 | protected static $fixture_file = 'mappable/tests/shortcodes.yml'; |
|
9 | ||
10 | public function testRoadMap() |
|
11 | { |
|
12 | GoogleMapShortCodeHandler::resetCounter(); |
|
13 | $page = $this->objFromFixture('Page', 'RoadMap'); |
|
14 | $html = ShortcodeParser::get_active()->parse($page->Content); |
|
15 | $expected = <<<TEXT |
|
16 | Some text |
|
17 | ||
18 | <div class="googlemapcontainer"> |
|
19 | <div id="google_sc_map_1" class="map googlemap" data-shortcode-map="" data-latitude="13.7402946" data-longitude="100.5525439" data-zoom="14" data-maptype="road" data-allowfullscreen="1"></div> |
|
20 | <p class="caption">Roads in Central Bangkok</p> |
|
21 | </div> |
|
22 | ||
23 | TEXT; |
|
24 | $this->assertEquals($expected, $html); |
|
25 | } |
|
26 | ||
27 | public function testAerialMap() |
|
@@ 27-41 (lines=15) @@ | ||
24 | $this->assertEquals($expected, $html); |
|
25 | } |
|
26 | ||
27 | public function testAerialMap() |
|
28 | { |
|
29 | GoogleMapShortCodeHandler::resetCounter(); |
|
30 | $page = $this->objFromFixture('Page', 'AerialMap'); |
|
31 | $html = ShortcodeParser::get_active()->parse($page->Content); |
|
32 | $expected = <<<TEXT |
|
33 | Some text |
|
34 | ||
35 | <div class="googlemapcontainer"> |
|
36 | <div id="google_sc_map_1" class="map googlemap" data-shortcode-map="" data-latitude="13.815483" data-longitude="100.5447213" data-zoom="20" data-maptype="aerial" data-allowfullscreen="1"></div> |
|
37 | <p class="caption">Bang Sue Train Depot, Thailand</p> |
|
38 | </div> |
|
39 | ||
40 | TEXT; |
|
41 | $this->assertEquals($expected, $html); |
|
42 | } |
|
43 | ||
44 | public function testHybridMap() |
|
@@ 44-58 (lines=15) @@ | ||
41 | $this->assertEquals($expected, $html); |
|
42 | } |
|
43 | ||
44 | public function testHybridMap() |
|
45 | { |
|
46 | GoogleMapShortCodeHandler::resetCounter(); |
|
47 | $page = $this->objFromFixture('Page', 'HybridMap'); |
|
48 | $html = ShortcodeParser::get_active()->parse($page->Content); |
|
49 | $expected = <<<TEXT |
|
50 | Some text |
|
51 | ||
52 | <div class="googlemapcontainer"> |
|
53 | <div id="google_sc_map_1" class="map googlemap" data-shortcode-map="" data-latitude="13.8309545" data-longitude="100.5577219" data-zoom="18" data-maptype="hybrid" data-allowfullscreen="1"></div> |
|
54 | <p class="caption">Junction in Bangkok, Thailand</p> |
|
55 | </div> |
|
56 | ||
57 | TEXT; |
|
58 | $this->assertEquals($expected, $html); |
|
59 | } |
|
60 | ||
61 | public function testTerrainmap() |
|
@@ 61-75 (lines=15) @@ | ||
58 | $this->assertEquals($expected, $html); |
|
59 | } |
|
60 | ||
61 | public function testTerrainmap() |
|
62 | { |
|
63 | GoogleMapShortCodeHandler::resetCounter(); |
|
64 | $page = $this->objFromFixture('Page', 'TerrainMap'); |
|
65 | $html = ShortcodeParser::get_active()->parse($page->Content); |
|
66 | $expected = <<<TEXT |
|
67 | Some text |
|
68 | ||
69 | <div class="googlemapcontainer"> |
|
70 | <div id="google_sc_map_1" class="map googlemap" data-shortcode-map="" data-latitude="18.8032393" data-longitude="98.9166518" data-zoom="14" data-maptype="terrain" data-allowfullscreen="1"></div> |
|
71 | <p class="caption">Mountains west of Chiang Mai</p> |
|
72 | </div> |
|
73 | ||
74 | TEXT; |
|
75 | $this->assertEquals($expected, $html); |
|
76 | } |
|
77 | ||
78 | public function testNoLongitude() |
@@ 7-21 (lines=15) @@ | ||
4 | { |
|
5 | protected static $fixture_file = 'mappable/tests/shortcodes.yml'; |
|
6 | ||
7 | public function testRoadMap() |
|
8 | { |
|
9 | GoogleStreetViewShortCodeHandler::resetCounter(); |
|
10 | $page = $this->objFromFixture('Page', 'StreetView'); |
|
11 | $html = ShortcodeParser::get_active()->parse($page->Content); |
|
12 | $expected = <<<TEXT |
|
13 | Some text |
|
14 | ||
15 | <div class="streetviewcontainer"> |
|
16 | <div id="google_streetview_1" class="streetview googlestreetview" data-streetview="" data-latitude="13.811841" data-longitude="100.527309" data-zoom="1" data-pitch="-10" data-heading="162.43"></div> |
|
17 | <p class="caption">Canal south from Pracha Rat 1 Soi 28</p> |
|
18 | </div> |
|
19 | ||
20 | TEXT; |
|
21 | $this->assertEquals($expected, $html); |
|
22 | } |
|
23 | ||
24 | public function testNoLongitude() |
|
@@ 24-29 (lines=6) @@ | ||
21 | $this->assertEquals($expected, $html); |
|
22 | } |
|
23 | ||
24 | public function testNoLongitude() |
|
25 | { |
|
26 | GoogleStreetViewShortCodeHandler::resetCounter(); |
|
27 | $page = $this->objFromFixture('Page', 'StreetViewNoLongitude'); |
|
28 | $html = ShortcodeParser::get_active()->parse($page->Content); |
|
29 | $this->assertEquals('Some text', $html); |
|
30 | } |
|
31 | ||
32 | public function testNoLatitude() |
|
@@ 32-37 (lines=6) @@ | ||
29 | $this->assertEquals('Some text', $html); |
|
30 | } |
|
31 | ||
32 | public function testNoLatitude() |
|
33 | { |
|
34 | GoogleStreetViewShortCodeHandler::resetCounter(); |
|
35 | $page = $this->objFromFixture('Page', 'StreetViewNoLatitude'); |
|
36 | $html = ShortcodeParser::get_active()->parse($page->Content); |
|
37 | $this->assertEquals('Some text', $html); |
|
38 | } |
|
39 | ||
40 | public function testNoHeading() |
|
@@ 40-45 (lines=6) @@ | ||
37 | $this->assertEquals('Some text', $html); |
|
38 | } |
|
39 | ||
40 | public function testNoHeading() |
|
41 | { |
|
42 | GoogleStreetViewShortCodeHandler::resetCounter(); |
|
43 | $page = $this->objFromFixture('Page', 'StreetViewNoHeading'); |
|
44 | $html = ShortcodeParser::get_active()->parse($page->Content); |
|
45 | $this->assertEquals('Some text', $html); |
|
46 | } |
|
47 | ||
48 | public function testZoom() |
|
@@ 48-62 (lines=15) @@ | ||
45 | $this->assertEquals('Some text', $html); |
|
46 | } |
|
47 | ||
48 | public function testZoom() |
|
49 | { |
|
50 | GoogleStreetViewShortCodeHandler::resetCounter(); |
|
51 | $page = $this->objFromFixture('Page', 'StreetViewWithZoom'); |
|
52 | $html = ShortcodeParser::get_active()->parse($page->Content); |
|
53 | $expected = <<< TEXT |
|
54 | Some text |
|
55 | ||
56 | <div class="streetviewcontainer"> |
|
57 | <div id="google_streetview_1" class="streetview googlestreetview" data-streetview="" data-latitude="13.811841" data-longitude="100.527309" data-zoom="12" data-pitch="-10" data-heading="162.43"></div> |
|
58 | <p class="caption">Canal south from Pracha Rat 1 Soi 28</p> |
|
59 | </div> |
|
60 | ||
61 | TEXT; |
|
62 | $this->assertEquals($expected, $html); |
|
63 | } |
|
64 | } |
|
65 |