Skip to content

Commit 226fd12

Browse files
committed
feature #1549 Upgrade to PHPUnit 11 (wouterj)
This PR was squashed before being merged into the main branch. Discussion ---------- Upgrade to PHPUnit 11 This PR upgrades to PHPUnit 11, including using it's deprecation handling features. Starting with PHPUnit 11, all deprecations features from the bridge are implemented in PHPUnit. This PR also stops using the PhpunitBridge wrapper, which is recommended for applications in the documentation for at least the past 2 years. I've added the configuration to make PHPUnit not report indirect deprecations (those caused by 3rd party code), and to fail on a test that triggers a direct deprecation. I think this is the most sensible default configuration that we should promote. If we agree, I'll create a recipe to do this automatically. --- This PR has mostly been created as a test to see what we need to fix in recipes/code and add to the documentation about PHPUnit 11. Commits ------- 7f57f38 Upgrade to PHPUnit 11
2 parents 9c3f7cc + 7f57f38 commit 226fd12

14 files changed

+1811
-279
lines changed

.github/workflows/lint.yaml

-3
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,5 @@ jobs:
9797
- name: Install dependencies
9898
run: composer install --ansi --no-interaction --no-progress
9999

100-
- name: Install PHPUnit
101-
run: vendor/bin/simple-phpunit install
102-
103100
- name: Run PHPStan
104101
run: vendor/bin/phpstan analyze --no-progress

.github/workflows/tests.yaml

+1-10
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ on:
88

99
env:
1010
fail-fast: true
11-
PHPUNIT_FLAGS: "-v"
12-
SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit"
13-
SYMFONY_DEPRECATIONS_HELPER: 'max[indirect]=52'
1411

1512
permissions:
1613
contents: read
@@ -55,11 +52,5 @@ jobs:
5552
php bin/console sass:build
5653
php bin/console asset-map:compile
5754
58-
- name: "Install PHPUnit"
59-
run: vendor/bin/simple-phpunit install
60-
61-
- name: "PHPUnit version"
62-
run: vendor/bin/simple-phpunit --version
63-
6455
- name: "Run tests"
65-
run: vendor/bin/simple-phpunit ${{ env.PHPUNIT_FLAGS }}
56+
run: vendor/bin/phpunit

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@
2626
###> phpstan/phpstan ###
2727
phpstan.neon
2828
###< phpstan/phpstan ###
29+
30+
###> phpunit/phpunit ###
31+
/phpunit.xml
32+
.phpunit.result.cache
33+
###< phpunit/phpunit ###

bin/phpunit

-23
This file was deleted.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@
5757
"phpstan/phpstan": "^2.0",
5858
"phpstan/phpstan-doctrine": "^2.0",
5959
"phpstan/phpstan-symfony": "^2.0",
60+
"phpunit/phpunit": "^11.3",
6061
"symfony/browser-kit": "^7",
6162
"symfony/css-selector": "^7",
6263
"symfony/debug-bundle": "^7",
6364
"symfony/maker-bundle": "^1.36",
64-
"symfony/phpunit-bridge": "^7",
6565
"symfony/stopwatch": "^7",
6666
"symfony/web-profiler-bundle": "^7",
6767
"twbs/bootstrap": "^5"

0 commit comments

Comments
 (0)