Skip to content

Commit

Permalink
Purge old laravels, fix #110 (#111)
Browse files Browse the repository at this point in the history
* Ignore phpunit cache

* Added testGetTokenFields

* Drop support for laravel prior to 5.8

* Replace old array_add helper

* Update Travis

* travis - skip php7.1 on L6.0
  • Loading branch information
sandervanhooft authored Sep 16, 2019
1 parent 84df194 commit bfb2de0
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ build
vendor
composer.lock
phpunit.xml
.phpunit.result.cache
.DS_Store
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ env:
global:
- COVERAGE=0
matrix:
- LARAVEL='5.5.*' TESTBENCH='3.5.*'
- LARAVEL='5.6.*' TESTBENCH='3.6.*'
- LARAVEL='5.7.*' TESTBENCH='3.7.*'
- LARAVEL='5.8.*' TESTBENCH='3.8.*'
- LARAVEL='6.*' TESTBENCH='4.*'

Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@
"socialite"
],
"require": {
"php": ">=7.0.0",
"illuminate/support": "^5.5|^6.0",
"mollie/mollie-api-php": "^2.9"
"php": "^7.1.3|^7.2",
"illuminate/support": "^5.8.0|^6.0",
"mollie/mollie-api-php": "^2.9",
"ext-json": "*"
},
"require-dev": {
"graham-campbell/testbench": "^4.0|^5.0",
"graham-campbell/testbench": "^5.0|^6.0",
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^6.0|^7.0|^8.3",
"phpunit/phpunit": "^7.5|^8.0",
"laravel/socialite": "^3.0|^4.0"
},
"suggest": {
Expand Down
3 changes: 2 additions & 1 deletion src/MollieConnectProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/
namespace Mollie\Laravel;

use Illuminate\Support\Arr;
use Laravel\Socialite\Two\AbstractProvider;
use Laravel\Socialite\Two\ProviderInterface;
use Laravel\Socialite\Two\User;
Expand Down Expand Up @@ -148,7 +149,7 @@ protected function getRefreshTokenFields($refresh_token)
*/
public function getTokenFields($code)
{
return array_add(parent::getTokenFields($code), 'grant_type', 'authorization_code');
return Arr::add(parent::getTokenFields($code), 'grant_type', 'authorization_code');
}

/**
Expand Down
16 changes: 16 additions & 0 deletions tests/MollieConnectProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,20 @@ public function testExceptionIsThrownIfStateIsNotSet()
$provider = new MollieConnectProvider($request, 'client_id', 'client_secret', 'redirect');
$user = $provider->user();
}

public function testGetTokenFields()
{
$request = Request::create('foo');
$provider = new MollieConnectProvider($request, 'client_id', 'client_secret', 'redirect');
$this->assertEquals(
[
'client_id' => 'client_id',
'client_secret' => 'client_secret',
'code' => 'dummy_code',
'redirect_uri' => 'redirect',
'grant_type' => 'authorization_code',
],
$provider->getTokenFields('dummy_code')
);
}
}

0 comments on commit bfb2de0

Please sign in to comment.