@@ -29,17 +29,26 @@ public function testFromArray()
2929 'east ' => 0.1
3030 ),
3131 'city ' => 'FOo CITY ' ,
32+ 'cityDistrict ' => 'fOo city District ' ,
33+ 'streetName ' => 'foo bar street ' ,
3234 'zipcode ' => '65943 ' ,
3335 'region ' => 'FOO region ' ,
36+ 'county ' => 'foo county ' ,
37+ 'countyCode ' => 'foo ' ,
3438 'regionCode ' => 'FOO ' ,
3539 'country ' => 'FOO Country ' ,
40+ 'countryCode ' => 'foo ' ,
3641 'timezone ' => 'FOO/Timezone '
3742 );
3843
3944 $ this ->geocoded ->fromArray ($ array );
4045
46+ $ coordinates = $ this ->geocoded ->getCoordinates ();
4147 $ bounds = $ this ->geocoded ->getBounds ();
4248
49+ $ this ->assertTrue (is_array ($ coordinates ));
50+ $ this ->assertEquals (0.001 , $ coordinates [0 ]);
51+ $ this ->assertEquals (1 , $ coordinates [1 ]);
4352 $ this ->assertEquals (0.001 , $ this ->geocoded ->getLatitude ());
4453 $ this ->assertEquals (1 , $ this ->geocoded ->getLongitude ());
4554 $ this ->assertArrayHasKey ('south ' , $ bounds );
@@ -51,9 +60,14 @@ public function testFromArray()
5160 $ this ->assertEquals (3 , $ bounds ['north ' ]);
5261 $ this ->assertEquals (0.1 , $ bounds ['east ' ]);
5362 $ this ->assertEquals ('Foo City ' , $ this ->geocoded ->getCity ());
63+ $ this ->assertEquals ('Foo City District ' , $ this ->geocoded ->getCityDistrict ());
64+ $ this ->assertEquals ('Foo Bar Street ' , $ this ->geocoded ->getStreetName ());
5465 $ this ->assertEquals ('65943 ' , $ this ->geocoded ->getZipcode ());
5566 $ this ->assertEquals ('Foo Region ' , $ this ->geocoded ->getRegion ());
67+ $ this ->assertEquals ('Foo County ' , $ this ->geocoded ->getCounty ());
68+ $ this ->assertEquals ('FOO ' , $ this ->geocoded ->getCountyCode ());
5669 $ this ->assertEquals ('Foo Country ' , $ this ->geocoded ->getCountry ());
70+ $ this ->assertEquals ('FOO ' , $ this ->geocoded ->getCountryCode ());
5771 $ this ->assertEquals ('FOO/Timezone ' , $ this ->geocoded ->getTimezone ());
5872 $ this ->assertEquals ('FOO ' , $ this ->geocoded ->getRegionCode ());
5973 }
@@ -235,4 +249,24 @@ public function testFromArrayWithLettersInStreetNumber()
235249 $ this ->geocoded ->fromArray ($ array );
236250 $ this ->assertEquals ('1A ' , $ this ->geocoded ->getStreetNumber ());
237251 }
252+
253+ public function testLowerizeViaReflection ()
254+ {
255+ $ method = new \ReflectionMethod (
256+ $ this ->geocoded , 'lowerize '
257+ );
258+ $ method ->setAccessible (true );
259+
260+ $ this ->assertEquals ('foo ' , $ method ->invoke ($ this ->geocoded , 'FOO ' ));
261+ }
262+
263+ public function testUpperizeViaReflection ()
264+ {
265+ $ method = new \ReflectionMethod (
266+ $ this ->geocoded , 'upperize '
267+ );
268+ $ method ->setAccessible (true );
269+
270+ $ this ->assertEquals ('FOO ' , $ method ->invoke ($ this ->geocoded , 'foo ' ));
271+ }
238272}
0 commit comments