Skip to content

🚧 Update For Laravel 6 #156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:37:"PHPUnit\Runner\DefaultTestResultCache":2941:{a:2:{s:7:"defects";a:2:{s:94:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItReverseGeocodesCoordinates";i:4;s:77:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testCacheIsUsed";i:4;}s:5:"times";a:26:{s:94:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItReverseGeocodesCoordinates";d:0.296;s:89:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItResolvesAGivenAddress";d:0.222;s:91:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItResolvesAGivenIPAddress";d:0.01;s:100:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItResolvesAGivenAddressWithUmlauts";d:0.216;s:108:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItResolvesAGivenAddressWithUmlautsInRegion";d:0.21;s:91:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItCanUseASpecificProvider";d:0.187;s:83:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItDumpsAndAddress";d:0.214;s:101:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItThrowsAnExceptionForInvalidDumper";d:0.207;s:72:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testConfig";d:0.008;s:81:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testLoadedProviders";d:0.01;s:74:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testGeocoder";d:0.009;s:77:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testCacheIsUsed";d:0.247;s:93:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testGeocodeQueryProvidesResults";d:0.262;s:93:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testReverseQueryProvidesResults";d:0.391;s:87:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testFacadeProvidesResults";d:0.215;s:102:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItCanUseMaxMindBinaryWithoutProvider";d:0.008;s:86:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testGetNameReturnsString";d:0.007;s:83:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testLimitingOfResults";d:0.804;s:84:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testFetchingAllResults";d:0.231;s:78:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testGetProviders";d:0.007;s:77:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testGetProvider";d:0.007;s:92:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testJapaneseCharacterGeocoding";d:0.461;s:81:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItProvidesState";d:0.218;s:86:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItProvidesAdminLevel";d:0.201;s:91:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testItHandlesOnlyCityAndState";d:0.788;s:90:"Geocoder\Laravel\Tests\Feature\Providers\GeocoderServiceTest::testEmptyResultsAreNotCached";d:0.586;}}}
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"geocoder-php/google-maps-provider": "^4.0",
"guzzlehttp/psr7": "*",
"http-interop/http-factory-guzzle": "^1.0",
"illuminate/cache": "5.0 - 5.8",
"illuminate/support": "5.0 - 5.8",
"illuminate/cache": "5.0 - 6.0",
"illuminate/support": "5.0 - 6.0",
"php-http/curl-client": "*",
"php": ">=7.1.3",
"willdurand/geocoder": "^4.0"
Expand All @@ -41,12 +41,11 @@
"geocoder-php/geoip2-provider": "^4.0",
"geocoder-php/maxmind-binary-provider": "^4.0",
"mockery/mockery": "*",
"orchestra/testbench-browser-kit": "3.8.*",
"orchestra/database": "3.8.x-dev@dev",
"orchestra/testbench-dusk": "3.8.x-dev@dev",
"orchestra/testbench": "3.8.*",
"orchestra/testbench-browser-kit": "3.9.x-dev@dev",
"orchestra/testbench-dusk": "3.9.x-dev@dev",
"orchestra/testbench": "3.9.x-dev@dev",
"php-coveralls/php-coveralls": "*",
"phpunit/phpunit": "^7.5",
"phpunit/phpunit": "8.*",
"sebastian/phpcpd": "*"
},
"autoload": {
Expand All @@ -67,6 +66,7 @@
]
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"preferred-install": "dist",
Expand Down
2 changes: 0 additions & 2 deletions tests/CreatesApplication.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php namespace Geocoder\Laravel\Tests;

use Orchestra\Database\ConsoleServiceProvider;
use Geocoder\Laravel\Providers\GeocoderService;

trait CreatesApplication
Expand All @@ -20,7 +19,6 @@ protected function getPackageProviders($app)
{
return [
GeocoderService::class,
ConsoleServiceProvider::class,
];
}

Expand Down
9 changes: 5 additions & 4 deletions tests/Feature/Providers/GeocoderServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Geocoder\Query\ReverseQuery;
use Http\Client\Curl\Client as CurlAdapter;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Expand All @@ -30,7 +31,7 @@ public function testItReverseGeocodesCoordinates()
->reverse(38.897957, -77.036560)
->get()
->filter(function (GoogleAddress $address) {
return str_contains($address->getStreetName() ?? '', 'Northwest');
return Str::contains($address->getStreetName() ?? '', 'Northwest');
})
->first();

Expand Down Expand Up @@ -159,7 +160,7 @@ public function testGeocoder()

public function testCacheIsUsed()
{
$cacheKey = sha1(str_slug(strtolower(urlencode('1600 Pennsylvania Ave NW, Washington, DC 20500, USA'))));
$cacheKey = sha1(Str::slug(strtolower(urlencode('1600 Pennsylvania Ave NW, Washington, DC 20500, USA'))));

$result = app('geocoder')
->geocode('1600 Pennsylvania Ave NW, Washington, DC 20500, USA')
Expand Down Expand Up @@ -270,7 +271,7 @@ public function testGetProvider()

public function testJapaneseCharacterGeocoding()
{
$cacheKey = sha1(str_slug(strtolower(urlencode('108-0075 東京都港区港南2丁目16-3'))));
$cacheKey = sha1(Str::slug(strtolower(urlencode('108-0075 東京都港区港南2丁目16-3'))));

app('geocoder')
->geocode('108-0075 東京都港区港南2丁目16-3')
Expand Down Expand Up @@ -310,7 +311,7 @@ public function testItHandlesOnlyCityAndState()

public function testEmptyResultsAreNotCached()
{
$cacheKey = md5(str_slug(strtolower(urlencode('_'))));
$cacheKey = md5(Str::slug(strtolower(urlencode('_'))));

Geocoder::geocode('_')->get();

Expand Down