-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Make tests support phpunit 8 #32842
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
Make tests support phpunit 8 #32842
Conversation
88e284d
to
144abeb
Compare
This PR was merged into the 3.4 branch. Discussion ---------- Make tests support phpunit 8 | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Having `void` on setUp/tearDown is **really** painful /cc @sebastianbergmann FYI This works around the issue by adding a new trait to the phpunit-bridge: `SetUpTearDownTrait`. Another reason why the bridge is so useful... With this change, we should have the same codebase be able to run under phpunit 4.8 (used with PHP5.5) up to phpunit 8.2 (used with PHP7.4). :crossed_fingers: :face_with_head_bandage: One more step towards PHP 7.4 support. Commits ------- 81af97f Make tests support phpunit 8
This looks like a huge source of conflicts. Are we sure we want to introduce that? The alternatives would be to not support phpunit 8 or only do these changes in 4.4 and up. |
This is merged up to master now so that conflicts are resolved once for all. We have to support phpunit 8 because that's the only way to PHP 7.4, which we want to support on branch 3.4... |
This is a recurring problem: every PHPUnit version supports just a small range of PHP versions. |
@@ -32,6 +32,11 @@ abstract class KernelTestCase extends TestCase | ||
*/ | ||
protected static $kernel; | ||
|
||
private function doTearDown() |
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.
Maybe it doesn't bother too many people, but the visibility of this method has been changed from v4.3.3:
protected function doTearDown(): void |
It broke our builds in API Platform.
Having
void
on setUp/tearDown is really painful /cc @sebastianbergmann FYIThis works around the issue by adding a new trait to the phpunit-bridge :
ForwardCompatTestTrait
.Another reason why the bridge is so useful...
With this change, we should have the same codebase be able to run under phpunit 4.8 (used with PHP5.5) up to phpunit 8.2 (used with PHP7.4).
🤞 🤕
One more step towards PHP 7.4 support.