Skip to content

Commit

Permalink
Merge pull request #15 from ricardofiorani/update-php-version-coverage
Browse files Browse the repository at this point in the history
Updated php version coverage
  • Loading branch information
ricardofiorani authored Mar 21, 2021
2 parents 481b795 + 46d62c4 commit ade7193
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 31 deletions.
22 changes: 0 additions & 22 deletions .scrutinizer.yml

This file was deleted.

6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -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/
Expand All @@ -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

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
5 changes: 2 additions & 3 deletions tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

Expand Down

0 comments on commit ade7193

Please sign in to comment.