Skip to content

Commit 0dcb505

Browse files
authored
Bump mockery, phpunit for 7.4 (#25)
* Support PHP 7.2+ only (Travis) * Drop support for old PHP, HHVM * more fixes for changes and deprecations in phpunit
1 parent 42a6ba7 commit 0dcb505

File tree

6 files changed

+12
-22
lines changed

6 files changed

+12
-22
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ composer.phar
77
coveralls.phar
88
test/log
99
vendor/
10+
.phpunit.result.cache

.travis.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ sudo: false
44

55
matrix:
66
include:
7-
- php: 5.6
8-
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
9-
- php: 7.0
10-
- php: 7.1
117
- php: 7.2
128
- php: 7.3
139
- php: 7.4
@@ -19,7 +15,7 @@ matrix:
1915

2016
before_script:
2117
- travis_retry composer self-update
22-
- travis_retry composer install --no-interaction --prefer-source --dev
18+
- travis_retry composer install --no-interaction --prefer-source
2319
- travis_retry phpenv rehash
2420

2521
script:

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ This package provides Discord OAuth 2.0 support for the PHP League's [OAuth 2.0
1313

1414
The following versions of PHP are supported.
1515

16-
* PHP 5.6
17-
* PHP 7.0
18-
* PHP 7.1
1916
* PHP 7.2
20-
* HHVM
17+
* PHP 7.3
18+
* PHP 7.4
2119

2220
## Installation
2321

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
"league/oauth2-client": "^2.0"
2222
},
2323
"require-dev": {
24-
"phpunit/phpunit": "^5.0",
25-
"mockery/mockery": "~0.9",
24+
"phpunit/phpunit": "~8.0",
25+
"mockery/mockery": "~1.3.0",
2626
"squizlabs/php_codesniffer": "^2.0",
27-
"jakub-onderka/php-parallel-lint": "~0.9"
27+
"php-parallel-lint/php-parallel-lint": "~0.9"
2828
},
2929
"autoload": {
3030
"psr-4": {

phpunit.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
>
1312
<logging>
1413
<log type="coverage-html"
1514
target="./build/coverage/html"
16-
charset="UTF-8"
17-
highlight="false"
1815
lowUpperBound="35"
1916
highLowerBound="70"/>
2017
<log type="coverage-clover"

test/src/Provider/DiscordTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
use League\OAuth2\Client\Tool\QueryBuilderTrait;
44
use Mockery as m;
55

6-
class DiscordTest extends \PHPUnit_Framework_TestCase
6+
class DiscordTest extends \PHPUnit\Framework\TestCase
77
{
88
use QueryBuilderTrait;
99

1010
protected $provider;
1111

12-
protected function setUp()
12+
protected function setUp(): void
1313
{
1414
$this->provider = new \Wohali\OAuth2\Client\Provider\Discord([
1515
'clientId' => 'mock_client_id',
@@ -18,7 +18,7 @@ protected function setUp()
1818
]);
1919
}
2020

21-
public function tearDown()
21+
public function tearDown(): void
2222
{
2323
m::close();
2424
parent::tearDown();
@@ -46,7 +46,7 @@ public function testScopes()
4646
$query = ['scope' => implode($scopeSeparator, $options['scope'])];
4747
$url = $this->provider->getAuthorizationUrl($options);
4848
$encodedScope = $this->buildQueryString($query);
49-
$this->assertContains($encodedScope, $url);
49+
$this->assertStringContainsString($encodedScope, $url);
5050
}
5151

5252
public function testGetAuthorizationUrl()
@@ -127,11 +127,9 @@ public function testUserData()
127127
$this->assertEquals(true, $user->toArray()['verified']);
128128
}
129129

130-
/**
131-
* @expectedException League\OAuth2\Client\Provider\Exception\IdentityProviderException
132-
**/
133130
public function testExceptionThrownErrorObjectReceived()
134131
{
132+
$this->expectException(\League\OAuth2\Client\Provider\Exception\IdentityProviderException::class);
135133
$status = rand(400,600);
136134
$postResponse = m::mock('Psr\Http\Message\ResponseInterface');
137135
$postResponse->shouldReceive('getBody')->andReturn('{"client_id": ["This field is required"]}');

0 commit comments

Comments
 (0)