[BUGFIX] Harden ValidatorResolver and add functional tests 75/55275/4
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Fri, 5 Jan 2018 11:21:52 +0000 (12:21 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 13 Jan 2018 12:36:01 +0000 (13:36 +0100)
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: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/extbase/Classes/Validation/ValidatorResolver.php
typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Controller/TestController.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Domain/Model/AnotherModel.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Domain/Model/Model.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Domain/Validator/ModelValidator.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Validation/Validator/CustomValidator.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Validation/Validator/CustomValidatorThatDoesNotImplementValidatorInterfaceValidator.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Functional/Validation/ValidatorResolverTest.php [new file with mode: 0644]
typo3/sysext/extbase/Tests/Unit/Validation/ValidatorResolverTest.php

index ee20f14..7e0d5a5 100644 (file)
@@ -305,11 +305,9 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface
                         $parsedAnnotations = $this->parseValidatorAnnotation($validateValue);
 
                         foreach ($parsedAnnotations['validators'] as $validator) {
-                            array_push($validateAnnotations, [
-                                'argumentName' => $parsedAnnotations['argumentName'],
-                                'validatorName' => $validator['validatorName'],
-                                'validatorOptions' => $validator['validatorOptions']
-                            ]);
+                            $validateAnnotation = $validator;
+                            $validateAnnotation['argumentName'] = $parsedAnnotations['argumentName'] ?? null;
+                            $validateAnnotations[] = $validateAnnotation;
                         }
                     }
                 }
@@ -437,7 +435,7 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface
      */
     protected function resolveValidatorObjectName($validatorName)
     {
-        if (strpos($validatorName, ':') !== false || strpbrk($validatorName, '_\\') === false) {
+        if (strpos($validatorName, ':') !== false) {
             // Found shorthand validator, either extbase or foreign extension
             // NotEmpty or Acme.MyPck.Ext:MyValidator
             list($extensionName, $extensionValidatorName) = explode(':', $validatorName);
@@ -456,6 +454,9 @@ class ValidatorResolver implements \TYPO3\CMS\Core\SingletonInterface
                 // Shorthand built in
                 $possibleClassName = 'TYPO3\\CMS\\Extbase\\Validation\\Validator\\' . $this->getValidatorType($validatorName);
             }
+        } elseif (strpbrk($validatorName, '_\\') === false) {
+            // Shorthand built in
+            $possibleClassName = 'TYPO3\\CMS\\Extbase\\Validation\\Validator\\' . $this->getValidatorType($validatorName);
         } else {
             // Full qualified
             // Tx_MyExt_Validation_Validator_MyValidator or \Acme\Ext\Validation\Validator\FooValidator
diff --git a/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Controller/TestController.php b/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Controller/TestController.php
new file mode 100644 (file)
index 0000000..0ff624d
--- /dev/null
@@ -0,0 +1,28 @@
+<?php
+declare(strict_types=1);
+namespace TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Controller;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
+
+/**
+ * Fixture controller
+ */
+class TestController extends ActionController
+{
+    public function noParamsAction()
+    {
+    }
+}
diff --git a/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Domain/Model/AnotherModel.php b/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Domain/Model/AnotherModel.php
new file mode 100644 (file)
index 0000000..e4cc1aa
--- /dev/null
@@ -0,0 +1,30 @@
+<?php
+declare(strict_types=1);
+namespace TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Domain\Model;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
+
+/**
+ * Fixture model
+ */
+class AnotherModel extends AbstractEntity
+{
+    /**
+     * @var string
+     * @validate NotEmpty
+     */
+    protected $foo;
+}
diff --git a/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Domain/Model/Model.php b/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Domain/Model/Model.php
new file mode 100644 (file)
index 0000000..e99287a
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+declare(strict_types=1);
+namespace TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Domain\Model;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
+
+/**
+ * Fixture model
+ */
+class Model extends AbstractEntity
+{
+    /**
+     * @var string
+     * @validate StringLength(minimum=1), StringLength(maximum=10)
+     * @validate NotEmpty
+     */
+    protected $foo;
+
+    /**
+     * @var int
+     * @validate \TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Validation\Validator\CustomValidator
+     */
+    protected $bar;
+
+    /**
+     * @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage
+     */
+    protected $baz;
+
+    /**
+     * @var \TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Domain\Model\AnotherModel
+     */
+    protected $qux;
+}
diff --git a/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Domain/Validator/ModelValidator.php b/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Domain/Validator/ModelValidator.php
new file mode 100644 (file)
index 0000000..670fb82
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+declare(strict_types=1);
+namespace TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Domain\Validator;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Fixture model validator
+ */
+class ModelValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
+{
+    /**
+     * @param mixed $value
+     */
+    protected function isValid($value)
+    {
+    }
+}
diff --git a/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Validation/Validator/CustomValidator.php b/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Validation/Validator/CustomValidator.php
new file mode 100644 (file)
index 0000000..d75ff58
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+declare(strict_types=1);
+namespace TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Validation\Validator;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Fixture custom validator
+ */
+class CustomValidator extends \TYPO3\CMS\Extbase\Validation\Validator\AbstractValidator
+{
+    /**
+     * @param mixed $value
+     */
+    protected function isValid($value)
+    {
+    }
+}
diff --git a/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Validation/Validator/CustomValidatorThatDoesNotImplementValidatorInterfaceValidator.php b/typo3/sysext/extbase/Tests/Functional/Validation/Fixture/Validation/Validator/CustomValidatorThatDoesNotImplementValidatorInterfaceValidator.php
new file mode 100644 (file)
index 0000000..1abd16c
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+declare(strict_types=1);
+namespace TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Validation\Validator;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+/**
+ * Fixture custom validator
+ */
+class CustomValidatorThatDoesNotImplementValidatorInterfaceValidator
+{
+    /**
+     * @param mixed $value
+     */
+    protected function isValid($value)
+    {
+    }
+}
diff --git a/typo3/sysext/extbase/Tests/Functional/Validation/ValidatorResolverTest.php b/typo3/sysext/extbase/Tests/Functional/Validation/ValidatorResolverTest.php
new file mode 100644 (file)
index 0000000..2247dd2
--- /dev/null
@@ -0,0 +1,253 @@
+<?php
+declare(strict_types=1);
+namespace TYPO3\CMS\Extbase\Tests\Functional\Validation;
+
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Extbase\Object\ObjectManager;
+use TYPO3\CMS\Extbase\Reflection\ReflectionService;
+use TYPO3\CMS\Extbase\Validation\Exception\NoSuchValidatorException;
+use TYPO3\CMS\Extbase\Validation\Validator\CollectionValidator;
+use TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator;
+use TYPO3\CMS\Extbase\Validation\Validator\GenericObjectValidator;
+use TYPO3\CMS\Extbase\Validation\Validator\NotEmptyValidator;
+use TYPO3\CMS\Extbase\Validation\Validator\StringLengthValidator;
+use TYPO3\CMS\Extbase\Validation\ValidatorResolver;
+
+/**
+ * Test case
+ */
+class ValidatorResolverTest extends \TYPO3\TestingFramework\Core\Functional\FunctionalTestCase
+{
+    /**
+     * @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface
+     */
+    private $validatorResolver;
+
+    protected function setUp()
+    {
+        parent::setUp();
+
+        $this->validatorResolver = $this->getAccessibleMock(
+            ValidatorResolver::class,
+            ['dummy']
+        );
+        $this->validatorResolver->injectObjectManager(GeneralUtility::makeInstance(ObjectManager::class));
+        $this->validatorResolver->injectReflectionService(GeneralUtility::makeInstance(ReflectionService::class));
+    }
+
+    /**
+     * @return array
+     */
+    public function namespacedShorthandValidatorNamesDataProvider(): array
+    {
+        return [
+            'TYPO3.CMS.Extbase:NotEmpty' => [
+                'TYPO3.CMS.Extbase:NotEmpty',
+                NotEmptyValidator::class
+            ],
+            'TYPO3.CMS.Extbase.Tests.Functional.Validation.Fixture:Custom' => [
+                'TYPO3.CMS.Extbase.Tests.Functional.Validation.Fixture:Custom',
+                Fixture\Validation\Validator\CustomValidator::class
+            ]
+        ];
+    }
+
+    /**
+     * @test
+     * @dataProvider namespacedShorthandValidatorNamesDataProvider
+     *
+     * @param string $validatorName
+     * @param string $expectedClassName
+     */
+    public function resolveValidatorObjectNameWithShortHandNotationReturnsValidatorNameIfClassExists(string $validatorName, string $expectedClassName)
+    {
+        static::assertEquals(
+            $expectedClassName,
+            $this->validatorResolver->_call('resolveValidatorObjectName', $validatorName)
+        );
+    }
+
+    /**
+     * @test
+     */
+    public function resolveValidatorObjectNameWithShortHandNotationThrowsExceptionIfClassDoesNotExist()
+    {
+        $this->expectException(NoSuchValidatorException::class);
+        $this->expectExceptionCode(1365799920);
+
+        $validatorName = 'TYPO3.CMS.Extbase.Tests.Functional.Validation.Fixture:NonExistentValidator';
+        $this->validatorResolver->_call('resolveValidatorObjectName', $validatorName);
+    }
+
+    /**
+     * @test
+     */
+    public function resolveValidatorObjectNameWithShortHandNotationReturnsValidatorNameIfClassExistsButDoesNotImplementValidatorInterface()
+    {
+        $this->expectException(NoSuchValidatorException::class);
+        $this->expectExceptionCode(1365776838);
+
+        $validatorName = 'TYPO3.CMS.Extbase.Tests.Functional.Validation.Fixture:CustomValidatorThatDoesNotImplementValidatorInterface';
+        $this->validatorResolver->_call('resolveValidatorObjectName', $validatorName);
+    }
+
+    /**
+     * @test
+     */
+    public function resolveValidatorObjectNameReturnsValidatorNameForFullQualifiedValidatorName()
+    {
+        $validatorName = Fixture\Validation\Validator\CustomValidator::class;
+        $className = Fixture\Validation\Validator\CustomValidator::class;
+
+        static::assertEquals(
+            $className,
+            $this->validatorResolver->_call('resolveValidatorObjectName', $validatorName)
+        );
+    }
+
+    /**
+     * @test
+     */
+    public function resolveValidatorObjectNameReturnsValidatorNameForFullQualifiedValidatorNameWithLeadingBackslash()
+    {
+        $validatorName = '\\' . Fixture\Validation\Validator\CustomValidator::class;
+        $className = Fixture\Validation\Validator\CustomValidator::class;
+
+        static::assertEquals(
+            $className,
+            $this->validatorResolver->_call('resolveValidatorObjectName', $validatorName)
+        );
+    }
+
+    /**
+     * @test
+     */
+    public function resolveValidatorObjectNameThrowsNoSuchValidatorExceptionIfClassDoesNotExist()
+    {
+        $className = $this->getUniqueId('Foo\\Bar');
+        $this->expectException(NoSuchValidatorException::class);
+        $this->expectExceptionCode(1365799920);
+        $this->validatorResolver->_call('resolveValidatorObjectName', $className);
+    }
+
+    /**
+     * @test
+     */
+    public function buildMethodArgumentsValidatorConjunctionsReturnsEmptyArrayIfMethodHasNoArguments()
+    {
+        $controller = GeneralUtility::makeInstance(ObjectManager::class)->get(Fixture\Controller\TestController::class);
+        $result = $this->validatorResolver->buildMethodArgumentsValidatorConjunctions(
+            $controller,
+            'noParamsAction'
+        );
+
+        static::assertSame([], $result);
+    }
+
+    /**
+     * @test
+     */
+    public function buildBaseValidatorConjunctionAddsValidatorsDefinedByAnnotationsInTheClassToTheReturnedConjunction()
+    {
+        $this->validatorResolver->_call(
+            'buildBaseValidatorConjunction',
+            \TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Domain\Model\Model::class,
+            \TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Domain\Model\Model::class
+        );
+
+        /** @var array $baseValidatorConjunctions */
+        $baseValidatorConjunctions = $this->validatorResolver->_get('baseValidatorConjunctions');
+        static::assertTrue(is_array($baseValidatorConjunctions));
+        static::assertCount(2, $baseValidatorConjunctions);
+        static::assertArrayHasKey(\TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Domain\Model\Model::class, $baseValidatorConjunctions);
+        static::assertArrayHasKey(\TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Domain\Model\AnotherModel::class, $baseValidatorConjunctions);
+
+        /** @var ConjunctionValidator $conjunctionValidator */
+        $conjunctionValidator = $baseValidatorConjunctions[\TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Domain\Model\Model::class];
+        static::assertInstanceOf(ConjunctionValidator::class, $conjunctionValidator);
+
+        $baseValidators = $conjunctionValidator->getValidators();
+        static::assertInstanceOf(\SplObjectStorage::class, $baseValidators);
+        $baseValidators->rewind();
+
+        /** @var GenericObjectValidator $validator */
+        $validator = $baseValidators->current();
+        static::assertInstanceOf(GenericObjectValidator::class, $validator);
+
+        $propertyValidators = $validator->getPropertyValidators();
+        static::assertCount(4, $propertyValidators);
+        static::assertArrayHasKey('foo', $propertyValidators);
+        static::assertArrayHasKey('bar', $propertyValidators);
+        static::assertArrayHasKey('baz', $propertyValidators);
+        static::assertArrayHasKey('qux', $propertyValidators);
+
+        /** @var \SplObjectStorage $fooPropertyValidators */
+        $fooPropertyValidators = $propertyValidators['foo'];
+        static::assertInstanceOf(\SplObjectStorage::class, $fooPropertyValidators);
+        static::assertCount(3, $fooPropertyValidators);
+
+        $fooPropertyValidators->rewind();
+        /** @var StringLengthValidator $propertyValidator */
+        $propertyValidator = $fooPropertyValidators->current();
+        static::assertInstanceOf(StringLengthValidator::class, $propertyValidator);
+        static::assertSame(['minimum' => '1', 'maximum' => PHP_INT_MAX], $propertyValidator->getOptions());
+
+        $fooPropertyValidators->next();
+        /** @var StringLengthValidator $propertyValidator */
+        $propertyValidator = $fooPropertyValidators->current();
+        static::assertInstanceOf(StringLengthValidator::class, $propertyValidator);
+        static::assertSame(['minimum' => 0, 'maximum' => '10'], $propertyValidator->getOptions());
+
+        $fooPropertyValidators->next();
+        $propertyValidator = $fooPropertyValidators->current();
+        static::assertInstanceOf(NotEmptyValidator::class, $propertyValidator);
+
+        /** @var \SplObjectStorage $barPropertyValidators */
+        $barPropertyValidators = $propertyValidators['bar'];
+        static::assertInstanceOf(\SplObjectStorage::class, $barPropertyValidators);
+        static::assertCount(1, $barPropertyValidators);
+
+        $barPropertyValidators->rewind();
+        $propertyValidator = $barPropertyValidators->current();
+        static::assertInstanceOf(Fixture\Validation\Validator\CustomValidator::class, $propertyValidator);
+
+        /** @var \SplObjectStorage $bazPropertyValidators */
+        $bazPropertyValidators = $propertyValidators['baz'];
+        static::assertInstanceOf(\SplObjectStorage::class, $bazPropertyValidators);
+        static::assertCount(1, $bazPropertyValidators);
+
+        $bazPropertyValidators->rewind();
+        $propertyValidator = $bazPropertyValidators->current();
+        static::assertInstanceOf(CollectionValidator::class, $propertyValidator);
+
+        /** @var \SplObjectStorage $quxPropertyValidators */
+        $quxPropertyValidators = $propertyValidators['qux'];
+        static::assertInstanceOf(\SplObjectStorage::class, $quxPropertyValidators);
+        static::assertCount(1, $quxPropertyValidators);
+
+        $quxPropertyValidators->rewind();
+        $propertyValidator = $quxPropertyValidators->current();
+        static::assertInstanceOf(ConjunctionValidator::class, $propertyValidator);
+        static::assertSame(
+            $baseValidatorConjunctions[\TYPO3\CMS\Extbase\Tests\Functional\Validation\Fixture\Domain\Model\AnotherModel::class],
+            $propertyValidator
+        );
+
+        $baseValidators->next();
+        $validator = $baseValidators->current();
+        static::assertInstanceOf(Fixture\Domain\Validator\ModelValidator::class, $validator);
+    }
+}
index 8d4a74b..34236fd 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+declare(strict_types=1);
 namespace TYPO3\CMS\Extbase\Tests\Unit\Validation;
 
 /*
@@ -14,9 +15,6 @@ namespace TYPO3\CMS\Extbase\Tests\Unit\Validation;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Extbase\Validation\Exception\InvalidValidationConfigurationException;
-use TYPO3\CMS\Extbase\Validation\Exception\NoSuchValidatorException;
-
 /**
  * Test case
  */
@@ -35,383 +33,6 @@ class ValidatorResolverTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa
     protected function setUp()
     {
         $this->validatorResolver = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Validation\ValidatorResolver::class, ['dummy']);
-        $this->mockObjectManager = $this->createMock(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
-        $this->validatorResolver->_set('objectManager', $this->mockObjectManager);
-    }
-
-    /****************/
-
-    /**
-     * @test
-     */
-    public function resolveValidatorObjectNameWithShortHandNotationReturnsValidatorNameIfClassExists()
-    {
-        $extensionName = 'tx_foo';
-        $className = $this->getUniqueId('Foo');
-        $realClassName = 'Tx_' . $extensionName . '_Validation_Validator_' . $className . 'Validator';
-        $validatorName = $extensionName . ':' . $className;
-        eval('class ' . $realClassName . ' implements TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface {
-               public function validate($value){} public function getOptions(){}
-               }');
-        $this->assertEquals($realClassName, $this->validatorResolver->_call('resolveValidatorObjectName', $validatorName));
-    }
-
-    /**
-     * @test
-     */
-    public function resolveValidatorObjectNameWithShortHandNotationThrowsExceptionIfClassNotExists()
-    {
-        $className = $this->getUniqueId('Foo');
-        $validatorName = 'tx_foo:' . $className;
-        $this->expectException(NoSuchValidatorException::class);
-        $this->expectExceptionCode(1365799920);
-        $this->validatorResolver->_call('resolveValidatorObjectName', $validatorName);
-    }
-
-    /**
-     * @test
-     */
-    public function resolveValidatorObjectNameWithShortHandNotationReturnsValidatorNameIfClassExistsButDoesNotImplementValidatorInterface()
-    {
-        $extensionName = 'tx_foo';
-        $className = $this->getUniqueId('Foo');
-        $realClassName = 'Tx_' . $extensionName . '_Validation_Validator_' . $className . 'Validator';
-        $validatorName = $extensionName . ':' . $className;
-        eval('class ' . $realClassName . '{}');
-        $this->expectException(NoSuchValidatorException::class);
-        $this->expectExceptionCode(1365776838);
-        $this->validatorResolver->_call('resolveValidatorObjectName', $validatorName);
-    }
-
-    /****************/
-
-    /**
-     * @test
-     */
-    public function resolveValidatorObjectNameReturnsValidatorNameIfClassExists()
-    {
-        $className = $this->getUniqueId('Foo_');
-        $expectedValidatorName = $className . 'Validator';
-        eval('class ' . $expectedValidatorName . ' implements TYPO3\\CMS\\Extbase\\Validation\\Validator\\ValidatorInterface {
-               public function validate($value){} public function getOptions(){}
-               }');
-        $this->assertEquals(
-            $expectedValidatorName,
-            $this->validatorResolver->_call('resolveValidatorObjectName', $className)
-        );
-    }
-
-    /**
-     * @test
-     */
-    public function resolveValidatorObjectNameThrowsNoSuchValidatorExceptionIfClassNotExists()
-    {
-        $className = $this->getUniqueId('Foo');
-        $this->expectException(NoSuchValidatorException::class);
-        $this->expectExceptionCode(1365799920);
-        $this->validatorResolver->_call('resolveValidatorObjectName', $className);
-    }
-
-    /**
-     * @test
-     */
-    public function resolveValidatorObjectNameThrowsNoSuchValidatorExceptionIfClassExistsButDoesNotImplementValidatorInterface()
-    {
-        $className = $this->getUniqueId('Foo_');
-        $expectedValidatorName = $className . 'Validator';
-        eval('class ' . $expectedValidatorName . '{}');
-        $this->expectException(NoSuchValidatorException::class);
-        $this->expectExceptionCode(1365776838);
-        $this->validatorResolver->_call('resolveValidatorObjectName', $className);
-    }
-
-    /****************/
-
-    /**
-     * @return array
-     */
-    public function namespacedShorthandValidatornames()
-    {
-        return [
-            ['TYPO3\\CMS\\Mypkg\\Validation\\Validator', 'MySecondValidator', 'TYPO3.CMS.Mypkg:MySecond'],
-            ['Acme\\Mypkg\\Validation\\Validator', 'MyThirdValidator', 'Acme.Mypkg:MyThird']
-        ];
-    }
-
-    /**
-     * @param string $namespace
-     * @param string $className
-     * @param string $shorthandValidatorname
-     *
-     * @test
-     * @dataProvider namespacedShorthandValidatornames
-     */
-    public function resolveValidatorObjectNameCanResolveNamespacedShorthandValidatornames($namespace, $className, $shorthandValidatorname)
-    {
-        eval('namespace ' . $namespace . '; class ' . $className . ' implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {
-               public function validate($value){} public function getOptions(){}
-               }');
-        $this->assertSame($namespace . '\\' . $className, $this->validatorResolver->_call('resolveValidatorObjectName', $shorthandValidatorname));
-    }
-
-    /**
-     * @test
-     */
-    public function resolveValidatorObjectNameCanResolveShortNamesOfBuiltInValidators()
-    {
-        eval('namespace TYPO3\\CMS\\Extbase\\Validation\\Validator;' . LF . 'class FooValidator implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {
-               public function validate($value){} public function getOptions(){}
-               }');
-        $this->assertSame('TYPO3\\CMS\\Extbase\\Validation\\Validator\\FooValidator', $this->validatorResolver->_call('resolveValidatorObjectName', 'Foo'));
-    }
-
-    /**
-     * @test
-     */
-    public function createValidatorResolvesAndReturnsAValidatorAndPassesTheGivenOptions()
-    {
-        $className = $this->getUniqueId('Test');
-        $mockValidator = $this->getMockBuilder(\TYPO3\CMS\Extbase\Validation\Validator\ObjectValidatorInterface::class)
-            ->setMethods(['validate', 'getOptions', 'setValidatedInstancesContainer'])
-            ->setMockClassName($className)
-            ->getMock();
-        $this->mockObjectManager->expects($this->any())->method('get')->with($className)->will($this->returnValue($mockValidator));
-        /** @var \TYPO3\CMS\Extbase\Validation\ValidatorResolver $validatorResolver */
-        $validatorResolver = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Validation\ValidatorResolver::class, ['resolveValidatorObjectName']);
-        $validatorResolver->_set('objectManager', $this->mockObjectManager);
-        $validatorResolver->expects($this->once())->method('resolveValidatorObjectName')->with($className)->will($this->returnValue($className));
-        $validator = $validatorResolver->createValidator($className);
-        $this->assertSame($mockValidator, $validator);
-    }
-
-    /**
-     * @test
-     */
-    public function createValidatorThrowsNoSuchValidatorExceptionIfAValidatorCouldNotBeResolved()
-    {
-        $this->markTestSkipped('');
-        $className = $this->getUniqueId('Test');
-        $this->expectException(NoSuchValidatorException::class);
-        $this->expectExceptionCode(1365799920);
-        $this->validatorResolver->createValidator($className);
-    }
-
-    /**
-     * @test
-     */
-    public function getBaseValidatorCachesTheResultOfTheBuildBaseValidatorChainCalls()
-    {
-        $this->markTestSkipped('Functionality is different now.');
-        $mockConjunctionValidator = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator::class);
-        $validatorResolver = $this->getMockBuilder(\TYPO3\CMS\Extbase\Validation\ValidatorResolver::class)
-            ->setMethods(['buildBaseValidatorConjunction'])
-            ->disableOriginalConstructor()
-            ->getMock();
-        $validatorResolver->expects($this->once())->method('buildBaseValidatorConjunction')->with('Tx_Virtual_Foo')->will($this->returnValue($mockConjunctionValidator));
-        $result = $validatorResolver->getBaseValidatorConjunction('Tx_Virtual_Foo');
-        $this->assertSame($mockConjunctionValidator, $result, '#1');
-        $result = $validatorResolver->getBaseValidatorConjunction('Tx_Virtual_Foo');
-        $this->assertSame($mockConjunctionValidator, $result, '#2');
-    }
-
-    /**
-     * @test
-     */
-    public function buildMethodArgumentsValidatorConjunctionsReturnsEmptyArrayIfMethodHasNoArguments()
-    {
-        $mockController = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Mvc\Controller\ActionController::class, ['fooAction'], [], '', false);
-        $methodParameters = [];
-        $mockReflectionService = $this->createMock(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class);
-        $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockController), 'fooAction')->will($this->returnValue($methodParameters));
-        $validatorResolver = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Validation\ValidatorResolver::class, ['createValidator']);
-        $validatorResolver->_set('reflectionService', $mockReflectionService);
-        $result = $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockController), 'fooAction');
-        $this->assertSame([], $result);
-    }
-
-    /**
-     * @test
-     */
-    public function buildMethodArgumentsValidatorConjunctionsBuildsAConjunctionFromValidateAnnotationsOfTheSpecifiedMethod()
-    {
-        $mockObject = $this->getMockBuilder('stdClass')
-            ->setMethods(['fooMethod'])
-            ->disableOriginalConstructor()
-            ->getMock();
-        $methodParameters = [
-            'arg1' => [
-                'type' => 'string'
-            ],
-            'arg2' => [
-                'type' => 'array'
-            ]
-        ];
-        $methodTagsValues = [
-            'param' => [
-                'string $arg1',
-                'array $arg2'
-            ],
-            'validate' => [
-                '$arg1 Foo(bar = baz), Bar',
-                '$arg2 VENDOR\\ModelCollection\\Domain\\Model\\Model'
-            ]
-        ];
-        $mockReflectionService = $this->createMock(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class);
-        $mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(get_class($mockObject), 'fooAction')->will($this->returnValue($methodTagsValues));
-        $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockObject), 'fooAction')->will($this->returnValue($methodParameters));
-        $mockStringValidator = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface::class);
-        $mockArrayValidator = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface::class);
-        $mockFooValidator = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface::class);
-        $mockBarValidator = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface::class);
-        $mockQuuxValidator = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface::class);
-        $conjunction1 = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator::class);
-        $conjunction1->expects($this->at(0))->method('addValidator')->with($mockStringValidator);
-        $conjunction1->expects($this->at(1))->method('addValidator')->with($mockFooValidator);
-        $conjunction1->expects($this->at(2))->method('addValidator')->with($mockBarValidator);
-        $conjunction2 = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator::class);
-        $conjunction2->expects($this->at(0))->method('addValidator')->with($mockArrayValidator);
-        $conjunction2->expects($this->at(1))->method('addValidator')->with($mockQuuxValidator);
-        $mockArguments = new \TYPO3\CMS\Extbase\Mvc\Controller\Arguments();
-        $mockArguments->addArgument(new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('arg1', 'dummyValue'));
-        $mockArguments->addArgument(new \TYPO3\CMS\Extbase\Mvc\Controller\Argument('arg2', 'dummyValue'));
-        $validatorResolver = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Validation\ValidatorResolver::class, ['createValidator']);
-        $validatorResolver->expects($this->at(0))->method('createValidator')->with(\TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator::class)->will($this->returnValue($conjunction1));
-        $validatorResolver->expects($this->at(1))->method('createValidator')->with('string')->will($this->returnValue($mockStringValidator));
-        $validatorResolver->expects($this->at(2))->method('createValidator')->with(\TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator::class)->will($this->returnValue($conjunction2));
-        $validatorResolver->expects($this->at(3))->method('createValidator')->with('array')->will($this->returnValue($mockArrayValidator));
-        $validatorResolver->expects($this->at(4))->method('createValidator')->with('Foo', ['bar' => 'baz'])->will($this->returnValue($mockFooValidator));
-        $validatorResolver->expects($this->at(5))->method('createValidator')->with('Bar')->will($this->returnValue($mockBarValidator));
-        $validatorResolver->expects($this->at(6))->method('createValidator')->with('VENDOR\\ModelCollection\\Domain\\Model\\Model')->will($this->returnValue($mockQuuxValidator));
-        $validatorResolver->_set('reflectionService', $mockReflectionService);
-        $result = $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockObject), 'fooAction');
-        $this->assertEquals(['arg1' => $conjunction1, 'arg2' => $conjunction2], $result);
-    }
-
-    /**
-     * @test
-     */
-    public function buildMethodArgumentsValidatorConjunctionsThrowsExceptionIfValidationAnnotationForNonExistingArgumentExists()
-    {
-        $this->expectException(InvalidValidationConfigurationException::class);
-        $this->expectExceptionCode(1253172726);
-        $mockObject = $this->getMockBuilder('stdClass')
-            ->setMethods(['fooMethod'])
-            ->disableOriginalConstructor()
-            ->getMock();
-        $methodParameters = [
-            'arg1' => [
-                'type' => 'string'
-            ]
-        ];
-        $methodTagsValues = [
-            'param' => [
-                'string $arg1'
-            ],
-            'validate' => [
-                '$arg2 VENDOR\\ModelCollection\\Domain\\Model\\Model'
-            ]
-        ];
-        $mockReflectionService = $this->createMock(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class);
-        $mockReflectionService->expects($this->once())->method('getMethodTagsValues')->with(get_class($mockObject), 'fooAction')->will($this->returnValue($methodTagsValues));
-        $mockReflectionService->expects($this->once())->method('getMethodParameters')->with(get_class($mockObject), 'fooAction')->will($this->returnValue($methodParameters));
-        $mockStringValidator = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface::class);
-        $mockQuuxValidator = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface::class);
-        $conjunction1 = $this->createMock(\TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator::class);
-        $conjunction1->expects($this->at(0))->method('addValidator')->with($mockStringValidator);
-        $validatorResolver = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Validation\ValidatorResolver::class, ['createValidator']);
-        $validatorResolver->expects($this->at(0))->method('createValidator')->with(\TYPO3\CMS\Extbase\Validation\Validator\ConjunctionValidator::class)->will($this->returnValue($conjunction1));
-        $validatorResolver->expects($this->at(1))->method('createValidator')->with('string')->will($this->returnValue($mockStringValidator));
-        $validatorResolver->expects($this->at(2))->method('createValidator')->with('VENDOR\\ModelCollection\\Domain\\Model\\Model')->will($this->returnValue($mockQuuxValidator));
-        $validatorResolver->_set('reflectionService', $mockReflectionService);
-        $validatorResolver->buildMethodArgumentsValidatorConjunctions(get_class($mockObject), 'fooAction');
-    }
-
-    /**
-     * @test
-     */
-    public function buildBaseValidatorConjunctionAddsValidatorsDefinedByAnnotationsInTheClassToTheReturnedConjunction()
-    {
-        $mockObject = $this->createMock('stdClass');
-        $className = get_class($mockObject);
-        $propertyTagsValues = [
-            'foo' => [
-                'var' => ['string'],
-                'validate' => [
-                    'Foo(bar= baz), Bar',
-                    'Baz'
-                ]
-            ],
-            'bar' => [
-                'var' => ['integer'],
-                'validate' => [
-                    'VENDOR\\ModelCollection\\Domain\\Validator\\ModelValidator'
-                ]
-            ]
-        ];
-
-        $mockReflectionService = $this->createMock(\TYPO3\CMS\Extbase\Reflection\ReflectionService::class);
-        $mockReflectionService->expects($this->at(0))->method('getClassPropertyNames')->with($className)->will($this->returnValue(['foo', 'bar']));
-        $mockReflectionService->expects($this->at(1))->method('getPropertyTagsValues')->with($className, 'foo')->will($this->returnValue($propertyTagsValues['foo']));
-        $mockReflectionService->expects($this->at(2))->method('getPropertyTagsValues')->with($className, 'bar')->will($this->returnValue($propertyTagsValues['bar']));
-        $mockObjectValidator = $this->getMockBuilder(\TYPO3\CMS\Extbase\Validation\Validator\GenericObjectValidator::class)
-            ->setMethods(['dummy'])
-            ->disableOriginalConstructor()
-            ->getMock();
-        $mockObjectManager = $this->createMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $mockObjectManager->expects($this->at(0))->method('get')->with(\TYPO3\CMS\Extbase\Validation\Validator\GenericObjectValidator::class)->will($this->returnValue($mockObjectValidator));
-        $validatorResolver = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Validation\ValidatorResolver::class, ['resolveValidatorObjectName', 'createValidator']);
-        $validatorResolver->_set('reflectionService', $mockReflectionService);
-        $validatorResolver->_set('objectManager', $mockObjectManager);
-        $validatorResolver->expects($this->at(0))->method('createValidator')->with('Foo', ['bar' => 'baz'])->will($this->returnValue($mockObjectValidator));
-        $validatorResolver->expects($this->at(1))->method('createValidator')->with('Bar')->will($this->returnValue($mockObjectValidator));
-        $validatorResolver->expects($this->at(2))->method('createValidator')->with('Baz')->will($this->returnValue($mockObjectValidator));
-        $validatorResolver->expects($this->at(3))->method('createValidator')->with('VENDOR\\ModelCollection\\Domain\\Validator\\ModelValidator')->will($this->returnValue($mockObjectValidator));
-        $validatorResolver->_call('buildBaseValidatorConjunction', $className, $className);
-    }
-
-    /**
-     * dataProvider for buildBaseValidatorConjunctionAddsValidatorFromConventionToTheReturnedConjunction
-     *
-     * @return array
-     */
-    public function modelNamesProvider()
-    {
-        return [
-            'no replace' => ['VENDOR\\ModelCollection\\Domain\\Model\\Model', 'VENDOR\\ModelCollection\\Domain\\Validator\\ModelValidator'],
-            'replace in not namespaced class' => ['Tx_ModelCollection_Domain_Model_Model', 'Tx_ModelCollection_Domain_Validator_ModelValidator'],
-            'replace in namespaced class' => ['VENDOR\\ModelCollection\\Domain\\Model\\Model', 'VENDOR\\ModelCollection\\Domain\\Validator\\ModelValidator']
-        ];
-    }
-
-    /**
-     * @param string $modelClassName
-     * @param string $validatorClassName
-     *
-     * @test
-     * @dataProvider modelNamesProvider
-     */
-    public function buildBaseValidatorConjunctionCreatesValidatorFromClassName($modelClassName, $validatorClassName)
-    {
-        $mockObjectManager = $this->createMock(\TYPO3\CMS\Extbase\Object\ObjectManagerInterface::class);
-        $validatorResolver = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Validation\ValidatorResolver::class, ['resolveValidatorObjectName', 'createValidator']);
-        $validatorResolver->_set('objectManager', $mockObjectManager);
-        $validatorResolver->expects($this->once())->method('createValidator')->with($validatorClassName)->will($this->returnValue(null));
-        $validatorResolver->_call('buildBaseValidatorConjunction', $modelClassName, $modelClassName);
-    }
-
-    /**
-     * @test
-     */
-    public function resolveValidatorObjectNameCallsGetValidatorType()
-    {
-        $validatorName = $this->getUniqueId('FooValidator');
-        eval('namespace TYPO3\CMS\Extbase\Validation\Validator;' . LF . 'class ' . $validatorName . 'Validator implements \TYPO3\CMS\Extbase\Validation\Validator\ValidatorInterface {
-               public function validate($value){} public function getOptions(){}
-               }');
-        $mockValidatorResolver = $this->getAccessibleMock(\TYPO3\CMS\Extbase\Validation\ValidatorResolver::class, ['getValidatorType']);
-        $mockValidatorResolver->expects($this->once())->method('getValidatorType')->with($validatorName)->will($this->returnValue($validatorName));
-
-        $mockValidatorResolver->_call('resolveValidatorObjectName', $validatorName);
     }
 
     /**
@@ -419,17 +40,17 @@ class ValidatorResolverTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa
      */
     public function getValidatorTypeCorrectlyRenamesPhpDataTypes()
     {
-        $this->assertEquals('Integer', $this->validatorResolver->_call('getValidatorType', 'integer'));
-        $this->assertEquals('Integer', $this->validatorResolver->_call('getValidatorType', 'int'));
-        $this->assertEquals('String', $this->validatorResolver->_call('getValidatorType', 'string'));
-        $this->assertEquals('Array', $this->validatorResolver->_call('getValidatorType', 'array'));
-        $this->assertEquals('Float', $this->validatorResolver->_call('getValidatorType', 'float'));
-        $this->assertEquals('Float', $this->validatorResolver->_call('getValidatorType', 'double'));
-        $this->assertEquals('Boolean', $this->validatorResolver->_call('getValidatorType', 'boolean'));
-        $this->assertEquals('Boolean', $this->validatorResolver->_call('getValidatorType', 'bool'));
-        $this->assertEquals('Boolean', $this->validatorResolver->_call('getValidatorType', 'bool'));
-        $this->assertEquals('Number', $this->validatorResolver->_call('getValidatorType', 'number'));
-        $this->assertEquals('Number', $this->validatorResolver->_call('getValidatorType', 'numeric'));
+        static::assertEquals('Integer', $this->validatorResolver->_call('getValidatorType', 'integer'));
+        static::assertEquals('Integer', $this->validatorResolver->_call('getValidatorType', 'int'));
+        static::assertEquals('String', $this->validatorResolver->_call('getValidatorType', 'string'));
+        static::assertEquals('Array', $this->validatorResolver->_call('getValidatorType', 'array'));
+        static::assertEquals('Float', $this->validatorResolver->_call('getValidatorType', 'float'));
+        static::assertEquals('Float', $this->validatorResolver->_call('getValidatorType', 'double'));
+        static::assertEquals('Boolean', $this->validatorResolver->_call('getValidatorType', 'boolean'));
+        static::assertEquals('Boolean', $this->validatorResolver->_call('getValidatorType', 'bool'));
+        static::assertEquals('Boolean', $this->validatorResolver->_call('getValidatorType', 'bool'));
+        static::assertEquals('Number', $this->validatorResolver->_call('getValidatorType', 'number'));
+        static::assertEquals('Number', $this->validatorResolver->_call('getValidatorType', 'numeric'));
     }
 
     /**
@@ -437,14 +58,14 @@ class ValidatorResolverTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa
      */
     public function getValidatorTypeRenamesMixedToRaw()
     {
-        $this->assertEquals('Raw', $this->validatorResolver->_call('getValidatorType', 'mixed'));
+        static::assertEquals('Raw', $this->validatorResolver->_call('getValidatorType', 'mixed'));
     }
 
     /**
      * dataProvider for parseValidatorAnnotationCanParseAnnotations
      * @return array
      */
-    public function validatorAnnotations()
+    public function validatorAnnotations(): array
     {
         return [
             [
@@ -584,12 +205,13 @@ class ValidatorResolverTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCa
     /**
      * @test
      * @dataProvider validatorAnnotations
+     *
      * @param mixed $annotation
      * @param mixed $expectedResult
      */
     public function parseValidatorAnnotationCanParseAnnotations($annotation, $expectedResult)
     {
         $result = $this->validatorResolver->_call('parseValidatorAnnotation', $annotation);
-        $this->assertEquals($result, $expectedResult);
+        static::assertEquals($result, $expectedResult);
     }
 }