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..feca2f8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + continue-on-error: true + strategy: + 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: '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: "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: + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.batch.php }} + 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..112135d --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,21 @@ +name: Static analysis + +on: + push: + branches: + - master + pull_request: + +jobs: + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: PHP-CS-Fixer + uses: docker://oskarstark/php-cs-fixer-ga:2.16.4 + with: + args: --dry-run --diff-format udiff 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; 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 60c364f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +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="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" - -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: - - /^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} - 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 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