From 409d48a21ec504f443d6dd20a8251160486ef247 Mon Sep 17 00:00:00 2001 From: "serghei.luchianenco" Date: Wed, 10 Feb 2021 08:49:51 +0100 Subject: [PATCH] version 2 refactoring --- .travis.yml | 7 ++++--- composer.json | 6 +++--- phpunit.xml | 36 +++++++++++++++++++---------------- tests/Provider/AmazonTest.php | 13 ++++++++----- 4 files changed, 35 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b8f15d..aad9151 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,10 @@ language: php php: - - 5.6 - - 7.0 - - 7.1 + - 7.2 + - 7.3 + - 7.4 + - 8.0 before_script: - travis_retry composer self-update diff --git a/composer.json b/composer.json index 9435a6a..b64c4db 100644 --- a/composer.json +++ b/composer.json @@ -18,11 +18,11 @@ "amazon" ], "require": { - "php": "^5.6 || ^7.0 || ^7.1", + "php": ">=7.2", "league/oauth2-client": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^5.7 || ^6.0 || ^7.0" + "phpunit/phpunit": "8.* || 9.*" }, "autoload": { "psr-4": { @@ -31,7 +31,7 @@ }, "autoload-dev": { "psr-4": { - "Luchianenco\\OAuth2\\Client\\Test\\": "tests/src/" + "Luchianenco\\OAuth2\\Client\\Test\\": "tests/" } } } diff --git a/phpunit.xml b/phpunit.xml index f8be325..eaffb92 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,5 +1,7 @@ - - ./vendor/bin/phpunit - - ./tests/ + stopOnFailure="false"> + + + + ./src + + + + ./vendor + + + + + ./tests - - - ./ - - ./vendor - ./tests - - - \ No newline at end of file diff --git a/tests/Provider/AmazonTest.php b/tests/Provider/AmazonTest.php index 718b3e6..7650d3d 100644 --- a/tests/Provider/AmazonTest.php +++ b/tests/Provider/AmazonTest.php @@ -5,7 +5,7 @@ use Luchianenco\OAuth2\Client\Provider\Amazon; use PHPUnit\Framework\TestCase; -class AmazonTest extends TestCase +final class AmazonTest extends TestCase { const CLIENT_ID = '0000000001'; const CLIENT_SECRET = 'XXXXXXXXX'; @@ -14,7 +14,7 @@ class AmazonTest extends TestCase /** @var Amazon */ protected $provider; - public function setUp() + public function setUp(): void { $this->provider = new Amazon([ 'clientId' => self::CLIENT_ID, @@ -23,7 +23,8 @@ public function setUp() ]); } - public function testBaseAuthorizationUrl() + /** @test */ + public function testBaseAuthorizationUrl(): void { $url = $this->provider->getBaseAuthorizationUrl(); $resource = parse_url($url); @@ -32,7 +33,8 @@ public function testBaseAuthorizationUrl() $this->assertEquals('/ap/oa', $resource['path']); } - public function testAuthorizationUrl() + /** @test */ + public function testAuthorizationUrl(): void { $url = $this->provider->getAuthorizationUrl(); $resource = parse_url($url); @@ -56,7 +58,8 @@ public function testAuthorizationUrl() $this->assertArrayHasKey('approval_prompt', $urlQuery); } - public function testBaseAccessTokenUrl() + /** @test */ + public function testBaseAccessTokenUrl(): void { $params = []; $url = $this->provider->getBaseAccessTokenUrl($params);