Commit 6b4fced
committed
minor symfony#60422 [Validator] Add tests for
This PR was submitted for the 7.4 branch but it was squashed and merged into the 7.2 branch instead.
Discussion
----------
[Validator] Add tests for `MacAddress`
| Q | A
| ------------- | ---
| Branch? | 7.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Issues | -
| License | MIT
This PR aims to add some tests to the MacAddress Validator.
~[x] Add testing for empty string and null values~ Already handled with `testNullIsValid` and `testEmptyStringIsValid` methods
[x] Add testing of unvalid mac addresses
~[x] Create generic method `assertViolation()` in `ConstraintValidatorTestCase.php` to test that unvalid values do throw a violation.~ See conversation below
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.
Commits
-------
7ce3bb5 [Validator] Add tests for `MacAddress`MacAddress (tcoch)File tree
1 file changed
+24
-0
lines changed- src/Symfony/Component/Validator/Tests/Constraints
1 file changed
+24
-0
lines changedLines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
66 | 79 | | |
67 | 80 | | |
68 | 81 | | |
| |||
76 | 89 | | |
77 | 90 | | |
78 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
79 | 103 | | |
80 | 104 | | |
81 | 105 | | |
| |||
0 commit comments