‪TYPO3CMS  9.5
ValidatorResolverTest.php
Go to the documentation of this file.
1 <?php
2 declare(strict_types = 1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
18 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
19 
23 class ‪ValidatorResolverTest extends UnitTestCase
24 {
28  protected ‪$validatorResolver;
29 
34 
35  protected function ‪setUp()
36  {
37  $this->validatorResolver = $this->getAccessibleMock(\‪TYPO3\CMS\‪Extbase\Validation\ValidatorResolver::class, ['dummy']);
38  }
39 
44  {
45  static::assertEquals('Integer', $this->validatorResolver->_call('getValidatorType', 'integer'));
46  static::assertEquals('Integer', $this->validatorResolver->_call('getValidatorType', 'int'));
47  static::assertEquals('String', $this->validatorResolver->_call('getValidatorType', 'string'));
48  static::assertEquals('Array', $this->validatorResolver->_call('getValidatorType', 'array'));
49  static::assertEquals('Float', $this->validatorResolver->_call('getValidatorType', 'float'));
50  static::assertEquals('Float', $this->validatorResolver->_call('getValidatorType', 'double'));
51  static::assertEquals('Boolean', $this->validatorResolver->_call('getValidatorType', 'boolean'));
52  static::assertEquals('Boolean', $this->validatorResolver->_call('getValidatorType', 'bool'));
53  static::assertEquals('Boolean', $this->validatorResolver->_call('getValidatorType', 'bool'));
54  static::assertEquals('Number', $this->validatorResolver->_call('getValidatorType', 'number'));
55  static::assertEquals('Number', $this->validatorResolver->_call('getValidatorType', 'numeric'));
56  }
57 
61  public function ‪getValidatorTypeRenamesMixedToRaw()
62  {
63  static::assertEquals('Raw', $this->validatorResolver->_call('getValidatorType', 'mixed'));
64  }
65 }
‪TYPO3\CMS\Extbase\Annotation
Definition: IgnoreValidation.php:4
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\ValidatorResolverTest\$validatorResolver
‪TYPO3 CMS Extbase Validation ValidatorResolver $validatorResolver
Definition: ValidatorResolverTest.php:27
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\ValidatorResolverTest\getValidatorTypeCorrectlyRenamesPhpDataTypes
‪getValidatorTypeCorrectlyRenamesPhpDataTypes()
Definition: ValidatorResolverTest.php:41
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\ValidatorResolverTest\setUp
‪setUp()
Definition: ValidatorResolverTest.php:33
‪TYPO3
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\ValidatorResolverTest\$mockObjectManager
‪TYPO3 CMS Extbase Object ObjectManager $mockObjectManager
Definition: ValidatorResolverTest.php:31
‪TYPO3\CMS\Extbase\Tests\Unit\Validation
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\ValidatorResolverTest\getValidatorTypeRenamesMixedToRaw
‪getValidatorTypeRenamesMixedToRaw()
Definition: ValidatorResolverTest.php:59
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\ValidatorResolverTest
Definition: ValidatorResolverTest.php:24