Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to PHPUnit 11 #1549

Merged
merged 1 commit into from
Mar 19, 2025
Merged

Upgrade to PHPUnit 11 #1549

merged 1 commit into from
Mar 19, 2025

Conversation

wouterj
Copy link
Member

@wouterj wouterj commented Dec 12, 2024

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.

@wouterj wouterj force-pushed the phpunit branch 2 times, most recently from 217753f to 861a7b9 Compare December 12, 2024 23:48
@javiereguiluz
Copy link
Member

Wouter, if you have some time, please try to rebase this PR so we can merge it. Thanks a lot!

@wouterj wouterj force-pushed the phpunit branch 2 times, most recently from 190f09e to bebdeae Compare March 6, 2025 12:49
@wouterj
Copy link
Member Author

wouterj commented Mar 6, 2025

Rebased. The test seem to be broken in main though.

Also, I'm not sure on what the policies for this project are, but this PR is not in line with the Flex recipes for the phpunit configuration. I was thinking we first have to fix Flex before we could merge this?

@wouterj wouterj marked this pull request as ready for review March 6, 2025 15:40
@rosier
Copy link
Contributor

rosier commented Mar 9, 2025

The lines https://github.com/symfony/demo/blob/main/phpstan.dist.neon#L8-L10 can be removed.

This should fix the Lint / PHPStan test

@javiereguiluz javiereguiluz merged commit 226fd12 into symfony:main Mar 19, 2025
7 of 8 checks passed
@javiereguiluz
Copy link
Member

Thanks Wouter 🙇🙇

Jan, I removed the lines while merging. Thanks.

@wouterj wouterj deleted the phpunit branch March 19, 2025 11:31
@alexander-schranz
Copy link

As we do this in the demo I think we should adjust also the test-pack: symfony/test-pack#24

@coldic3
Copy link

coldic3 commented Mar 23, 2025

This is no longer valid https://github.com/symfony/demo#tests

The bin/phpunit together with the symfony/phpunit-bridge package has been removed in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants