Add separate constraint tests in another issue including complete violation tests (message, property path, root, ..) for every constraint that's customized in any way by us.
There are separate subissues for the following validators:
#2142981: Test for AllowedValuesConstraintValidator
#2142989: Test for BundleConstraintValidator
#2142991: Test for ComplexDataConstraintValidator
#2142993: Test for EntityChangedConstraintValidator
#2142995: PrimitiveTypeConstraintValidator does not validate some values correctly
#2142997: Test for ValidReferenceConstraintValidator
#2142999: Test for EntityTypeConstraintValidator
For the following validators no test is needed, as they implement no logic:
CountConstraintLengthConstraintRangeConstraint
Validators without tests:
- ReferenceAccessConstraintValidator
- UniqueFieldValueValidator
- BookOutlineConstraintValidator
- CommentNameConstraintValidator - it looks like there was an attempt to test it but was turn off in #2832013: CommentResourceTestBase::testPostDxWithoutCriticalBaseFields() always fails on PHP 5.6 & MySQL 5.5 (works fine on other PHP versions)
- DateTimeFormatConstraintValidator
- LinkTypeConstraintValidator
- OEmbedResourceConstraintValidator
- MenuSettingsConstraintValidator
- PathAliasConstraintValidator
- UserMailRequiredValidator
- UserNameConstraintValidator
- DeletedWorkspaceConstraintValidator
- EntityWorkspaceConflictConstraintValidator
Issue fork drupal-2012776
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
fagoComment #2
fagoLet's make this a meta issue and link sub-issues for individual constraints here.
Comment #3
mariancalinro commentedComment #10
rosk0It feels like I'm missing something and all those validators are actually have test coverage, but I wasn't able to identify corresponding tests so adding them to be on a safe side.
Also there is a bug report about UniqueFieldValueValidator and entity reference fields here #2973455: Unique field constraint does not work with any field main property name that is not "value".