Skip to content

Commit

Permalink
Merge pull request #7 from ARCANEDEV/update-laravel_5.8_support
Browse files Browse the repository at this point in the history
Adding Laravel 5.8 support
  • Loading branch information
arcanedev-maroc authored Aug 29, 2020
2 parents 8eb4daf + ec17d42 commit 9ae88c6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 35 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:.
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
3 changes: 1 addition & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Application Test Suite">
Expand All @@ -26,6 +25,6 @@
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-text" target="build/logs/coverage.txt"/>
<log type="coverage-html" target="build/logs/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-html" target="build/logs/coverage"/>
</logging>
</phpunit>
8 changes: 4 additions & 4 deletions tests/AgentServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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,
Expand All @@ -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,
Expand Down
40 changes: 19 additions & 21 deletions tests/AgentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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,
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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);

Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);

Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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();
}

Expand Down

0 comments on commit 9ae88c6

Please sign in to comment.