Skip to content

Commit 7a3e832

Browse files
committed
Add support for PHPUnit 13.x
The new version was release a few weeks ago, so I made some adjustments to allow using this one as well. Nothing major changed, so the main thing to do was adjusting the composer dependencies and the CI pipeline.
1 parent 83f90be commit 7a3e832

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

.github/workflows/php.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ jobs:
1313
strategy:
1414
matrix:
1515
php: ['8.2', '8.3', '8.4', '8.5']
16-
phpunit: ['8.0', '9.0', '10.0', '11.0', '12.0']
16+
phpunit: ['8.0', '9.0', '10.0', '11.0', '12.0', '13.0']
1717
exclude:
1818
- php: '8.1'
1919
phpunit: '11.0'
2020
- php: '8.1'
2121
phpunit: '12.0'
22+
- php: '8.1'
23+
phpunit: '13.0'
2224
- php: '8.2'
2325
phpunit: '12.0'
26+
- php: '8.2'
27+
phpunit: '13.0'
28+
- php: '8.3'
29+
phpunit: '13.0'
2430
runs-on: ubuntu-latest
2531
name: PHP ${{ matrix.php }}, PHPUnit ${{ matrix.phpunit }}
2632

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ This library is [MIT-licensed](LICENSE.txt).
2222

2323
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:
2424

25-
| "JSON assertion" version | PHPUnit 4 | PHPUnit 5 | PHPUnit 6 | PHPUnit 7 | PHPUnit 8 | PHPUnit 9 | PHPUnit 10 | PHPUnit 11 | PHPUnit 12 |
26-
| ------------------------ | --------- | --------- | --------- | --------- | --------- | --------- | ---------- |------------|------------|
27-
| 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: | :no_entry_sign: | :no_entry_sign: |
28-
| v2 (branch `v2`) | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: |
29-
| v3 (branch `master`) | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
25+
| "JSON assertion" version | PHPUnit 4 | PHPUnit 5 | PHPUnit 6 | PHPUnit 7 | PHPUnit 8 | PHPUnit 9 | PHPUnit 10 | PHPUnit 11 | PHPUnit 12 | PHPUnit 13 |
26+
| ------------------------ | --------- | --------- | --------- | --------- | --------- | --------- | ---------- |------------|------------|------------|
27+
| 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: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: |
28+
| v2 (branch `v2`) | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: |
29+
| v3 (branch `master`) | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
3030

3131
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.
3232

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"justinrainbow/json-schema": "^5.0 || ^6.0"
1515
},
1616
"conflict": {
17-
"phpunit/phpunit": "<8.0 || >= 13.0"
17+
"phpunit/phpunit": "<8.0 || >= 14.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0"
20+
"phpunit/phpunit": "^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0"
2121
},
2222
"autoload": {
2323
"psr-4": {

tests/Functional/JsonValueMatchesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ public function testJsonValueMatchesSucceedsWithAnyConstraint()
127127
{
128128
$type = 'array';
129129

130-
// Required for PHPUnit 12 support as starting from PHPUnit
130+
// Required for PHPUnit > 12 support as starting from PHPUnit
131131
// version 12 IsTypeclass expects an enum of NativeType.
132-
if (str_starts_with(Version::id(), '12.')) {
132+
if (version_compare(Version::id(), '12', 'ge')) {
133133
$type = NativeType::Array;
134134
}
135135

0 commit comments

Comments
 (0)