Completed
Branch AUTOMATED_TESTING (09d9f2)
by Gordon
13:24
created

GoogleStreetViewShortCodeTest::testNoHeading()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4286
cc 1
eloc 5
nc 1
nop 0
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);
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<GoogleStreetViewShortCodeTest>.

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.

Loading history...
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);
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<GoogleStreetViewShortCodeTest>.

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.

Loading history...
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);
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<GoogleStreetViewShortCodeTest>.

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.

Loading history...
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);
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<GoogleStreetViewShortCodeTest>.

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.

Loading history...
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);
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<GoogleStreetViewShortCodeTest>.

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.

Loading history...
58
	}
59
}
60