Skip to content

Commit 5a3a53e

Browse files
Add support for PHPUnit 10 (martin-helmich#52)
* Add support for PHPunit 10 * Don't test PHPunit 10 on PHP < 8.1 * Fix CI * Update PHPUnit config
1 parent b15f846 commit 5a3a53e

File tree

5 files changed

+27
-26
lines changed

5 files changed

+27
-26
lines changed

.github/workflows/php.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ jobs:
1313
strategy:
1414
matrix:
1515
php: ['8.0', '8.1', '8.2']
16-
phpunit: ['8.0', '9.0']
17-
composer-arg: ['']
16+
phpunit: ['8.0', '9.0', '10.0']
17+
exclude:
18+
- php: '8.0'
19+
phpunit: '10.0'
1820
runs-on: ubuntu-latest
1921
name: PHP ${{ matrix.php }}, PHPUnit ${{ matrix.phpunit }}
2022

@@ -37,10 +39,10 @@ jobs:
3739
composer require --no-update --dev phpunit/phpunit ~${{ matrix.phpunit }}
3840
3941
- name: Install dependencies
40-
run: composer install --prefer-dist --no-progress --no-suggest --${{ matrix.composer-arg }}
42+
run: composer install --prefer-dist --no-progress --no-suggest
4143

4244
#- name: Run type checker
4345
# run: ./vendor/bin/psalm
4446

4547
- name: Run unit tests
46-
run: ./vendor/bin/phpunit --testdox
48+
run: ./vendor/bin/phpunit --testdox --no-coverage

README.md

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

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

26-
| "JSON assertion" version | PHPUnit 4 | PHPUnit 5 | PHPUnit 6 | PHPUnit 7 | PHPUnit 8 | PHPUnit 9 |
27-
| ------------------------ | --------- | --------- | --------- | --------- | --------- | --------- |
28-
| v1 (branch `v1`), **unsupported** | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: |
29-
| v2 (branch `v2`) | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign: |
30-
| v3 (branch `master`) | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: |
26+
| "JSON assertion" version | PHPUnit 4 | PHPUnit 5 | PHPUnit 6 | PHPUnit 7 | PHPUnit 8 | PHPUnit 9 | PHPUnit 10 |
27+
| ------------------------ | --------- | --------- | --------- | --------- | --------- | --------- | ---------- |
28+
| 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: |
29+
| v2 (branch `v2`) | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: |
30+
| v3 (branch `master`) | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :no_entry_sign: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
3131

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

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"
1515
},
1616
"conflict": {
17-
"phpunit/phpunit": "<8.0 || >= 10.0"
17+
"phpunit/phpunit": "<8.0 || >= 11.0"
1818
},
1919
"require-dev": {
20-
"phpunit/phpunit": "^8.0 || ^9.0"
20+
"phpunit/phpunit": "^8.0 || ^9.0 || ^10.0"
2121
},
2222
"autoload": {
2323
"psr-4": {

phpunit.xml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1+
<?xml version="1.0"?>
12
<phpunit
23
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.1/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
45
bootstrap="vendor/autoload.php"
56
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
convertDeprecationsToExceptions="true"
107
timeoutForSmallTests="1"
118
timeoutForMediumTests="10"
12-
timeoutForLargeTests="60">
9+
timeoutForLargeTests="60"
10+
cacheDirectory=".phpunit.cache">
1311
<testsuites>
1412
<testsuite name="functional">
1513
<directory>tests/Functional</directory>
1614
</testsuite>
1715
</testsuites>
1816
<logging>
19-
<log type="coverage-html" target="build/coverage" lowUpperBound="35"
20-
highLowerBound="70"/>
21-
<log type="junit" target="build/phpunit"/>
17+
<junit outputFile="build/phpunit"/>
2218
</logging>
23-
<filter>
24-
<whitelist processUncoveredFilesFromWhitelist="true">
19+
<coverage>
20+
<include>
2521
<directory suffix=".php">src</directory>
26-
</whitelist>
27-
</filter>
22+
</include>
23+
<report>
24+
<html outputDirectory="build/coverage" lowUpperBound="35" highLowerBound="70"/>
25+
</report>
26+
</coverage>
2827
</phpunit>

tests/Functional/JsonValueMatchesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class JsonValueMatchesTest extends TestCase
3333
],
3434
];
3535

36-
public function dataForJsonValueEquals()
36+
public static function dataForJsonValueEquals()
3737
{
3838
$json = static::$exampleDocument;
3939

@@ -58,7 +58,7 @@ public function dataForJsonValueEquals()
5858
];
5959
}
6060

61-
public function dataForJsonValueEqualsCanFail()
61+
public static function dataForJsonValueEqualsCanFail()
6262
{
6363
$json = static::$exampleDocument;
6464

0 commit comments

Comments
 (0)