Skip to content

Commit f7ccea9

Browse files
authored
Allow PHPUnit 12
1 parent d39a10c commit f7ccea9

File tree

4 files changed

+57
-13
lines changed

4 files changed

+57
-13
lines changed

.github/workflows/tests.yml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,57 @@ concurrency:
2424

2525
jobs:
2626
tests:
27-
name: "Tests"
27+
name: "Tests PHPUnit 12.x"
2828
runs-on: ${{ matrix.operating-system }}
2929
timeout-minutes: 60
3030

3131
strategy:
3232
fail-fast: false
3333
matrix:
3434
php-version:
35-
- "8.2"
3635
- "8.3"
3736
- "8.4"
3837
- "8.5"
3938
operating-system: [ ubuntu-latest, windows-latest ]
4039

40+
steps:
41+
- name: "Checkout"
42+
uses: actions/checkout@v4
43+
44+
- name: "Install PHP"
45+
uses: "shivammathur/setup-php@v2"
46+
with:
47+
coverage: "none"
48+
php-version: "${{ matrix.php-version }}"
49+
tools: pecl
50+
extensions: ds,mbstring
51+
ini-file: development
52+
ini-values: memory_limit=-1
53+
54+
- name: "Upgrade PHPUnit 12"
55+
shell: bash
56+
run: |
57+
composer require --dev phpunit/phpunit:^12 brianium/paratest:^7.16 symfony/process:^7 symfony/string:^7 symfony/console:^7 --update-with-dependencies --ignore-platform-reqs --working-dir=tests
58+
composer require --dev phpunit/phpunit:^12 sebastian/diff --update-with-dependencies --ignore-platform-reqs
59+
60+
- name: "Check PHP configuration"
61+
run: "vendor/bin/phpunit --check-php-configuration"
62+
63+
- name: "Tests"
64+
run: "php tests/vendor/bin/paratest --runner WrapperRunner --no-coverage"
65+
66+
tests-phpunit11:
67+
name: "Tests PHPUnit 11.x"
68+
runs-on: ${{ matrix.operating-system }}
69+
timeout-minutes: 60
70+
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
php-version:
75+
- "8.2"
76+
operating-system: [ ubuntu-latest, windows-latest ]
77+
4178
steps:
4279
- name: "Checkout"
4380
uses: actions/checkout@v4
@@ -208,7 +245,6 @@ jobs:
208245
fail-fast: false
209246
matrix:
210247
php-version:
211-
- "8.2"
212248
- "8.3"
213249
- "8.4"
214250
operating-system: [ubuntu-latest]
@@ -227,14 +263,20 @@ jobs:
227263
- uses: ./build-infection/.github/actions/setup-php
228264
with:
229265
php-version: "${{ matrix.php-version }}"
230-
extensions: ds,mbstring
266+
php-extensions: ds,mbstring
231267

232268
- uses: "ramsey/composer-install@v3"
233269

234270
- uses: "ramsey/composer-install@v3"
235271
with:
236272
working-directory: "tests/"
237273

274+
- name: "Upgrade PHPUnit with Paratest to speedup coverage generation"
275+
shell: bash
276+
run: |
277+
composer require --dev phpunit/phpunit:^12 brianium/paratest:^7.16 symfony/process:^7 symfony/string:^7 symfony/console:^7 --update-with-dependencies --ignore-platform-reqs --working-dir=tests
278+
composer require --dev phpunit/phpunit:^12 sebastian/diff --update-with-dependencies --ignore-platform-reqs
279+
238280
- uses: "ramsey/composer-install@v3"
239281
with:
240282
working-directory: "build-infection/"
@@ -266,6 +308,7 @@ jobs:
266308
php -d pcov.enabled=1 tests/vendor/bin/paratest \
267309
--passthru-php="'-d' 'pcov.enabled=1'" \
268310
--coverage-xml=tmp/coverage/coverage-xml --log-junit=tmp/coverage/junit.xml
311+
--exclude-source-from-xml-coverage
269312
270313
- name: "Run infection"
271314
run: |

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"react/promise": "^3.2",
3939
"react/socket": "^1.3",
4040
"react/stream": "^1.1",
41-
"sebastian/diff": "^6.0.2",
41+
"sebastian/diff": "^6.0.2 || ^7",
4242
"symfony/console": "^5.4.3",
4343
"symfony/finder": "^5.4.3",
4444
"symfony/polyfill-intl-grapheme": "^1.23",

composer.lock

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="tests/bootstrap.php" cacheResult="false" colors="true" executionOrder="random" failOnRisky="true" failOnWarning="true" failOnEmptyTestSuite="true" beStrictAboutChangesToGlobalState="true" beStrictAboutOutputDuringTests="true" cacheDirectory="tmp/.phpunit.cache" beStrictAboutCoverageMetadata="true" displayDetailsOnPhpunitDeprecations="true" displayDetailsOnIncompleteTests="true">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" bootstrap="tests/bootstrap.php" cacheResult="false" colors="true" executionOrder="random" failOnRisky="true" failOnWarning="true" failOnPhpunitWarning="false" failOnEmptyTestSuite="true" beStrictAboutChangesToGlobalState="true" beStrictAboutOutputDuringTests="true" cacheDirectory="tmp/.phpunit.cache" beStrictAboutCoverageMetadata="true" displayDetailsOnPhpunitDeprecations="true" displayDetailsOnIncompleteTests="true">
33
<extensions>
44
<bootstrap class="PHPStan\Testing\PHPUnit\PHPStanPHPUnitExtension"/>
55
</extensions>

0 commit comments

Comments
 (0)