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] fixed PHPUnit 8.3 compatibility: method handleError was renamed to __invoke#32933
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
[PhpUnitBridge] fixed PHPUnit 8.3 compatibility: method handleError was renamed to __invoke#32933
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
a505eab tob253eb6Compare
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.
(I rebased this PR for 3.4 and made some fixes)
…as renamed to __invoke
b253eb6 to0c9539fComparekarser commentedAug 5, 2019
I see. Anyways I'm glad I could help you with the research part and learnt some error handling stuff. Still have one question though, why do you return a |
nicolas-grekas commentedAug 5, 2019
the return value is used with |
karser commentedAug 5, 2019
nicolas-grekas commentedAug 5, 2019
Nope, fabbot doesn't work for the bridge. |
nicolas-grekas commentedAug 5, 2019
Thank you@karser. |
…ndleError was renamed to __invoke (karser)This PR was merged into the 3.4 branch.Discussion----------[PhpUnitBridge] fixed PHPUnit 8.3 compatibility: method handleError was renamed to __invoke| Q | A| ------------- | ---| Branch? | 4.3| Bug fix? | yes| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets |#32879 <!-- #-prefixed issue number(s), if any -->| License | MITThe PHPUnit method [handleError](https://github.com/sebastianbergmann/phpunit/blob/8.2.5/src/Util/ErrorHandler.php#L38) was renamed to [__invoke](https://github.com/sebastianbergmann/phpunit/blob/8.3/src/Util/ErrorHandler.php#L71) in v8.3.So we should check in Symfony [DeprecationErrorHandler](https://github.com/symfony/symfony/blob/v4.3.3/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php) if method `handleError` exists, otherwise call `__invoke`It works with phpunit v8.2.5 and 8.3.2.The PHPUnit handler is called when I trigger some error, e.g `iconv('fdsfs', 'fsdfds', '');`Commits-------0c9539f [PhpUnitBridge] fixed PHPUnit 8.3 compatibility: method handleError was renamed to __invoke
| } | ||
| $UtilPrefix =class_exists('PHPUnit_Util_ErrorHandler') ?'PHPUnit_Util_' :'PHPUnit\Util\\'; | ||
| self::$isAtLeastPhpUnit83 =method_exists('PHPUnit\Util\ErrorHandler','__invoke'); |
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.
ErrorHandler::class
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.
nvm. Didn't notice that version were 3.4
| publicstaticfunctiongetPhpUnitErrorHandler() | ||
| { | ||
| if (!self::$isAtLeastPhpUnit83) { | ||
| return (class_exists('PHPUnit_Util_ErrorHandler',false) ?'PHPUnit_Util_' :'PHPUnit\Util\\').'ErrorHandler::handleError'; |
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.
return [ErrorHandler::class, 'handleError'] since#32940
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.
nvm. Didn't notice that version were 3.4

The PHPUnit methodhandleError was renamed to__invoke in v8.3.
So we should check in SymfonyDeprecationErrorHandler if method
handleErrorexists, otherwise call__invokeIt works with phpunit v8.2.5 and 8.3.2.
The PHPUnit handler is called when I trigger some error, e.g
iconv('fdsfs', 'fsdfds', '');