Skip to content

Commit e97a21e

Browse files
committed
Update tests to Laravel 5.5
1 parent b424b36 commit e97a21e

File tree

6 files changed

+40
-32
lines changed

6 files changed

+40
-32
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"fzaninotto/faker": "~1.4",
3939
"geocoder-php/bing-maps-provider": "^4.0",
4040
"geocoder-php/maxmind-binary-provider": "^4.0",
41-
"laravel/laravel": "5.4.*",
41+
"laravel/laravel": "5.5.*",
4242
"mockery/mockery": "0.9.*",
4343
"phpunit/phpunit": "~5.0",
4444
"satooshi/php-coveralls" : "dev-master@dev",

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
>
1313
<testsuites>
1414
<testsuite name="Geocoder library for Laravel Test Suite">
15-
<directory suffix="Test.php">./tests/Laravel5_3</directory>
15+
<directory suffix="Test.php">./tests/Laravel5_5</directory>
1616
</testsuite>
1717
</testsuites>
1818
<filter>

tests/Laravel5_3/TestCase.php

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php namespace Geocoder\Laravel\Tests\Laravel5_5;
2+
3+
use Illuminate\Contracts\Console\Kernel;
4+
use Illuminate\Foundation\Application;
5+
6+
trait CreatesApplication
7+
{
8+
public function createApplication()
9+
{
10+
$app = require __DIR__ . '/../../vendor/laravel/laravel/bootstrap/app.php';
11+
$app->make(Kernel::class)->bootstrap();
12+
config([
13+
'geocoder' => include(__DIR__ . '/../assets/testConfig.php'),
14+
]);
15+
16+
return $app;
17+
}
18+
}

tests/Laravel5_3/Providers/GeocoderServiceTest.php renamed to tests/Laravel5_5/Providers/GeocoderServiceTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<?php namespace Geocoder\Laravel\Tests\Laravel5_3\Providers;
1+
<?php namespace Geocoder\Laravel\Tests\Laravel5_5\Providers;
22

33
use Geocoder\Exception\FunctionNotFound;
4-
use Geocoder\Laravel\Tests\Laravel5_3\TestCase;
4+
use Geocoder\Laravel\Tests\Laravel5_5\TestCase;
55
use Geocoder\Laravel\Exceptions\InvalidDumperException;
66
use Geocoder\Laravel\Facades\Geocoder;
77
use Geocoder\Laravel\ProviderAndDumperAggregator;
@@ -268,6 +268,13 @@ public function testGetProviders()
268268
$this->assertTrue($providers->has('google_maps'));
269269
}
270270

271+
public function testGetProvider()
272+
{
273+
$provider = app('geocoder')->getProvider();
274+
275+
$this->assertEquals($provider->getName(), 'chain');
276+
}
277+
271278
public function testJapaneseCharacterGeocoding()
272279
{
273280
$cacheKey = str_slug(strtolower(urlencode('108-0075 東京都港区港南2丁目16-3')));

tests/Laravel5_5/TestCase.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php namespace Geocoder\Laravel\Tests\Laravel5_5;
2+
3+
use Illuminate\Contracts\Console\Kernel;
4+
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
5+
use Illuminate\Foundation\Testing\RefreshDatabase;
6+
7+
abstract class TestCase extends BaseTestCase
8+
{
9+
use CreatesApplication;
10+
use RefreshDatabase;
11+
}

0 commit comments

Comments
 (0)