diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index 00d9ea5..0000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,22 +0,0 @@ -filter: - excluded_paths: [tests/*] - -checks: - php: - remove_extra_empty_lines: true - remove_php_closing_tag: true - remove_trailing_whitespace: true - fix_use_statements: - remove_unused: true - preserve_multiple: false - preserve_blanklines: true - order_alphabetically: true - fix_php_opening_tag: true - fix_linefeed: true - fix_line_ending: true - fix_identation_4spaces: true - fix_doc_comments: true - -tools: - external_code_coverage: - timeout: 600 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 180282a..472e9a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,12 @@ -dist: trusty +dist: xenial language: php php: - 7.1 - 7.2 + - 7.3 + - 7.4 + - 8.0 # This triggers builds to run on the new TravisCI infrastructure. # See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/ @@ -18,6 +21,7 @@ before_script: - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-dist script: + - echo "xdebug.mode=coverage" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - vendor/bin/phpcs --standard=psr2 src/ - vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover diff --git a/README.md b/README.md index 49ae18f..da78bc9 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,12 @@ [![License](https://poser.pugx.org/ricardofiorani/guzzle-psr18-adapter/license.png)](https://packagist.org/packages/ricardofiorani/guzzle-psr18-adapter) [![Total Downloads](https://poser.pugx.org/ricardofiorani/guzzle-psr18-adapter/d/total.png)](https://packagist.org/packages/ricardofiorani/guzzle-psr18-adapter) [![Coding Standards](https://img.shields.io/badge/cs-PSR--4-yellow.svg)](https://github.com/php-fig-rectified/fig-rectified-standards) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ricardofiorani/guzzle-psr18-adapter/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ricardofiorani/guzzle-psr18-adapter/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/ricardofiorani/guzzle-psr18-adapter/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ricardofiorani/guzzle-psr18-adapter/?branch=master) A (very) simple guzzle PSR-18 adapter. ## Requirements -- PHP ^7.1 (Due to PSR-18 interface using Return Type Declaration) +- PHP ^7.1 || ^8.0 - Guzzle ^6.3 ## Install diff --git a/composer.json b/composer.json index f82989a..6b87b1b 100644 --- a/composer.json +++ b/composer.json @@ -17,12 +17,12 @@ } ], "require": { - "php": "^7.1", + "php": "^7.1 || ^8.0", "guzzlehttp/guzzle": "^6.3", "psr/http-client": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^7.3", + "phpunit/phpunit": "^7.3 || ^9", "spryker/code-sniffer": "^0.12.4 || ^0.14.0 || ^0.15.0" }, "provide": { diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 99b860d..d6aa1ca 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -7,6 +7,7 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; use PHPUnit\Framework\TestCase; +use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Message\ResponseInterface; use RicardoFiorani\GuzzlePsr18Adapter\Client; use GuzzleHttp\Exception\RequestException; @@ -22,15 +23,13 @@ public function testSendRequest() TestCase::assertEquals(200, $r->getStatusCode()); } - /** - * @expectedException \Psr\Http\Client\ClientExceptionInterface - */ public function testThrowsClientException() { $mock = new MockHandler([new RequestException("Error Communicating with Server", new Request('GET', 'test'))]); $handler = HandlerStack::create($mock); $client = new Client(['handler' => $handler]); $request = new Request('GET', 'test'); + $this->expectException(ClientExceptionInterface::class); $r = $client->sendRequest($request); }