1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
class GoogleStreetViewShortCodeTest extends SapphireTest |
4
|
|
|
{ |
5
|
|
|
protected static $fixture_file = 'mappable/tests/shortcodes.yml'; |
6
|
|
|
|
7
|
|
|
public function testRoadMap() { |
8
|
|
|
GoogleStreetViewShortCodeHandler::resetCounter(); |
9
|
|
|
$page = $this->objFromFixture('Page', 'StreetView'); |
10
|
|
|
$html = ShortcodeParser::get_active()->parse($page->Content); |
11
|
|
|
$expected = <<<TEXT |
12
|
|
|
Some text |
13
|
|
|
|
14
|
|
|
<div class="streetviewcontainer"> |
15
|
|
|
<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> |
16
|
|
|
<p class="caption">Canal south from Pracha Rat 1 Soi 28</p> |
17
|
|
|
</div> |
18
|
|
|
|
19
|
|
|
TEXT; |
20
|
|
|
$this->assertEquals($expected, $html); |
|
|
|
|
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function testNoLongitude() { |
24
|
|
|
GoogleStreetViewShortCodeHandler::resetCounter(); |
25
|
|
|
$page = $this->objFromFixture('Page', 'StreetViewNoLongitude'); |
26
|
|
|
$html = ShortcodeParser::get_active()->parse($page->Content); |
27
|
|
|
$this->assertEquals('Some text', $html); |
|
|
|
|
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
public function testNoLatitude() { |
31
|
|
|
GoogleStreetViewShortCodeHandler::resetCounter(); |
32
|
|
|
$page = $this->objFromFixture('Page', 'StreetViewNoLatitude'); |
33
|
|
|
$html = ShortcodeParser::get_active()->parse($page->Content); |
34
|
|
|
$this->assertEquals('Some text', $html); |
|
|
|
|
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
public function testNoHeading() { |
38
|
|
|
GoogleStreetViewShortCodeHandler::resetCounter(); |
39
|
|
|
$page = $this->objFromFixture('Page', 'StreetViewNoHeading'); |
40
|
|
|
$html = ShortcodeParser::get_active()->parse($page->Content); |
41
|
|
|
$this->assertEquals('Some text', $html); |
|
|
|
|
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public function testZoom() { |
45
|
|
|
GoogleStreetViewShortCodeHandler::resetCounter(); |
46
|
|
|
$page = $this->objFromFixture('Page', 'StreetViewWithZoom'); |
47
|
|
|
$html = ShortcodeParser::get_active()->parse($page->Content); |
48
|
|
|
$expected = <<< TEXT |
49
|
|
|
Some text |
50
|
|
|
|
51
|
|
|
<div class="streetviewcontainer"> |
52
|
|
|
<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> |
53
|
|
|
<p class="caption">Canal south from Pracha Rat 1 Soi 28</p> |
54
|
|
|
</div> |
55
|
|
|
|
56
|
|
|
TEXT; |
57
|
|
|
$this->assertEquals($expected, $html); |
|
|
|
|
58
|
|
|
} |
59
|
|
|
} |
60
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.