Completed
Push — AUTOMATED_TESTING ( 9cc382...c62760 )
by Gordon
12:06
created
code/MapUtil.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -226,8 +226,9 @@
 block discarded – undo
226 226
 		$gmap = self::instance();
227 227
 		if ($list) {
228 228
 			foreach ($list as $mappable) {
229
-				if (self::ChooseToAddDataobject($mappable))
230
-					$gmap->addMarkerAsObject($mappable, $infowindowtemplateparams);
229
+				if (self::ChooseToAddDataobject($mappable)) {
230
+									$gmap->addMarkerAsObject($mappable, $infowindowtemplateparams);
231
+				}
231 232
 			}
232 233
 		}
233 234
 		return $gmap;
Please login to merge, or discard this patch.
code/MappableData.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 		}
81 81
 
82 82
 		//https://maps.googleapis.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&key=YOUR_API_KEY
83
-			    //maps.googleapis.com/maps/api/staticmap';
83
+				//maps.googleapis.com/maps/api/staticmap';
84 84
 
85 85
 		$apiurl = Config::inst()->get('MappableData', 'staticmap_api_url');
86 86
 
Please login to merge, or discard this patch.
tests/MapUtilTest.php 2 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@
 block discarded – undo
25 25
 
26 26
 	public function test_set_api_key_host_array() {
27 27
 		$url = Director::absoluteBaseURL();
28
-        // remove http and https
29
-        $url = str_replace('http://', '', $url);
30
-        $url = str_replace('https://', '', $url);
31
-        $parts = explode('/', $url);
32
-        $host = $parts[0];
28
+		// remove http and https
29
+		$url = str_replace('http://', '', $url);
30
+		$url = str_replace('https://', '', $url);
31
+		$parts = explode('/', $url);
32
+		$host = $parts[0];
33 33
 		$key = array($host => 'PRETENDAPIKEY');
34 34
 		MapUtil::set_api_key($key);
35 35
 		$html = $this->htmlForMap();
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@
 block discarded – undo
124 124
 	}
125 125
 
126 126
 	 public function test_set_icon_size() {
127
-	 	MapUtil::set_icon_size(14,37);
127
+	 	MapUtil::set_icon_size(14, 37);
128 128
 	 	$html = $this->htmlForMap();
129 129
 	 	$html = $this->htmlForMap();
130 130
 	 	echo $html;
Please login to merge, or discard this patch.
tests/MappableDataTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 		$instance = $this->getInstance();
21 21
 		$vals = array('TestKey' => 'TestVal');
22 22
 		$instance->setMarkerTemplateValues($vals);
23
-		$html = $instance->getRenderableMap(300,800,2)->forTemplate();
24
-		$expected =  '';
23
+		$html = $instance->getRenderableMap(300, 800, 2)->forTemplate();
24
+		$expected = '';
25 25
 		$this->assertEquals($expected, $html);
26 26
 	}
27 27
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 		$instance = $this->getInstance();
32 32
 		$instance->Lat = 13.84;
33 33
 		$instance->Lon = 100.52;
34
-		$html = $instance->StaticMap(300,800);
34
+		$html = $instance->StaticMap(300, 800);
35 35
 		$expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center='
36 36
 				  . '13.84%2C100.52&amp;markers=13.84%2C100.52'
37 37
 				  . '&amp;zoom=13&amp;size=300x800&amp;sensor=false&amp;mapt'
@@ -43,14 +43,14 @@  discard block
 block discarded – undo
43 43
 		$instance = $this->getInstance();
44 44
 		$instance->Lat = 13.8188931;
45 45
 		$instance->Lon = 100.5005558;
46
-		$html = $instance->StaticMap(300,800);
46
+		$html = $instance->StaticMap(300, 800);
47 47
 		$expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center='
48 48
 				  . '13.8188931%2C100.5005558&amp;markers=13.8188931%2C100.5005'
49 49
 				  . '558&amp;zoom=13&amp;size=300x800&amp;sensor=false&amp;mapt'
50 50
 				  . 'ype=roadmap" width="300" height="800" alt="" />';
51 51
 		$this->assertEquals($expected, $html);
52 52
 
53
-		$html = $instance->StaticMap(310,810);
53
+		$html = $instance->StaticMap(310, 810);
54 54
 		$expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center='
55 55
 				  . '13.8188931%2C100.5005558&amp;markers=13.8188931%2C100.5005'
56 56
 				  . '558&amp;zoom=13&amp;size=310x810&amp;sensor=false&amp;mapt'
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
 		$instance = $this->getInstance();
64 64
 		$instance->Lat = 13.8188931;
65 65
 		$instance->Lon = 100.5005558;
66
-		$html = $instance->StaticMap(300,800,  null, 'satellite');
66
+		$html = $instance->StaticMap(300, 800, null, 'satellite');
67 67
 		$expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center='
68 68
 				  . '13.8188931%2C100.5005558&amp;markers=13.8188931%2C100.5005'
69 69
 				  . '558&amp;zoom=13&amp;size=300x800&amp;sensor=false&amp;mapt'
70 70
 				  . 'ype=satellite" width="300" height="800" alt="" />';
71 71
 		$this->assertEquals($expected, $html);
72 72
 
73
-		$html = $instance->StaticMap(300,800,null, 'terrain');
73
+		$html = $instance->StaticMap(300, 800, null, 'terrain');
74 74
 		$expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center='
75 75
 				  . '13.8188931%2C100.5005558&amp;markers=13.8188931%2C100.5005'
76 76
 				  . '558&amp;zoom=13&amp;size=300x800&amp;sensor=false&amp;mapt'
77 77
 				  . 'ype=terrain" width="300" height="800" alt="" />';
78 78
 
79
-		$html = $instance->StaticMap(300,800,null, 'hybrid');
79
+		$html = $instance->StaticMap(300, 800, null, 'hybrid');
80 80
 		$expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center='
81 81
 				  . '13.8188931%2C100.5005558&amp;markers=13.8188931%2C100.5005'
82 82
 				  . '558&amp;zoom=13&amp;size=300x800&amp;sensor=false&amp;mapt'
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
 	public function testStaticMapVaryZoom() {
89 89
 		$instance = $this->getInstance();
90 90
 
91
-		$html = $instance->StaticMap(300,800,2);
91
+		$html = $instance->StaticMap(300, 800, 2);
92 92
 		$expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center='
93 93
 				  . '13.8188931%2C100.5005558&amp;markers=13.8188931%2C100.5005'
94 94
 				  . '558&amp;zoom=2&amp;size=300x800&amp;sensor=false&amp;mapt'
95 95
 				  . 'ype=roadmap" width="300" height="800" alt="" />';
96 96
 		$this->assertEquals($expected, $html);
97 97
 
98
-		$html = $instance->StaticMap(300,800,12);
98
+		$html = $instance->StaticMap(300, 800, 12);
99 99
 		$expected = '<img src="//maps.googleapis.com/maps/api/staticmap?center='
100 100
 				  . '13.8188931%2C100.5005558&amp;markers=13.8188931%2C100.5005'
101 101
 				  . '558&amp;zoom=12&amp;size=300x800&amp;sensor=false&amp;mapt'
Please login to merge, or discard this patch.