Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Validator][Tests] Fix AssertingContextualValidator not throwing on remaining expectations#42458
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Validator][Tests] Fix AssertingContextualValidator not throwing on remaining expectations#42458
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedAug 10, 2021
Hey! I think@przemyslaw-bogusz has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
fabpot left a comment
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.
LGTM but I'm not sure about theAssertEquals() part for objects. /cc@xabbuh
9b458d2 to27d0fdaComparenicolas-grekas commentedNov 28, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Shouldn't this be covered by some tests? |
27d0fda tob409cb2Compare…emaining expectations
b409cb2 toaac1013Comparefancyweb commentedDec 31, 2021
I added a test. I reverted the assertEquals() for objects because it's in the case where you mutate the validated value in the validator (for example, the value in the validator is a string, you construct a \DateTime from it and you validate the \DateTime instance). I guess that could be considered as a bad practice so I decided I don't care for now. |
fancyweb commentedFeb 23, 2022
@fabpot@xabbuh@nicolas-grekas I'm attempting another ping on this one because it's a real bug and I would like it to be fixed 😅 |
nicolas-grekas commentedFeb 23, 2022
Thank you@fancyweb. |
Uh oh!
There was an error while loading.Please reload this page.
While working on something I noticed two missing things in the
AssertingContextualValidator.AssertingContextualValidatoris destroyed. Therefore the tests using it always pass, whether the validator actually callsvalidateor not. (for example: comment the->validate()line inAllValidatorand tests still pass)2. When the expected value / value is an object, we should useassertEqualsbecause it cannot logically be the same instance.Ping@xabbuh