-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Bridge/PhpUnit] Add PHPUnit 6 support #21694
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
4c982a4
to
7f12fbe
Compare
\PHPUnit_Util_Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\SymfonyTestsListener'] = 1; | ||
} else { | ||
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\DeprecationErrorHandler'] = 1; | ||
Blacklist::$blacklistedClassNames['\Symfony\Bridge\PhpUnit\SymfonyTestsListener'] = 1; |
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.
why not using ::class
here ?
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.
In fact I fogot that the bridge needs to be PHP 5.3 compatible, so I removed all the ::class
7f12fbe
to
64ef41e
Compare
Awesome 👍 |
64ef41e
to
f6915c2
Compare
f6915c2
to
9e0745c
Compare
@@ -41,6 +41,8 @@ public static function register($mode = 0) | |||
return; | |||
} | |||
|
|||
$UtilPrefix = class_exists('PHPUnit_Util_ErrorHandler') ? 'PHPUnit_Util_' : 'PHPUnit\Util\\'; |
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.
Note that I used this upper-first convention in this PR for the compatibility variables that hold the class names to use
+1 for not applying BC policy |
What are the BC breaks here ? |
@stof the type hints on the listener methods and the parent class of the TextUI classes - which all switch to namespaces when phpunit 6 is used |
Well, the typehints are OK IMO. People are not expected to extend these classes, and the calling code is PHPUnit itself. And the signature comes from PHPUnit anyway. |
Same to me, that's what is done here :) |
This PR was merged into the 3.3-dev branch. Discussion ---------- [Bridge/PhpUnit] Add PHPUnit 6 support | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21125 | License | MIT | Doc PR | - This PR makes our phpunit bridge compatible with all namespaced versions of phpunit, from 4.8.35 to 6. It takes another approach than #21668 and #21221, thus replaces them. Tested locally : tests pass when using phpunit 5.7, and fails with v6.0 because our own test suite is not yet compatible with it - but at least it runs nice. If this were handled as usual Symfony component, we would consider some changes to be BC breaks. But in this specific case - a phpunit bridge - it makes no sense to me to apply the bc policy here. I added `@final` and `@internal` annotations to make this clearer. Commits ------- 9e0745c [Bridge/PhpUnit] Add PHPUnit 6 support
This PR was merged into the 2.7 branch. Discussion ---------- Use PHPUnit 6.0 on PHP 7.* test lines | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | need #21694 first | Fixed tickets | - | License | MIT | Doc PR | - Commits ------- 96ecd3c Use PHPUnit 6.0 on PHP 7.* test lines
Just tried the latest update with phpunit 6, I'm getting |
Did you update your local installation of the bridge ( |
Here are relevant parts from my phpunit/phpunit 6.0.8 |
This PR was not merged when 3.2.4 was released. You have to wait for 3.2.5 then. |
In fact, this PR has been merged in 3.3, |
OK, using |
waiting for a stable :D thanks guys |
This PR makes our phpunit bridge compatible with all namespaced versions of phpunit, from 4.8.35 to 6.
It takes another approach than #21668 and #21221, thus replaces them.
Tested locally : tests pass when using phpunit 5.7, and fails with v6.0 because our own test suite is not yet compatible with it - but at least it runs nice.
If this were handled as usual Symfony component, we would consider some changes to be BC breaks. But in this specific case - a phpunit bridge - it makes no sense to me to apply the bc policy here. I added
@final
and@internal
annotations to make this clearer.