1717use Illuminate \Support \Collection ;
1818
1919/**
20+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
21+ * @SuppressWarnings(PHPMD.TooManyMethods)
2022 * @SuppressWarnings(PHPMD.TooManyPublicMethods)
2123 */
2224class GeocoderServiceTestextends TestCase
@@ -30,12 +32,8 @@ public function setUp()
3032
3133public function testItReverseGeocodesCoordinates ()
3234 {
33- // Arrange
34-
35- // Act
3635$ results =app ('geocoder ' )->reverse (38.8791981 , -76.9818437 )->get ();
3736
38- // Assert
3937$ this ->assertEquals ('1600 ' ,$ results ->first ()->getStreetNumber ());
4038$ this ->assertEquals ('Pennsylvania Avenue Southeast ' ,$ results ->first ()->getStreetName ());
4139$ this ->assertEquals ('Washington ' ,$ results ->first ()->getLocality ());
@@ -45,15 +43,11 @@ public function testItReverseGeocodesCoordinates()
4543
4644public function testItResolvesAGivenAddress ()
4745 {
48- // Arrange
49-
50- // Act
5146$ results =app ('geocoder ' )
5247 ->using ('chain ' )
5348 ->geocode ('1600 Pennsylvania Ave., Washington, DC USA ' )
5449 ->get ();
5550
56- // Assert
5751$ this ->assertEquals ('1600 ' ,$ results ->first ()->getStreetNumber ());
5852$ this ->assertEquals ('Pennsylvania Avenue Northwest ' ,$ results ->first ()->getStreetName ());
5953$ this ->assertEquals ('Washington ' ,$ results ->first ()->getLocality ());
@@ -63,28 +57,20 @@ public function testItResolvesAGivenAddress()
6357
6458public function testItResolvesAGivenIPAddress ()
6559 {
66- // Arrange
67-
68- // Act
6960$ results =app ('geocoder ' )
7061 ->geocode ('72.229.28.185 ' )
7162 ->get ();
7263
73- // Assert
7464$ this ->assertTrue ($ results ->isNotEmpty ());
7565$ this ->assertEquals ('US ' ,$ results ->first ()->getCountry ()->getCode ());
7666 }
7767
7868public function testItResolvesAGivenAddressWithUmlauts ()
7969 {
80- // Arrange
81-
82- // Act
8370$ results =app ('geocoder ' )
8471 ->geocode ('Obere Donaustrasse 22, Wien, Österreich ' )
8572 ->get ();
8673
87- // Assert
8874$ this ->assertEquals ('22 ' ,$ results ->first ()->getStreetNumber ());
8975$ this ->assertEquals ('Obere Donaustraße ' ,$ results ->first ()->getStreetName ());
9076$ this ->assertEquals ('Wien ' ,$ results ->first ()->getLocality ());
@@ -94,19 +80,16 @@ public function testItResolvesAGivenAddressWithUmlauts()
9480
9581public function testItResolvesAGivenAddressWithUmlautsInRegion ()
9682 {
97- // Arrange
9883config ()->set ('geocoder.providers.Geocoder\Provider\Chain\Chain.Geocoder\Provider\GoogleMaps\GoogleMaps ' , [
9984'de-DE ' ,
10085null ,
10186 ]);
10287app ()->register (GeocoderService::class);
10388
104- // Act
10589$ results =app ('geocoder ' )
10690 ->geocode ('Obere Donaustrasse 22, Wien, Österreich ' )
10791 ->get ();
10892
109- // Assert
11093$ this ->assertEquals ('22 ' ,$ results ->first ()->getStreetNumber ());
11194$ this ->assertEquals ('Obere Donaustraße ' ,$ results ->first ()->getStreetName ());
11295$ this ->assertEquals ('Wien ' ,$ results ->first ()->getLocality ());