diff --git a/README.md b/README.md index 7cec9ef..e16d1bf 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/Agent/release ### Features - * Laravel `5.1` to `5.7` are Supported. + * Laravel `5.1` to `5.8` are Supported. * Easy setup & configuration. * Well tested (100% code coverage with maximum code quality). * Made with :heart: & :coffee:. @@ -41,7 +41,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail. - [All Contributors][link-contributors] [badge_license]: https://img.shields.io/packagist/l/arcanedev/agent.svg?style=flat-square -[badge_laravel]: https://img.shields.io/badge/Laravel-5.1%20to%205.7-orange.svg?style=flat-square +[badge_laravel]: https://img.shields.io/badge/Laravel-5.1%20to%205.8-orange.svg?style=flat-square [badge_build]: https://img.shields.io/travis/ARCANEDEV/Agent.svg?style=flat-square [badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/Agent.svg?style=flat-square [badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/Agent.svg?style=flat-square diff --git a/composer.json b/composer.json index eee6948..4e978b2 100644 --- a/composer.json +++ b/composer.json @@ -14,14 +14,14 @@ "type": "library", "license": "MIT", "require": { - "php": ">=7.1.3", - "arcanedev/support": "~4.4.0", - "mobiledetect/mobiledetectlib": "~2.8", - "jaybizzle/crawler-detect": "~1.2" + "php": "^7.1.3", + "arcanedev/support": "^4.5", + "mobiledetect/mobiledetectlib": "^2.8", + "jaybizzle/crawler-detect": "^1.2" }, "require-dev": { - "orchestra/testbench": "~3.7.0", - "phpunit/phpunit": "^7.0" + "orchestra/testbench": "^3.8", + "phpunit/phpunit": "^7.0|^8.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 716e447..6d4a0ac 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -8,7 +8,6 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" > @@ -26,6 +25,6 @@ - + diff --git a/tests/AgentServiceProviderTest.php b/tests/AgentServiceProviderTest.php index 44154c3..a136359 100644 --- a/tests/AgentServiceProviderTest.php +++ b/tests/AgentServiceProviderTest.php @@ -21,14 +21,14 @@ class AgentServiceProviderTest extends TestCase | ----------------------------------------------------------------- */ - public function setUp() + public function setUp(): void { parent::setUp(); $this->provider = $this->app->getProvider(\Arcanedev\Agent\AgentServiceProvider::class); } - public function tearDown() + public function tearDown(): void { unset($this->provider); @@ -40,7 +40,7 @@ public function tearDown() | ------------------------------------------------------------------------------------------------ */ /** @test */ - public function it_can_be_instantiated() + public function it_can_be_instantiated(): void { $expectations = [ \Illuminate\Support\ServiceProvider::class, @@ -55,7 +55,7 @@ public function it_can_be_instantiated() } /** @test */ - public function it_can_provides() + public function it_can_provides(): void { $expected = [ \Arcanedev\Agent\Contracts\Agent::class, diff --git a/tests/AgentTest.php b/tests/AgentTest.php index 3908ddd..94661c8 100644 --- a/tests/AgentTest.php +++ b/tests/AgentTest.php @@ -21,14 +21,14 @@ class AgentTest extends TestCase | ----------------------------------------------------------------- */ - public function setUp() + public function setUp(): void { parent::setUp(); $this->agent = $this->app->make(\Arcanedev\Agent\Contracts\Agent::class); } - public function tearDown() + public function tearDown(): void { unset($this->agent); @@ -41,7 +41,7 @@ public function tearDown() */ /** @test */ - public function it_can_be_instantiated() + public function it_can_be_instantiated(): void { $expectations = [ \Arcanedev\Agent\Contracts\Agent::class, @@ -54,7 +54,7 @@ public function it_can_be_instantiated() } /** @test */ - public function it_can_get_languages() + public function it_can_get_languages(): void { $this->agent->setHttpHeaders([ 'HTTP_ACCEPT_LANGUAGE' => 'nl-NL,nl;q=0.8,en-US;q=0.6,en;q=0.4', @@ -64,7 +64,7 @@ public function it_can_get_languages() } /** @test */ - public function it_can_get_languages_sorted() + public function it_can_get_languages_sorted(): void { $this->agent->setHttpHeaders([ 'HTTP_ACCEPT_LANGUAGE' => 'en;q=0.4,en-US,nl;q=0.6', @@ -81,7 +81,7 @@ public function it_can_get_languages_sorted() * @param string $ua * @param string $browser */ - public function it_can_check_browsers($ua, $browser) + public function it_can_check_browsers($ua, $browser): void { $this->agent->setUserAgent($ua); @@ -95,7 +95,7 @@ public function it_can_check_browsers($ua, $browser) } /** @test */ - public function it_can_get_browser_version() + public function it_can_get_browser_version(): void { foreach($this->browserVersions as $ua => $version) { $this->agent->setUserAgent($ua); @@ -114,7 +114,7 @@ public function it_can_get_browser_version() * @param string $ua * @param string $platform */ - public function it_can_check_operating_systems($ua, $platform) + public function it_can_check_operating_systems($ua, $platform): void { $this->agent->setUserAgent($ua); static::assertEquals($platform, $this->agent->platform(), $ua); @@ -127,7 +127,7 @@ public function it_can_check_operating_systems($ua, $platform) } /** @test */ - public function it_can_get_os_version() + public function it_can_get_os_version(): void { foreach($this->operatingSystemVersions as $ua => $version) { $this->agent->setUserAgent($ua); @@ -139,7 +139,7 @@ public function it_can_get_os_version() } /** @test */ - public function it_can_check_is_desktop() + public function it_can_check_is_desktop(): void { foreach($this->desktops as $ua) { $this->agent->setUserAgent($ua); @@ -154,7 +154,7 @@ public function it_can_check_is_desktop() } /** @test */ - public function it_can_check_is_phone() + public function it_can_check_is_phone(): void { foreach($this->phones as $ua) { $this->agent->setUserAgent($ua); @@ -175,7 +175,7 @@ public function it_can_check_is_phone() * @param string $ua * @param string $robot */ - public function it_can_check_is_robot($ua, $robot) + public function it_can_check_is_robot($ua, $robot): void { $this->agent->setUserAgent($ua); @@ -189,7 +189,7 @@ public function it_can_check_is_robot($ua, $robot) } /** @test */ - public function it_can_check_is_mobile_device() + public function it_can_check_is_mobile_device(): void { foreach($this->mobileDevices as $ua => $device) { $this->agent->setUserAgent($ua); @@ -208,7 +208,7 @@ public function it_can_check_is_mobile_device() } /** @test */ - public function it_can_check_is_desktop_device() + public function it_can_check_is_desktop_device(): void { foreach($this->desktopDevices as $ua => $device) { $this->agent->setUserAgent($ua); @@ -228,14 +228,12 @@ public function it_can_check_is_desktop_device() } } - /** - * @test - * - * @expectedException \BadMethodCallException - * @expectedExceptionMessage No such method exists: canUseIE - */ - public function it_must_throw_exception_on_invalid_method_name() + /** @test */ + public function it_must_throw_exception_on_invalid_method_name(): void { + $this->expectException(\BadMethodCallException::class); + $this->expectExceptionMessage('No such method exists: canUseIE'); + $this->agent->canUseIE(); }