-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
phpunit-bridge ignores <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled" /> in phpunit.xml #28519
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
Comments
I've fiddle around a bit. Maybe DeprecationErrorHandler.php:57 is missing a test for DeprecationErrorHandler::MODE_DISABLED? |
"disabled" mode is taken into account in https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/PhpUnit/bootstrap.php#L38 - as you can see, this comes earlier than reading the phpunit.xml file. |
Actually, As far as I understand the code - and I might be completely off on this - the problem is, that in https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php#L104 the mode parameter is reset to 0 because of https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php#L57 not recognizing "disabled" as a valid value for mode, trying to parse an integer, fails and falls back to 0. In consequence mode will never be set to "disabled" in https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php#L105. |
That's why I used |
…g phpunit.xml file (soerenbernstein) This PR was submitted for the master branch but it was squashed and merged into the 3.4 branch instead (closes #28524). Discussion ---------- [PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file Fixing #28519 | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | don't know | Fixed tickets | #28519 | License | MIT Commits ------- 3cd929b [PhpUnitBridge] fix disabling DeprecationErrorHandler using phpunit.xml file
Symfony version(s) affected: all ?
Description
phpunit-bridge ignores the value "disabled" for the environment variable SYMFONY_DEPRECATIONS_HELPER when set in phpunit.xml. The value "weak" works as expected.
Also, setting this environment variable in the shell works as expected.
Tested with phpunit-bridge-4.1.4
How to reproduce
set in phpunit.xml
and run a test which will cause a deprecation warning.
The text was updated successfully, but these errors were encountered: