From 1f311ba6787c5023ce69e1a3a46f4155ad1dc278 Mon Sep 17 00:00:00 2001 From: Martins Sipenko Date: Mon, 27 Feb 2023 15:00:36 +0200 Subject: [PATCH 1/4] Add support for PHPunit 10 --- .github/workflows/php.yml | 2 +- README.md | 10 +++++----- composer.json | 4 ++-- tests/Functional/JsonValueMatchesTest.php | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 53f377a..d7664b1 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: php: ['8.0', '8.1', '8.2'] - phpunit: ['8.0', '9.0'] + phpunit: ['8.0', '9.0', '10.0'] composer-arg: [''] runs-on: ubuntu-latest name: PHP ${{ matrix.php }}, PHPUnit ${{ matrix.phpunit }} diff --git a/README.md b/README.md index 0228e3c..281c863 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,11 @@ This library is [MIT-licensed](LICENSE.txt). There are several release branches of this library, each of these being compatible with different releases of PHPUnit and PHP. The following table should give an easy overview: -| "JSON assertion" version | PHPUnit 4 | PHPUnit 5 | PHPUnit 6 | PHPUnit 7 | PHPUnit 8 | PHPUnit 9 | -| ------------------------ | --------- | --------- | --------- | --------- | --------- | --------- | -| v1 (branch `v1`), **unsupported** | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | -| v2 (branch `v2`) | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | -| v3 (branch `master`) | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | +| "JSON assertion" version | PHPUnit 4 | PHPUnit 5 | PHPUnit 6 | PHPUnit 7 | PHPUnit 8 | PHPUnit 9 | PHPUnit 10 | +| ------------------------ | --------- | --------- | --------- | --------- | --------- | --------- | ---------- | +| v1 (branch `v1`), **unsupported** | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | +| v2 (branch `v2`) | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | +| v3 (branch `master`) | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | When you are using `composer require` and have already declared a dependency to `phpunit/phpunit` in your `composer.json` file, Composer should pick latest compatible version automatically. diff --git a/composer.json b/composer.json index 0b1a1ff..3c1ec93 100644 --- a/composer.json +++ b/composer.json @@ -14,10 +14,10 @@ "justinrainbow/json-schema": "^5.0" }, "conflict": { - "phpunit/phpunit": "<8.0 || >= 10.0" + "phpunit/phpunit": "<8.0 || >= 11.0" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^8.0 || ^9.0 || ^10.0" }, "autoload": { "psr-4": { diff --git a/tests/Functional/JsonValueMatchesTest.php b/tests/Functional/JsonValueMatchesTest.php index d219234..26503a0 100644 --- a/tests/Functional/JsonValueMatchesTest.php +++ b/tests/Functional/JsonValueMatchesTest.php @@ -33,7 +33,7 @@ class JsonValueMatchesTest extends TestCase ], ]; - public function dataForJsonValueEquals() + public static function dataForJsonValueEquals() { $json = static::$exampleDocument; @@ -58,7 +58,7 @@ public function dataForJsonValueEquals() ]; } - public function dataForJsonValueEqualsCanFail() + public static function dataForJsonValueEqualsCanFail() { $json = static::$exampleDocument; From 97acbc448ec01d0c17f38983195883ed81fa9526 Mon Sep 17 00:00:00 2001 From: Martins Sipenko Date: Mon, 27 Feb 2023 15:08:02 +0200 Subject: [PATCH 2/4] Don't test PHPunit 10 on PHP < 8.1 --- .github/workflows/php.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index d7664b1..4c751a5 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -14,7 +14,9 @@ jobs: matrix: php: ['8.0', '8.1', '8.2'] phpunit: ['8.0', '9.0', '10.0'] - composer-arg: [''] + exclude: + - php: 8.0 + - phpunit: 10.0 runs-on: ubuntu-latest name: PHP ${{ matrix.php }}, PHPUnit ${{ matrix.phpunit }} @@ -37,7 +39,7 @@ jobs: composer require --no-update --dev phpunit/phpunit ~${{ matrix.phpunit }} - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest --${{ matrix.composer-arg }} + run: composer install --prefer-dist --no-progress --no-suggest #- name: Run type checker # run: ./vendor/bin/psalm From 364d866a3a68ac96a3f3b47fd56cf4be00e96ea2 Mon Sep 17 00:00:00 2001 From: Martins Sipenko Date: Mon, 27 Feb 2023 15:09:03 +0200 Subject: [PATCH 3/4] Fix CI --- .github/workflows/php.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 4c751a5..e522ccf 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -15,8 +15,8 @@ jobs: php: ['8.0', '8.1', '8.2'] phpunit: ['8.0', '9.0', '10.0'] exclude: - - php: 8.0 - - phpunit: 10.0 + - php: '8.0' + phpunit: '10.0' runs-on: ubuntu-latest name: PHP ${{ matrix.php }}, PHPUnit ${{ matrix.phpunit }} From 3f4fc3635bcb3f59a12787cc55d599d13fb076a7 Mon Sep 17 00:00:00 2001 From: Martins Sipenko Date: Mon, 27 Feb 2023 15:19:01 +0200 Subject: [PATCH 4/4] Update PHPUnit config --- .github/workflows/php.yml | 2 +- phpunit.xml | 25 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e522ccf..5287744 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -45,4 +45,4 @@ jobs: # run: ./vendor/bin/psalm - name: Run unit tests - run: ./vendor/bin/phpunit --testdox + run: ./vendor/bin/phpunit --testdox --no-coverage diff --git a/phpunit.xml b/phpunit.xml index 829a996..5c0ce0d 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,28 +1,27 @@ + + timeoutForLargeTests="60" + cacheDirectory=".phpunit.cache"> tests/Functional - - + - - + + src - - + + + + +