[Validator] Backported constraint validator tests from 2.5
minor #11647 [Validator] Backported constraint validator tests from 2.5 (webmozart)

This PR was merged into the 2.4 branch.

Discussion
----------

[Validator] Backported constraint validator tests from 2.5

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This PR backports the constraint validator tests from 2.5 to 2.4 to facilitate maintenance. When we adapt a test in 2.4, we can now easily merge the change forward to 2.5.

Commits
-------

845c33c [Validator] Backported constraint validator tests from 2.5