-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Restore default locale in ConstraintValidatorTestCase #44473
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
Conversation
It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you. Cheers! Carsonbot |
src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php
Outdated
Show resolved
Hide resolved
@@ -60,6 +60,7 @@ abstract class ConstraintValidatorTestCase extends TestCase | |||
protected $propertyPath; | |||
protected $constraint; | |||
protected $defaultTimezone; | |||
protected string $locale; |
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.
the property should be defined as protected ?string $locale = null
, or the check line 124 needs to be changed
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 agree, thanks.
I think it's a bug and you should target 4.4. You can take inspiration from https://github.com/symfony/symfony/pull/40932/files. Also, I'm not sure we need protected methods for that. |
Happy to rebase if that's needed, let me know. I added the protected methods to follow the same pattern as used to manage the timezone, can change that if it's overkill though. |
src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php
Outdated
Show resolved
Hide resolved
I agree with @fancyweb about this being a bugfix. |
Let's merge to 4.4. 👍🏻 |
… configured value Previously this change was not resetting the locale after changing it to 'en' - which affected other tests which relied on this value being the configured value (however it was configured). This mirrors the pattern used for the timezone, storing it to be reset on tearDown.
Rebased on 4.4, with suggested updates. |
Thank you @rodnaph. |
Previously this code was not resetting the locale after changing it to
en
- which affected other tests which relied on this value being the configured value (however it was configured).This mirrors the pattern used for the timezone, storing it to be reset on tearDown.
I've based this on 6.1. If it's valid, I'm unsure if it's classed a bug, or needs UPGRADE notes?