-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PHPUnit] SYMFONY_DEPRECATIONS_HELPER var is in the wrong place (.env.test) #30047
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
Reading from SYMFONY_DEPRECATIONS_HELPER should be lazy, so it should work. Maybe a bug to find and kill? |
@nicolas-grekas What is the best way to fix this? |
I think we should try fixing this in the bridge if possible, by not resolving the mode until a deprecation is actually triggered. Doable? |
@nicolas-grekas Yes, I'll create a PR. |
3.4! |
…eprecation is triggered (ossinkine) This PR was merged into the 3.4 branch. Discussion ---------- Don't resolve the Deprecation error handler mode until a deprecation is triggered | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30047 | License | MIT <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> If an error happens before `.env.test` is loaded the mode is set to 0 and cached so SYMFONY_DEPRECATIONS_HELPER is not read from `.env.test`. Commits ------- 1090b8c Don't resolve the Deprecation error handler mode until a deprecation is triggered
@ossinkine @nicolas-grekas Hello there, sorry for writing in this closed issue for which a fix exists, but I see that although we have a merged fix for this, which is referenced in the new 4.2.4 release notes, it did in fact not land in the 4.2 branch at all. The issue still exists with the PHPUnit-Bridge in v4.2.4 . It seems the merge from the 3.4 branch to the 4.2 one wasn't done correctly or something, though I'm not sure about this. I can see at least that the fix in the DeprecationErrorHandler.php file is in the master branch (though looking slightly different there), so I wasn't sure if I should open a new issue or not. |
…eprecation is triggered (Emmanuel BORGES) This PR was squashed before being merged into the 4.2 branch (closes #30490). Discussion ---------- Don't resolve the Deprecation error handler mode until a deprecation is triggered | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30047 | License | MIT Don't resolve the Deprecation error handler mode until a deprecation is triggered Commits ------- f3a5b74 Don't resolve the Deprecation error handler mode until a deprecation is triggered
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected:
Description
Phpunit recipe contains SYMFONY_DEPRECATIONS_HELPER env var inside .env.test file. But it doesn't work here.
How to reproduce
SYMFONY_DEPRECATIONS_HELPER=weak
inside .env.test (or .env.test.local)rm -rf var/cache
bin/phpunit
Then you will see the "Remaining deprecation notices ..." message and exit code 1
Possible Solution
Put SYMFONY_DEPRECATIONS_HELPER variable inside phpunit.xml.dist file
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak" />
The text was updated successfully, but these errors were encountered: