symfony: [PhpUnitBridge] not compatible with latest phpunit
| Q | A |
|---|---|
| Bug report? | no |
| Feature request? | yes |
| BC Break report? | yes |
| RFC? | yes |
| Symfony version | 3.3.*-dev |
I tried to use phpunit-bridge with latest phpunit (^6.0@dev, will be stable next month), it does not work due to changes in phpunit itself.
Error: Class 'PHPUnit_Util_ErrorHandler' not found.
Since phpunit (at last) switched to namespaces, the current class is PHPUnit\Util\ErrorHandler, not PHPUnit_Util_ErrorHandler any more.
I see that supporting this is a BC break, so maybe we could provide a compatibility layer to old phpunit?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 30 (29 by maintainers)
While at lunch 😄 I got an other idea about a different approach to solve this issue:
Symfony\Bridge\PhpUnit\Compatnamespace with same name of PHPUnit 6 classes\PHPUnit_Util_ErrorHandlerAKAPHPUnit\Util\ErrorHandlerbecomesSymfony\Bridge\PhpUnit\Compat\Util\ErrorHandlerif (class_exist), feel free to suggest other approaches)\PHPUnit_Util_ErrorHandler::handleError(...);is replaced byErrorHandler::handleError(...);plususe Symfony\Bridge\PhpUnit\Compat\Util\ErrorHandler;Advantages:
usestatementusestatements:use Symfony\Bridge\PhpUnit\Compat\*touse PhpUnit\*Just a quick update to notice that phpunit 6 is now stable.
I guess it shouldn’t be too hard to make the bridge compatible with PHPUnit 6. I try to look into it tonight.