This is a subissue of #2012776: [META] Improve validation constraint test coverage.
This is a test for the Constraint Validation: AllowedValuesConstraintValidator
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | d8_allowed_values_constraint.interdiff.txt | 691 bytes | fago |
| #14 | d8_allowed_values_constraint.patch | 2.55 KB | fago |
| #9 | d8_allowed_values.patch | 2.54 KB | fago |
| #9 | d8_allowed_values.interdiff.txt | 1.97 KB | fago |
| #4 | drupal-test_for_AllowedValuesConstraintValidator-2142981-4.patch | 2.65 KB | mariancalinro |
Comments
Comment #1
mariancalinro commentedComment #2
mariancalinro commentedComment #3
fagoPatch looks good. Some remarks:
constraints
also, it doesn't test constraints for the validator, I'd suggest:
"Tests the AllowedValues validation constraint validator."
Name should describe the constraint it's testing.
maybe just use the same description as for the class, or shortly describe how it tests it, e.g. by specifying allowed values for an integer.
Comment #4
mariancalinro commentedComment #7
mariancalinro commented4: drupal-test_for_AllowedValuesConstraintValidator-2142981-4.patch queued for re-testing.
Comment #8
fagoThanks! The test itself looks great, just a few remarks:
It's all about testing, so just "Allowed values constraint" should be fine.
unnecsesary empty line
Summary should be only one line not exceeding 80chars.
So best split it up into a short summary and a longer explanation.
Comment #9
fagoRe-rolled to work again with latest HEAD + addressed the points.
Comment #10
fago9: d8_allowed_values.patch queued for re-testing.
Comment #11
yched commentedI really wish we would get #2132145: Rename 'typed_data' / Drupal::typedData() to 'typed_data_manager' / Drupal::typedDataManager in :-/
Otherwise no reason not to RTBC this patch, but dear core committers, can we maybe has a commit over there first ?
Comment #12
berdir9: d8_allowed_values.patch queued for re-testing.
Comment #14
fagoRe-rolled to account for the manager service rename.
Comment #15
yched commentedSame remark as #2142991-10: Test for ComplexDataConstraintValidator about $this->typedData, but otherwise RTBC.
Comment #16
webchickCommitted and pushed to 8.x. Thanks!
I don't understand yched's comment enough to say one way or the other, but it sounds like we could do that rename as a follow-up for all of these tests to keep them consistent? Or should I roll these back?
Comment #17
fagoIt's just a simple variable re-name, I'll do a quick follow-up for all of those once the last one is in as well.
Created #2169467: Improve typedData manager variable name in ConstaintValidation tests.