From 2976ef8c8a8a415a7b0698a1305802a1f473c177 Mon Sep 17 00:00:00 2001 From: Ivan Dudarev Date: Wed, 4 Nov 2020 18:14:35 +0700 Subject: [PATCH 1/3] change dev-requirement ohounit version for support PHP 7.0 - 8.0 --- composer.json | 2 +- phpunit.xml.dist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c28d620..12c8929 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ }, "require-dev": { "nyholm/psr7": "^1.3", - "phpunit/phpunit": "^6.5", + "phpunit/phpunit": ">=6.5", "squizlabs/php_codesniffer": "^3.5", "webclient/fake-http-client": "^1.0" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 66b98f0..6f90c5c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ - + tests From 3e2eaa56ff67a004221bbb4719c40dd155608df1 Mon Sep 17 00:00:00 2001 From: Ivan Dudarev Date: Wed, 4 Nov 2020 18:17:23 +0700 Subject: [PATCH 2/3] replace nyholm/psr7 to guzzlehttp/psr7 for PHP 7.0 support --- composer.json | 2 +- stuff/Handler.php | 2 +- tests/ClientTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 12c8929..ab44577 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "psr/http-client": "^1.0" }, "require-dev": { - "nyholm/psr7": "^1.3", + "guzzlehttp/psr7": "^1.7", "phpunit/phpunit": ">=6.5", "squizlabs/php_codesniffer": "^3.5", "webclient/fake-http-client": "^1.0" diff --git a/stuff/Handler.php b/stuff/Handler.php index 777a0af..3b91344 100644 --- a/stuff/Handler.php +++ b/stuff/Handler.php @@ -4,7 +4,7 @@ namespace Stuff\Webclient\Extension\ProtocolVersion; -use Nyholm\Psr7\Response; +use GuzzleHttp\Psr7\Response; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\RequestHandlerInterface; diff --git a/tests/ClientTest.php b/tests/ClientTest.php index f17503b..fd5054e 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -5,7 +5,7 @@ namespace Tests\Webclient\Extension\ProtocolVersion; use Stuff\Webclient\Extension\ProtocolVersion\Handler; -use Nyholm\Psr7\Request; +use GuzzleHttp\Psr7\Request; use PHPUnit\Framework\TestCase; use Psr\Http\Client\ClientExceptionInterface; use Webclient\Extension\ProtocolVersion\Client; From 3119ce00232cb4052dfd741133f9b90c1a413b14 Mon Sep 17 00:00:00 2001 From: Ivan Dudarev Date: Wed, 4 Nov 2020 18:18:10 +0700 Subject: [PATCH 3/3] added github actions CI configuration --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..58bbeb8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI + +on: [push, pull_request] + +jobs: + tests: + runs-on: ubuntu-latest + + strategy: + matrix: + php: [7.0, 7.1, 7.2, 7.3, 7.4, 8.0] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-interaction --no-suggest + + - name: Check code style + run: vendor/bin/phpcs + + - name: Run test suite + run: vendor/bin/phpunit \ No newline at end of file