[Validator] Simplified testing of violations
[Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5
minor #12015 [Validator] Simplified testing of violations (webmozart)

This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Simplified testing of violations

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

I simplified the assertion of violations in preparation of a replacement PR for #7276.

Commits
-------

8e5537b [Validator] Simplified testing of violations
Merge branch '2.3' into 2.4

* 2.3:
  [Form] Removed constructor argument from FormTypeHttpFoundationExtension for forward compatibility with 2.5
  [Validator] Simplified testing of violations