-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PhpUnitBridge] do not patch the TestCase class with PHPUnit 10+ #58571
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
Conversation
Would it be possible to have a little description in the PR to understand why this change is required please? Would be useful if we need to come back to this someday 😄 |
41cf723
to
9aea66e
Compare
4bda026
to
370f45d
Compare
The PHPUnit\TextUI\Command class was removed in PHPUnit 10. Since the sole purpose of the class extended the base Command class is to register a the Symfony test listener we can completely stop patching it as support for the listener-based event system was also removed in PHPUnit 10.
370f45d
to
eb42716
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easier to review without whitespaces
@@ -109,6 +109,11 @@ | |||
$PHPUNIT_VERSION = $MAX_PHPUNIT_VERSION; | |||
} | |||
|
|||
if (version_compare($PHPUNIT_VERSION, '10.0', '>=') && version_compare($PHPUNIT_VERSION, '11.0', '<')) { | |||
fwrite(STDERR, 'This script does not work with PHPUnit 10.'.\PHP_EOL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwrite(STDERR, 'This script does not work with PHPUnit 10.'.\PHP_EOL); | |
fwrite(STDERR, 'The simple-phpunit script does not work with PHPUnit 10.'.\PHP_EOL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this because when you install the bridge the recipe will create a bin/phpunit
file which one will run. So no pointer about a simple-phpunit
script. My guess was that this is also the reason why the check on line 16 also talks about "This script".
Thank you @xabbuh. |
The PHPUnit\TextUI\Command class was removed in PHPUnit 10. Since the sole purpose of the class extended the base Command class is to register a the Symfony test listener we can completely stop patching it as support for the listener-based event system was also removed in PHPUnit 10.