From 0dcb5059cded358f55ae566de9621652cf8542c6 Mon Sep 17 00:00:00 2001 From: Joan Touzet Date: Fri, 12 Jun 2020 07:27:09 +0000 Subject: [PATCH] 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 --- .gitignore | 1 + .travis.yml | 6 +----- README.md | 6 ++---- composer.json | 6 +++--- phpunit.xml | 3 --- test/src/Provider/DiscordTest.php | 12 +++++------- 6 files changed, 12 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index d88aa24..1de294b 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ composer.phar coveralls.phar test/log vendor/ +.phpunit.result.cache diff --git a/.travis.yml b/.travis.yml index 530379f..6232995 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,6 @@ sudo: false matrix: include: - - php: 5.6 - env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"' - - php: 7.0 - - php: 7.1 - php: 7.2 - php: 7.3 - php: 7.4 @@ -19,7 +15,7 @@ matrix: before_script: - travis_retry composer self-update - - travis_retry composer install --no-interaction --prefer-source --dev + - travis_retry composer install --no-interaction --prefer-source - travis_retry phpenv rehash script: diff --git a/README.md b/README.md index c233831..90f9521 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,9 @@ This package provides Discord OAuth 2.0 support for the PHP League's [OAuth 2.0 The following versions of PHP are supported. -* PHP 5.6 -* PHP 7.0 -* PHP 7.1 * PHP 7.2 -* HHVM +* PHP 7.3 +* PHP 7.4 ## Installation diff --git a/composer.json b/composer.json index be0a722..153f15c 100644 --- a/composer.json +++ b/composer.json @@ -21,10 +21,10 @@ "league/oauth2-client": "^2.0" }, "require-dev": { - "phpunit/phpunit": "^5.0", - "mockery/mockery": "~0.9", + "phpunit/phpunit": "~8.0", + "mockery/mockery": "~1.3.0", "squizlabs/php_codesniffer": "^2.0", - "jakub-onderka/php-parallel-lint": "~0.9" + "php-parallel-lint/php-parallel-lint": "~0.9" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index 2729fe9..a4c6594 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,13 +8,10 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" > provider = new \Wohali\OAuth2\Client\Provider\Discord([ 'clientId' => 'mock_client_id', @@ -18,7 +18,7 @@ protected function setUp() ]); } - public function tearDown() + public function tearDown(): void { m::close(); parent::tearDown(); @@ -46,7 +46,7 @@ public function testScopes() $query = ['scope' => implode($scopeSeparator, $options['scope'])]; $url = $this->provider->getAuthorizationUrl($options); $encodedScope = $this->buildQueryString($query); - $this->assertContains($encodedScope, $url); + $this->assertStringContainsString($encodedScope, $url); } public function testGetAuthorizationUrl() @@ -127,11 +127,9 @@ public function testUserData() $this->assertEquals(true, $user->toArray()['verified']); } - /** - * @expectedException League\OAuth2\Client\Provider\Exception\IdentityProviderException - **/ public function testExceptionThrownErrorObjectReceived() { + $this->expectException(\League\OAuth2\Client\Provider\Exception\IdentityProviderException::class); $status = rand(400,600); $postResponse = m::mock('Psr\Http\Message\ResponseInterface'); $postResponse->shouldReceive('getBody')->andReturn('{"client_id": ["This field is required"]}');