Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Validator] Add tests forMacAddress
#60422
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
Conversation
src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
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.
-1 for addingassertViolation
. We should encourage using the existingexpectViolationsAt
orbuildViolation()
methods to define precise expected violations instead.
src/Symfony/Component/Validator/Tests/Constraints/MacAddressValidatorTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
MacAddress
Thank you@tcoch. |
6b4fced
intosymfony:7.2Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This PR aims to add some tests to the MacAddress Validator.
[x] Add testing for empty string and null valuesAlready handled withtestNullIsValid
andtestEmptyStringIsValid
methods[x] Add testing of unvalid mac addresses
[x] Create generic methodSee conversation belowassertViolation()
inConstraintValidatorTestCase.php
to test that unvalid values do throw a violation.If this PR is accepted, I'll try to continue this work on other validators. I believe testing empty string and null values is important to ensure no BC occurs, for example.