Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[PhpUnitBridge] Adjust PHPUnit class_alias check to also check for namespaced class#22925
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas left a comment
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.
👍
fabpot commentedMay 27, 2017
Thank you @GawainLynch. |
…heck for namespaced class (GawainLynch)This PR was merged into the 3.3 branch.Discussion----------[PhpUnitBridge] Adjust PHPUnit class_alias check to also check for namespaced class| Q | A| ------------- | ---| Branch? | 3.3| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |Some projects, e.g. [Codeception](https://github.com/Codeception/Codeception/blob/2.3.2/shim.php#L47), also alias pre-PHPUnit namespaces leading to a collision and exceptions such as:```[PHPUnit\Framework\Exception (2)]Cannot declare class Symfony\Bridge\PhpUnit\SymfonyTestsListener, because the name isalready in use```This just add a check for the namespaced class, and exits if either aliased or exists.Commits-------7ba3afd Adjust PHPUnit class_alias check to also check for namespaced class
nicolas-grekas commentedMay 28, 2017
This breaks the bridge, see#22929 for reversal. |
…ias check (nicolas-grekas)This PR was merged into the 4.0-dev branch.Discussion----------Revert "bug#22925 [PhpUnitBridge] Adjust PHPUnit class_alias checkThis reverts commitcfb090d, reversingchanges made to4e8f403.| Q | A| ------------- | ---| Branch? | 3.3| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -PR#22925 made the bridge fail with:> Fatal error: Declaration of Symfony\Bridge\PhpUnit\SymfonyTestsListener::addSkippedTest() must be compatible with that of PHPUnit_Framework_TestListener::addSkippedTest() in /home/travis/build/symfony/symfony/vendor/symfony/phpunit-bridge/SymfonyTestsListener.php on line 32Seehttps://travis-ci.org/symfony/symfony/builds/236863221 on 3.3andhttps://travis-ci.org/symfony/symfony/builds/236863238 on 3.4Commits-------934c0c0 Revert "bug#22925 [PhpUnitBridge] Adjust PHPUnit class_alias check to also check for namespaced class (GawainLynch)"
…ias check (nicolas-grekas)This PR was merged into the 3.3 branch.Discussion----------Revert "bug#22925 [PhpUnitBridge] Adjust PHPUnit class_alias checkThis reverts commitcfb090d, reversingchanges made to4e8f403.| Q | A| ------------- | ---| Branch? | 3.3| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -PR#22925 made the bridge fail with:> Fatal error: Declaration of Symfony\Bridge\PhpUnit\SymfonyTestsListener::addSkippedTest() must be compatible with that of PHPUnit_Framework_TestListener::addSkippedTest() in /home/travis/build/symfony/symfony/vendor/symfony/phpunit-bridge/SymfonyTestsListener.php on line 32Seehttps://travis-ci.org/symfony/symfony/builds/236863221 on 3.3andhttps://travis-ci.org/symfony/symfony/builds/236863238 on 3.4Commits-------934c0c0 Revert "bug#22925 [PhpUnitBridge] Adjust PHPUnit class_alias check to also check for namespaced class (GawainLynch)"
* 3.3: Revert "bug#22925 [PhpUnitBridge] Adjust PHPUnit class_alias check to also check for namespaced class (GawainLynch)"
nicolas-grekas commentedMay 29, 2017
@GawainLynch please open an other PR if you want to give it another try. |
GwendolenLynch commentedMay 29, 2017
@nicolas-grekas I will, do. Bolt uses Codeception for acceptance tests, and we've locked at 3.2.1 (before they added that alias), but that makes things "interesting" in the future 😉 I'll think though approach for a bit, and then try try try again 😄 |
stof commentedMay 29, 2017
A solution might be to check the PHPUnit version instead of relying on class existence to detect PHPUnit versions |
javiereguiluz commentedMay 29, 2017
@stof but, if I'm right, for Symfony we always do the opposite of what you are proposing: instead of relying on version numbers (for Symfony kernel, Symfony Forms, etc.) we always check if some class exists or if some method exists, etc. |
Some projects, e.g.Codeception, also alias pre-PHPUnit namespaces leading to a collision and exceptions such as:
This just add a check for the namespaced class, and exits if either aliased or exists.