symfony: phpunit-bridge breaks with phpunit 9.1.2
Hi,
Since phpunit 9.1.2, the bridge fails with this error:
PHP Fatal error: Uncaught Error: Access to undeclared static property: PHPUnit\Util\Blacklist::$blacklistedClassNames in /dir/bin/.phpunit/phpunit-9.1-0/phpunit:13
Stack trace:
#0 /dir/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php(343): include()
#1 /dir/bin/phpunit(13): require('/home/jmsche/Si...')
#2 {main}
thrown in /dir/bin/.phpunit/phpunit-9.1-0/phpunit on line 13
After a little research, I found the commit that breaks it: https://github.com/sebastianbergmann/phpunit/commit/2b4d7b8bb3fd052095e64999990cc36b63aa0771
So phpunit switches from a public static var to a private constant.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 18
- Comments: 21 (11 by maintainers)
Commits related to this issue
- bug #36539 [PhpUnitBridge] fix compatibility with phpunit 9 (garak) This PR was merged into the 3.4 branch. Discussion ---------- [PhpUnitBridge] fix compatibility with phpunit 9 | Q |... — committed to symfony/symfony by fabpot 4 years ago
- minor #36568 [PhpUnitBridge] Improve dirname usage (Jean85) This PR was merged into the 3.4 branch. Discussion ---------- [PhpUnitBridge] Improve dirname usage | Q | A | ------------- ... — committed to symfony/symfony by fabpot 4 years ago
- fix compatibility with phpunit 9 Issue https://github.com/symfony/symfony/issues/36499 Error appears in symfony 5 when we use phpunit 9.1.3 and symfony/phpunit-bridge 5.0.7 — committed to kudesnic/symfony by deleted user 4 years ago
Sebastian was so kind to suggest a solution on his side: https://github.com/sebastianbergmann/phpunit/issues/4186#issuecomment-617726393
For those who came here for quick solution: set in composer.json fixed phpunit version.
"phpunit/phpunit": "9.1.1"(not"phpunit/phpunit": "^9.0")Can anyone look into an alternative implementation? If none is possible, a report to phpunit might still have to be considered.
Ok, I’ve removed the vendor phpunit package. Now it works with version 9.1.1. Thank you.
Looks like you have PHPUnit installed in
binand invendorat the same time.@jmsche
I would not go as far as blaming
phpunit/phpunitfor breaking changes here -PHPUnit\Util\Blacklisthas been marked as@internal15 months ago.