Skip to content

Commit

Permalink
version 2 refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmarketplace committed Feb 10, 2021
1 parent 39237eb commit 409d48a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 27 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -31,7 +31,7 @@
},
"autoload-dev": {
"psr-4": {
"Luchianenco\\OAuth2\\Client\\Test\\": "tests/src/"
"Luchianenco\\OAuth2\\Client\\Test\\": "tests/"
}
}
}
36 changes: 20 additions & 16 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>./vendor/bin/phpunit
<testsuite name="Test Suite">
<directory suffix=".php">./tests/</directory>
stopOnFailure="false">

<coverage includeUncoveredFiles="true"
processUncoveredFiles="true"
ignoreDeprecatedCodeUnits="true"
disableCodeCoverageIgnore="true">
<include>
<directory suffix=".php">./src</directory>
</include>

<exclude>
<directory suffix=".php">./vendor</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="unit">
<directory>./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./</directory>
<exclude>
<directory suffix=".php">./vendor</directory>
<directory suffix=".php">./tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
13 changes: 8 additions & 5 deletions tests/Provider/AmazonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand All @@ -23,7 +23,8 @@ public function setUp()
]);
}

public function testBaseAuthorizationUrl()
/** @test */
public function testBaseAuthorizationUrl(): void
{
$url = $this->provider->getBaseAuthorizationUrl();
$resource = parse_url($url);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 409d48a

Please sign in to comment.