From 35ad7c4d7f2a6b87a1a47a999d0590ef0467a995 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 1 Oct 2020 09:03:13 +0200 Subject: [PATCH 1/8] Cleaned up some tests --- .travis.yml | 9 +-------- phpunit.xml.dist | 14 +------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/.travis.yml b/.travis.yml index 60c364f..25aa761 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,19 +15,12 @@ env: - SUITE="Guzzle6" PACKAGE="php-http/guzzle6-adapter:dev-master" - SUITE="Guzzle" PACKAGE="guzzlehttp/guzzle:dev-master" - SUITE="Guzzle" PACKAGE="guzzlehttp/guzzle:dev-master phpunit/phpunit:^8.5.8" - - SUITE="React" PACKAGE="php-http/react-adapter:dev-master" - - SUITE="Buzz" PACKAGE="php-http/buzz-adapter:dev-master" - - SUITE="CakePHP" PACKAGE="php-http/cakephp-adapter:dev-master" - - SUITE="Zend" PACKAGE="php-http/zend-adapter:dev-master" - - SUITE="Artax" PACKAGE="php-http/artax-adapter:dev-master" + - SUITE="Buzz" PACKAGE="kriswallsmith/buzz:dev-master" matrix: include: - php: 5.5 env: SUITE="Guzzle5" PACKAGE="php-http/guzzle5-adapter:dev-master" - allow_failures: - - env: SUITE="Socket" PACKAGE="php-http/socket-client:dev-master php-http/client-common" - - env: SUITE="CakePHP" PACKAGE="php-http/cakephp-adapter:dev-master" branches: except: diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 97701c3..a77b486 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,9 +1,6 @@ - - vendor/php-http/artax-adapter/tests - vendor/php-http/curl-client/tests @@ -20,16 +17,7 @@ vendor/php-http/guzzle6-adapter/tests - vendor/php-http/buzz-adapter/tests - - - vendor/php-http/react-adapter/tests - - - vendor/php-http/cakephp-adapter/tests - - - vendor/php-http/zend-adapter/tests + vendor/kriswallsmith/buzz/tests From 96291dcf9af00e177b5ea046c8fe59435d19110e Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 1 Oct 2020 09:28:36 +0200 Subject: [PATCH 2/8] Adding github actions --- .github/workflows/.editorconfig | 2 ++ .github/workflows/ci.yml | 45 +++++++++++++++++++++++++++++++++ .github/workflows/static.yml | 23 +++++++++++++++++ .gitignore | 2 ++ .php_cs | 13 ---------- .php_cs.dist | 15 +++++++++++ 6 files changed, 87 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/.editorconfig create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/static.yml delete mode 100644 .php_cs create mode 100644 .php_cs.dist diff --git a/.github/workflows/.editorconfig b/.github/workflows/.editorconfig new file mode 100644 index 0000000..7bd3346 --- /dev/null +++ b/.github/workflows/.editorconfig @@ -0,0 +1,2 @@ +[*.yml] +indent_size = 2 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..20472dd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + strategy: + max-parallel: 10 + matrix: + batch: + - { SUITE: "curl", PACKAGE: "php-http/curl-client:dev-master zendframework/zend-diactoros" } + - { SUITE: "Socket", PACKAGE: "php-http/socket-client:dev-master php-http/client-common" } + - { SUITE: "Guzzle6", PACKAGE: "php-http/guzzle6-adapter:dev-master" } + - { SUITE: "Guzzle", PACKAGE: "guzzlehttp/guzzle:dev-master" } + - { SUITE: "Guzzle", PACKAGE: "guzzlehttp/guzzle:dev-master phpunit/phpunit:^8.5.8" } + - { SUITE: "Buzz", PACKAGE: "kriswallsmith/buzz:dev-master" } + + steps: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + tools: composer:v2 + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Download dependencies + run: | + composer require ${{ matrix.batch.PACKAGE }} --no-update + composer update --prefer-source --no-interaction + + - name: Start test server + shell: bash + run: bin/http_test_server > /dev/null 2>&1 & + + - name: Run tests + run: ./vendor/bin/phpunit --testsuite ${{ matrix.batch.SUITE }} diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000..ed01341 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,23 @@ +name: Static analysis + +on: + push: + branches: + - master + pull_request: + +jobs: + phpstan: + name: PHPStan + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: PHPStan + uses: docker://oskarstark/phpstan-ga:0.12.41 + env: + REQUIRE_DEV: true + with: + args: analyze --no-progress diff --git a/.gitignore b/.gitignore index 16b4a20..bae9868 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /phpspec.yml /phpunit.xml /vendor/ +.phpunit.result.cache +.php_cs.cache diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 23ba165..0000000 --- a/.php_cs +++ /dev/null @@ -1,13 +0,0 @@ -setRiskyAllowed(true) + ->setRules([ + '@PSR2' => true, + ]) + ->setFinder( + PhpCsFixer\Finder::create() + ->in(__DIR__.'/src') + ->name('*.php') + ) +; + +return $config; From fd2c73c677c0e357c7f4480b4e18ea0d45d2a4bf Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 1 Oct 2020 09:31:25 +0200 Subject: [PATCH 3/8] continue on error --- .github/workflows/ci.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20472dd..3170e19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,22 +10,24 @@ jobs: build: name: Build runs-on: ubuntu-latest + continue-on-error: true strategy: max-parallel: 10 matrix: batch: - - { SUITE: "curl", PACKAGE: "php-http/curl-client:dev-master zendframework/zend-diactoros" } - - { SUITE: "Socket", PACKAGE: "php-http/socket-client:dev-master php-http/client-common" } - - { SUITE: "Guzzle6", PACKAGE: "php-http/guzzle6-adapter:dev-master" } - - { SUITE: "Guzzle", PACKAGE: "guzzlehttp/guzzle:dev-master" } - - { SUITE: "Guzzle", PACKAGE: "guzzlehttp/guzzle:dev-master phpunit/phpunit:^8.5.8" } - - { SUITE: "Buzz", PACKAGE: "kriswallsmith/buzz:dev-master" } + - { suite: "curl", php: '7.4', package: "php-http/curl-client:dev-master zendframework/zend-diactoros" } + - { suite: "Socket", php: '7.4', package: "php-http/socket-client:dev-master php-http/client-common" } + - { suite: "Guzzle5", php: '5.5', package: "php-http/guzzle5-adapter:dev-master" } + - { suite: "Guzzle6", php: '7.4', package: "php-http/guzzle6-adapter:dev-master" } + - { suite: "Guzzle", php: '7.4', package: "guzzlehttp/guzzle:dev-master" } + - { suite: "Guzzle", php: '7.4', package: "guzzlehttp/guzzle:dev-master phpunit/phpunit:^8.5.8" } + - { suite: "Buzz", php: '7.4', package: "kriswallsmith/buzz:dev-master" } steps: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '7.4' + php-version: ${{ matrix.batch.php }} coverage: none tools: composer:v2 @@ -34,7 +36,7 @@ jobs: - name: Download dependencies run: | - composer require ${{ matrix.batch.PACKAGE }} --no-update + composer require ${{ matrix.batch.php: '7.4', package }} --no-update composer update --prefer-source --no-interaction - name: Start test server @@ -42,4 +44,4 @@ jobs: run: bin/http_test_server > /dev/null 2>&1 & - name: Run tests - run: ./vendor/bin/phpunit --testsuite ${{ matrix.batch.SUITE }} + run: ./vendor/bin/phpunit --testsuite ${{ matrix.batch.suite }} From 5e04980188c1ef59dd433b700e04b393163b5cd5 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 1 Oct 2020 09:32:47 +0200 Subject: [PATCH 4/8] Typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3170e19..36cf6be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,7 @@ jobs: - name: Download dependencies run: | - composer require ${{ matrix.batch.php: '7.4', package }} --no-update + composer require ${{ matrix.batch.package }} --no-update composer update --prefer-source --no-interaction - name: Start test server From d90ce664fcb055c2ef04d8c330b9e85935a63f87 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 1 Oct 2020 09:35:22 +0200 Subject: [PATCH 5/8] minor --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 36cf6be..b171a12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,13 +15,13 @@ jobs: max-parallel: 10 matrix: batch: - - { suite: "curl", php: '7.4', package: "php-http/curl-client:dev-master zendframework/zend-diactoros" } - - { suite: "Socket", php: '7.4', package: "php-http/socket-client:dev-master php-http/client-common" } - - { suite: "Guzzle5", php: '5.5', package: "php-http/guzzle5-adapter:dev-master" } + - { suite: "curl", php: '7.4', package: "php-http/curl-client:dev-master zendframework/zend-diactoros" } + - { suite: "Socket", php: '7.4', package: "php-http/socket-client:dev-master php-http/client-common" } + - { suite: "Guzzle5", php: '7.1', package: "php-http/guzzle5-adapter:dev-master" } - { suite: "Guzzle6", php: '7.4', package: "php-http/guzzle6-adapter:dev-master" } - - { suite: "Guzzle", php: '7.4', package: "guzzlehttp/guzzle:dev-master" } - - { suite: "Guzzle", php: '7.4', package: "guzzlehttp/guzzle:dev-master phpunit/phpunit:^8.5.8" } - - { suite: "Buzz", php: '7.4', package: "kriswallsmith/buzz:dev-master" } + - { suite: "Guzzle", php: '7.4', package: "guzzlehttp/guzzle:dev-master" } + - { suite: "Guzzle", php: '7.4', package: "guzzlehttp/guzzle:dev-master phpunit/phpunit:^8.5.8" } + - { suite: "Buzz", php: '7.4', package: "kriswallsmith/buzz:dev-master" } steps: - name: Set up PHP From 6638fa10172f6805939216c422377d0badd0e542 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 1 Oct 2020 09:37:54 +0200 Subject: [PATCH 6/8] Remove old files --- .github/workflows/ci.yml | 1 + .styleci.yml | 11 ----------- .travis.yml | 41 ---------------------------------------- 3 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 .styleci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b171a12..feca2f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,7 @@ jobs: - { suite: "Guzzle6", php: '7.4', package: "php-http/guzzle6-adapter:dev-master" } - { suite: "Guzzle", php: '7.4', package: "guzzlehttp/guzzle:dev-master" } - { suite: "Guzzle", php: '7.4', package: "guzzlehttp/guzzle:dev-master phpunit/phpunit:^8.5.8" } + - { suite: "Guzzle", php: '7.4', package: "guzzlehttp/guzzle:dev-master phpunit/phpunit:^7.5.20" } - { suite: "Buzz", php: '7.4', package: "kriswallsmith/buzz:dev-master" } steps: diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index f187ec0..0000000 --- a/.styleci.yml +++ /dev/null @@ -1,11 +0,0 @@ -preset: symfony - -finder: - exclude: - - "spec" - path: - - "src" - - "tests" - -disabled: - - phpdoc_annotation_without_dot # This is still buggy: https://github.com/symfony/symfony/pull/19198 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 25aa761..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -language: php - -sudo: false - -cache: - directories: - - $HOME/.composer/cache/files - -php: - - 7.4 - -env: - - SUITE="curl" PACKAGE="php-http/curl-client:dev-master zendframework/zend-diactoros" - - SUITE="Socket" PACKAGE="php-http/socket-client:dev-master php-http/client-common" - - SUITE="Guzzle6" PACKAGE="php-http/guzzle6-adapter:dev-master" - - SUITE="Guzzle" PACKAGE="guzzlehttp/guzzle:dev-master" - - SUITE="Guzzle" PACKAGE="guzzlehttp/guzzle:dev-master phpunit/phpunit:^8.5.8" - - SUITE="Buzz" PACKAGE="kriswallsmith/buzz:dev-master" - -matrix: - include: - - php: 5.5 - env: SUITE="Guzzle5" PACKAGE="php-http/guzzle5-adapter:dev-master" - -branches: - except: - - /^analysis-.*$/ - -before_install: - - phpenv config-rm xdebug.ini || true - -install: - - composer require ${PACKAGE} --no-update - - travis_retry composer update --prefer-source --no-interaction - -before_script: - - bin/http_test_server > /dev/null 2>&1 & - -script: - - ./vendor/bin/phpunit --testsuite ${SUITE} - From 9f80a5559065db2e67f2c0a7b85aed062cc05f40 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 1 Oct 2020 09:40:27 +0200 Subject: [PATCH 7/8] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1700a16..b41313a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [3.0.0] - Unreleased +## [3.0.0] - 2020-10-01 - Only support HTTPlug 2.0 and PSR-18 - HTTPlug 2.0 is now optional (only require it if you need to test async) - HttpClientTest now relies only on PSR-18 (no need for HTTPlug) +- Added support for PHPUnit 8 and 9 ## [2.0.1] - 2018-12-27 From 4895728ee94cc1c8c0283abb7642319702e35c35 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Thu, 1 Oct 2020 09:44:38 +0200 Subject: [PATCH 8/8] Typo =) --- .github/workflows/static.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index ed01341..112135d 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -7,17 +7,15 @@ on: pull_request: jobs: - phpstan: - name: PHPStan + php-cs-fixer: + name: PHP-CS-Fixer runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - - name: PHPStan - uses: docker://oskarstark/phpstan-ga:0.12.41 - env: - REQUIRE_DEV: true + - name: PHP-CS-Fixer + uses: docker://oskarstark/php-cs-fixer-ga:2.16.4 with: - args: analyze --no-progress + args: --dry-run --diff-format udiff