1010 */
1111class GoogleMapHelperTest extends TestCase {
1212
13+ /**
14+ * @return void
15+ */
1316 public function setUp () {
1417 parent ::setUp ();
1518
@@ -19,13 +22,22 @@ public function setUp() {
1922 $ this ->GoogleMap = new GoogleMapHelper ($ this ->View );
2023 }
2124
22- public function testObject () {
23- $ this ->assertInstanceOf ('Geo\View\Helper\GoogleMapHelper ' , $ this ->GoogleMap );
25+ /**
26+ * @return void
27+ */
28+ public function testConfigMergeDefaults () {
29+ $ config = [
30+ 'zoom ' => 2 ,
31+ 'type ' => 'foo '
32+ ];
33+ $ this ->GoogleMap = new GoogleMapHelper ($ this ->View , $ config );
34+
35+ $ result = $ this ->GoogleMap ->config ();
36+ $ this ->assertEquals ('foo ' , $ result ['map ' ]['type ' ]);
37+ $ this ->assertEquals (2 , $ result ['map ' ]['zoom ' ]);
2438 }
2539
2640 /**
27- * GoogleMapHelperTest::testConfigMerge()
28- *
2941 * @return void
3042 */
3143 public function testConfigMerge () {
@@ -42,6 +54,9 @@ public function testConfigMerge() {
4254 $ this ->assertEquals (8 , $ result ['map ' ]['zoom ' ]);
4355 }
4456
57+ /**
58+ * @return void
59+ */
4560 public function testMapUrl () {
4661 $ url = $ this ->GoogleMap ->mapUrl (['to ' => 'Munich, Germany ' ]);
4762 $ this ->assertEquals ('http://maps.google.com/maps?daddr=Munich%2C+Germany ' , $ url );
@@ -50,13 +65,19 @@ public function testMapUrl() {
5065 $ this ->assertEquals ('http://maps.google.com/maps?daddr=%3CM%C3%BCnchen%3E%2C+Germany ' , $ url );
5166 }
5267
68+ /**
69+ * @return void
70+ */
5371 public function testMapLink () {
5472 $ result = $ this ->GoogleMap ->mapLink ('<To Munich>! ' , ['to ' => '<Munich>, Germany ' ]);
5573 $ expected = '<a href="http://maps.google.com/maps?daddr=%3CMunich%3E%2C+Germany"><To Munich>!</a> ' ;
5674 //echo $result;
5775 $ this ->assertEquals ($ expected , $ result );
5876 }
5977
78+ /**
79+ * @return void
80+ */
6081 public function testLinkWithMapUrl () {
6182 $ url = $ this ->GoogleMap ->mapUrl (['to ' => '<München>, Germany ' ]);
6283 $ result = $ this ->GoogleMap ->Html ->link ('Some title ' , $ url );
@@ -65,6 +86,9 @@ public function testLinkWithMapUrl() {
6586 $ this ->assertEquals ($ expected , $ result );
6687 }
6788
89+ /**
90+ * @return void
91+ */
6892 public function testStaticPaths () {
6993 $ m = [
7094 [
@@ -82,18 +106,18 @@ public function testStaticPaths() {
82106 ];
83107
84108 $ is = $ this ->GoogleMap ->staticPaths ($ m );
85- //echo pr(h($is));
86109
87110 $ options = [
88111 'paths ' => $ is
89112 ];
90113 $ is = $ this ->GoogleMap ->staticMapLink ('My Title ' , $ options );
91- //echo h($is).BR.BR;
92114
93115 $ is = $ this ->GoogleMap ->staticMap ($ options );
94- //echo $is;
95116 }
96117
118+ /**
119+ * @return void
120+ */
97121 public function testStaticMarkers () {
98122 $ m = $ this ->markerElements = [
99123 [
@@ -117,6 +141,9 @@ public function testStaticMarkers() {
117141// http://maps.google.com/staticmap?size=500x500&maptype=hybrid&markers=color:red|label:S|48.3,11.2&sensor=false
118142// http://maps.google.com/maps/api/staticmap?size=512x512&maptype=roadmap&markers=color:blue|label:S|40.702147,-74.015794&markers=color:green|label:G|40.711614,-74.012318&markers=color:red|color:red|label:C|40.718217,-73.998284&sensor=false
119143
144+ /**
145+ * @return void
146+ */
120147 public function testStatic () {
121148 //echo '<h2>StaticMap</h2>';
122149 $ m = [
@@ -193,6 +220,9 @@ public function testStatic() {
193220 //echo $link;
194221 }
195222
223+ /**
224+ * @return void
225+ */
196226 public function testStaticMapWithStaticMapLink () {
197227 //echo '<h2>testStaticMapWithStaticMapLink</h2>';
198228 $ markers = [];
@@ -203,6 +233,9 @@ public function testStaticMapWithStaticMapLink() {
203233 //echo $this->GoogleMap->Html->link('Open Static Map', $staticMapUrl, array('class'=>'staticMap', 'title'=>__d('tools', 'click for full map'))); //, 'escape'=>false
204234 }
205235
236+ /**
237+ * @return void
238+ */
206239 public function testMarkerIcons () {
207240 $ tests = [
208241 ['green ' , null ],
@@ -352,6 +385,9 @@ public function testDynamic2() {
352385 //echo '<a href="javascript:void(0)" class="mapAnchor" rel="m3">Marker3</a>';
353386 }
354387
388+ /**
389+ * @return void
390+ */
355391 public function testDynamic3 () {
356392 //echo '<h2>Map with Directions</h2>';
357393 $ options = [
0 commit comments