-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PhpBridge] add PHPUnit 7 support to SymfonyTestsListener #26024
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
73b6f2d
to
c2f62ef
Compare
There's also the question of whether having return types in a file that's being parsed by <PHP 7 will cause an error even if that class isn't to be executed in that runtime. Can anyone comment on that? It might be that this is only appropriate to submit to 4.0+ branches. |
AFAIK, phpunit 7 supports not using void, isn't it? If yes, then we should just do the strict minimum to make the bridge work with phpunit 7 without using features incompatible with our lower supported PHP version, if possible. |
My understanding is that because this class is implementing an interface defined within phpunit/phpunit and that interface defines return types, the return types cannot then be omitted in implementing classes. I suppose conditionally requiring another file where the class is defined might work better, but that also seems quite kludgy. |
Another option might be to use |
Note that on v4, the bridge supports PHP 5.5. That's the special exception (same on 3, where PHP 5.3 is the min for the bridge only, this allows running the latest bridge on most supported versions.) |
Note taken. I'll probably rework using |
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.
I agree that an other usage of the class_alias
is the only way to go for now. I would suggest to decide how long we want to support older, unsupported versions of PHPUnit in this bridge, though...
@Jean85 Was going to rework this PR just now to progressively enhance - i.e. to use |
…P 5 in SymfonyTestsListener
97000d8
to
4c7432a
Compare
@Jean85 I've added another commit to convert this to using |
@shieldo as you can see, my approval tick is not green, I do not have powers here 😄 |
When is this getting merged? |
Thank you @shieldo. |
…(shieldo) This PR was squashed before being merged into the 3.4 branch (closes #26024). Discussion ---------- [PhpBridge] add PHPUnit 7 support to SymfonyTestsListener | Q | A | ------------- | --- | Branch? | 3.4 up to 4.0 for bug fixes <!-- see below --> | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | no <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #26017 <!-- #-prefixed issue number(s), if any --> | License | MIT Add support for the new PHPUnit 7 major release to the PHP Bridge for PHPUnit. I wasn't sure about making a second legacy class here, or the naming of that class - but it seems like something like this would be required. Can re-name if there's a better suggested approach. Commits ------- a175a25 [PhpBridge] add PHPUnit 7 support to SymfonyTestsListener
* | ||
* @final | ||
*/ | ||
class SymfonyTestsListenerWithReturnTypes implements TestListener |
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.
shouldn't this be marked internal as people should only interact with SymfonyTestsListener?
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.
yes! see #26139
This PR was merged into the 3.4 branch. Discussion ---------- [Bridge\PhpUnit] Cleanup BC layer | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Follow up of #26024 Commits ------- c41681c [Bridge\PhpUnit] Cleanup BC layer
Add support for the new PHPUnit 7 major release to the PHP Bridge for PHPUnit.
I wasn't sure about making a second legacy class here, or the naming of that class - but it seems like something like this would be required. Can re-name if there's a better suggested approach.