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

Support PHPUnit 10 #64

Open
3 of 5 tasks
stof opened this issue Feb 14, 2023 · 8 comments
Open
3 of 5 tasks

Support PHPUnit 10 #64

stof opened this issue Feb 14, 2023 · 8 comments

Comments

@stof
Copy link
Member

stof commented Feb 14, 2023

this is a meta-issue tracking blockers for using PHPUnit 10:

@uuf6429
Copy link
Member

uuf6429 commented Aug 4, 2023

Regarding the last point, to be clear: getName() got renamed to name() (not removed). I didn't get what was meant with two methods instead of flag, though. If that can be clarified, someone could maybe implement that change already.

@stof
Copy link
Member Author

stof commented Aug 4, 2023

Well, the last point is not the hard block. Migrating to the new method will be easy. But it is not high priority as long as the other points are not resolved.

@uuf6429
Copy link
Member

uuf6429 commented Aug 4, 2023

I'll consider jumping into some of those tasks.

On a totally unrelated sidenote, there are plenty of finished things ready to be merged (some of which are blocking the classic-webdriver) - what's the situation in general? Is it ok to merge my own PR given review approval?

@aik099
Copy link
Member

aik099 commented Nov 4, 2024

symfony/symfony#49069 to support PHPUnit 10 in symfony/phpunit-bridge (that we rely on to report deprecations)

@stof , The issue was merged. Maybe we can proceed with PHPUnit 10 support now?

@stof
Copy link
Member Author

stof commented Jan 14, 2025

To be exact, Symfony has decided to use the native deprecation handling features of PHPUnit 11+ (skipping PHPUnit 10 because the deprecation handling it had was not yet feature-equivalent). The bridge has not been reimplemented to support PHPUnit 10+ with the same user-facing API than older versions (which was not possible anyway due to the changes in PHPUnit).

However, it won't be possible to have the same phpunit.xml file for configuring support for PHPUnit 8 or 9.5 with the bridge on one side and PHPUnit 11 (without the bridge as the only feature we use in the bridge is the deprecation reporting) on the other side. Shipping phpunit config files with non-default names and forcing to use phpunit -c ... to use the right one would be a pain for contributors (and maybe also for keeping the CI setup understandable). So it would be better to keep only one family of PHPUnit versions.
Migrating fully to PHPUnit 11 requires bumping the min PHP version to PHP 8.2, which needs a discussion on the main Mink repo first (we cannot release a version of Mink advocating support for PHP 8.1 if our CI does not test it. That's the worse situation for sure).

@aik099
Copy link
Member

aik099 commented Jan 14, 2025

Since the older PHPUnit versions don't work on newer PHP versions and vice versa I had to support all PHPUnit versions and due to radical phpunit.xml format changes in each upcoming PHPUnit version on my projects I was forced to have different PHPUnit configs just to make the build pass. The build file looks like this: https://github.com/console-helpers/svn-buddy/blob/master/.github/workflows/main.yml (note the phpunit_config matrix variable and its usage).

P.S.
Since PHPUnit 10+ any inconsistency in the phpunit.xml file (e.g. a key present to support older PHPUnit version) fails the build because PHPUnit returns a non-zero exit code.

@stof
Copy link
Member Author

stof commented Jan 14, 2025

PHPunit 9.6 works on newer PHP versions. That's exactly what "Life support" means in PHPUnit.

@aik099
Copy link
Member

aik099 commented Jan 14, 2025

PHPunit 9.6 works on newer PHP versions. That's exactly what "Life support" means in PHPUnit.

Ha-ha. Although PHPUnit does strictly follow SemVer: in major releases BC breaks will occur 😞 .

Without the https://github.com/Yoast/PHPUnit-Polyfills library (I guess the author has similar issues with supporting non-maintained PHP version) it would be painfully hard to have a test suite that will work on every PHPUnit version.

Multiple phpunit.xml usage during the build is a small price to pay to avoid doing IFs all over test suite for supporting different PHPUnit versions, that tend to drop/rename assertion methods quite frequently.

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

No branches or pull requests

3 participants