Skip to content
Snippets Groups Projects
Commit b3c4c423 authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Christian Kuhn
Browse files

[BUGFIX] Harden ValidatorResolver and add functional tests

This patch mainly converts several unit tests with heavy
mocking to functional tests with real fixtures instead of
'eval()'ed classes.

During that seperation two minor bugs have been fixed:

- "resolveValidatorObjectName" tried to find non FQCN
  validators by checking for a colon, an underscore or
  a backslash. That way it found shorthand validators
  like "TYPO3.CMS.Extbase:NotEmpty" and validators
  without any extension reference. e.g. "NotEmpty".

  While that check itself is not a problem, the resolver
  furthermore explodes the validator name by colons,
  which fails for validator names without extension
  reference. This has been fixed by an additional elseif.

- Another small bug has been fixed in the method
  "buildBaseValidatorConjunction".

  While aggregating the validator annotations, the
  method "parseValidatorAnnotation" is called that
  returns an array with the annotation information.
  If the information is built for a method param,
  the key argumentName is set. However, this is not
  the case for properties but following code relied
  on argumentName being present. argumentName is
  now explicitly set to null if not given.

Releases: master
Resolves: #83481
Change-Id: I413b85ad905c19f6ae7daef8f5d97aeeab2edb90
Reviewed-on: https://review.typo3.org/55275


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 91bc637a
Showing
with 468 additions and 400 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment