diff --git a/README.md b/README.md index b11319f..316940f 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/Localization/ ### Features * Easy setup & configuration. - * Laravel `5.0` to `5.7` are supported. + * Laravel `5.0` to `5.8` are supported. * SEO-Friendly (Search engine optimization). * New extended Router to manage your localized routes. * Translated Eloquent Models. diff --git a/_docs/0-Home.md b/_docs/0-Home.md index 0ad9a75..3ed5e1b 100644 --- a/_docs/0-Home.md +++ b/_docs/0-Home.md @@ -7,7 +7,7 @@ Feel free to check out the [Releases](https://github.com/ARCANEDEV/Localization/ ### Features * Easy setup & configuration. - * Laravel `5.0` to `5.7` are supported. + * Laravel `5.0` to `5.8` are supported. * SEO-Friendly (Search engine optimization). * New extended Router to manage your localized routes. * Locales selector menu (Publishable & Customizable). diff --git a/_docs/1-Installation-and-Setup.md b/_docs/1-Installation-and-Setup.md index e78a452..59a51c5 100644 --- a/_docs/1-Installation-and-Setup.md +++ b/_docs/1-Installation-and-Setup.md @@ -28,6 +28,7 @@ PHP extensions: | ![Localization v2.x][localization_2_x] | ![Laravel v5.5][laravel_5_5] | | ![Localization v3.x][localization_3_x] | ![Laravel v5.6][laravel_5_6] | | ![Localization v4.x][localization_4_x] | ![Laravel v5.7][laravel_5_7] | +| ![Localization v5.x][localization_5_x] | ![Laravel v5.8][laravel_5_8] | [laravel_5_0]: https://img.shields.io/badge/v5.0-supported-brightgreen.svg?style=flat-square "Laravel v5.0" [laravel_5_1]: https://img.shields.io/badge/v5.1-supported-brightgreen.svg?style=flat-square "Laravel v5.1" @@ -37,12 +38,14 @@ PHP extensions: [laravel_5_5]: https://img.shields.io/badge/v5.5-supported-brightgreen.svg?style=flat-square "Laravel v5.5" [laravel_5_6]: https://img.shields.io/badge/v5.6-supported-brightgreen.svg?style=flat-square "Laravel v5.6" [laravel_5_7]: https://img.shields.io/badge/v5.7-supported-brightgreen.svg?style=flat-square "Laravel v5.7" +[laravel_5_8]: https://img.shields.io/badge/v5.8-supported-brightgreen.svg?style=flat-square "Laravel v5.8" [localization_0_x]: https://img.shields.io/badge/version-0.*-blue.svg?style=flat-square "Localization v0.*" [localization_1_x]: https://img.shields.io/badge/version-1.*-blue.svg?style=flat-square "Localization v1.*" [localization_2_x]: https://img.shields.io/badge/version-2.*-blue.svg?style=flat-square "Localization v2.*" [localization_3_x]: https://img.shields.io/badge/version-3.*-blue.svg?style=flat-square "Localization v3.*" [localization_4_x]: https://img.shields.io/badge/version-4.*-blue.svg?style=flat-square "Localization v4.*" +[localization_5_x]: https://img.shields.io/badge/version-5.*-blue.svg?style=flat-square "Localization v5.*" ## Composer diff --git a/composer.json b/composer.json index c976fe4..5923559 100644 --- a/composer.json +++ b/composer.json @@ -16,13 +16,13 @@ "require": { "php": ">=7.1.3", "ext-json": "*", - "arcanedev/support": "~4.4.0" + "arcanedev/support": "~4.5.0" }, "require-dev": { - "orchestra/testbench": "~3.7.0", + "orchestra/testbench": "~3.8.0", "mockery/mockery": "~1.0", - "phpunit/phpunit": "~7.0", - "phpunit/phpcov": "~5.0" + "phpunit/phpcov": "~5.0|~6.0", + "phpunit/phpunit": "~7.0|~8.0" }, "autoload": { "psr-4": { diff --git a/tests/Entities/LocaleCollectionTest.php b/tests/Entities/LocaleCollectionTest.php index 2011464..8391a8a 100644 --- a/tests/Entities/LocaleCollectionTest.php +++ b/tests/Entities/LocaleCollectionTest.php @@ -25,14 +25,14 @@ class LocaleCollectionTest extends TestCase | ----------------------------------------------------------------- */ - public function setUp() + public function setUp(): void { parent::setUp(); $this->locales = new LocaleCollection; } - public function tearDown() + public function tearDown(): void { unset($this->locales); diff --git a/tests/Entities/LocaleTest.php b/tests/Entities/LocaleTest.php index 4e32c02..9a8b4f0 100644 --- a/tests/Entities/LocaleTest.php +++ b/tests/Entities/LocaleTest.php @@ -24,7 +24,7 @@ class LocaleTest extends TestCase | ----------------------------------------------------------------- */ - public function tearDown() + public function tearDown(): void { unset($this->locale); @@ -80,7 +80,7 @@ public function it_can_convert_entity_to_array() { $this->locale = $this->makeLocale('en'); - static::assertInternalType('array', $this->locale->toArray()); + static::assertIsArray($this->locale->toArray()); } /** @test */ diff --git a/tests/LocalizationServiceProviderTest.php b/tests/LocalizationServiceProviderTest.php index 4a60390..5de5417 100644 --- a/tests/LocalizationServiceProviderTest.php +++ b/tests/LocalizationServiceProviderTest.php @@ -23,14 +23,14 @@ class LocalizationServiceProviderTest extends TestCase | ----------------------------------------------------------------- */ - public function setUp() + public function setUp(): void { parent::setUp(); $this->provider = $this->app->getProvider(LocalizationServiceProvider::class); } - public function tearDown() + public function tearDown(): void { unset($this->provider); diff --git a/tests/LocalizationTest.php b/tests/LocalizationTest.php index 1802341..4fe2ac0 100644 --- a/tests/LocalizationTest.php +++ b/tests/LocalizationTest.php @@ -22,14 +22,12 @@ public function it_can_be_instantiated() static::assertInstanceOf(Localization::class, localization()); } - /** - * @test - * - * @expectedException \Arcanedev\Localization\Exceptions\UnsupportedLocaleException - * @expectedExceptionMessage Laravel default locale [jp] is not in the `supported-locales` array. - */ + /** @test */ public function it_must_throw_unsupported_locale_exception_on_default_locale() { + $this->expectException(\Arcanedev\Localization\Exceptions\UnsupportedLocaleException::class); + $this->expectExceptionMessage('Laravel default locale [jp] is not in the `supported-locales` array.'); + app('config')->set('app.locale', 'jp'); new Localization( @@ -66,13 +64,11 @@ public function it_can_set_and_get_supported_locales() } } - /** - * @test - * - * @expectedException \Arcanedev\Localization\Exceptions\UndefinedSupportedLocalesException - */ + /** @test */ public function it_must_throw_undefined_supported_locales_exception_on_set_supported_locales_with_empty_array() { + $this->expectException(\Arcanedev\Localization\Exceptions\UndefinedSupportedLocalesException::class); + localization()->setSupportedLocales([]); } @@ -333,14 +329,12 @@ public function it_can_get_url_from_route_name_translated() ); } - /** - * @test - * - * @expectedException \Arcanedev\Localization\Exceptions\UnsupportedLocaleException - * @expectedExceptionMessage Locale 'jp' is not in the list of supported locales. - */ + /** @test */ public function it_must_throw_an_exception_on_unsupported_locale() { + $this->expectException(\Arcanedev\Localization\Exceptions\UnsupportedLocaleException::class); + $this->expectExceptionMessage("Locale 'jp' is not in the list of supported locales."); + localization()->getUrlFromRouteName('jp', 'localization::routes.about'); } @@ -456,11 +450,11 @@ public function it_can_render_locales_navigation_bar() { $navbar = localization()->localesNavbar(); - static::assertContains('