Review main Merged

55275[BUGFIX] Harden ValidatorResolver and add functional tests

Alexander Schnitzler CR +2 V +2 Hard +468 −400 updated 01/13/18, 12:36

Commit message

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.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 9