[Validator] added addConstraint() to ErrorElement

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | (Tests missing)
| Fixed tickets | #1200
| License       | MIT

This adds the missing addConstraint() method to ErrorElement, allowing for directly registering the Constraint and not only by using assertX()