‪TYPO3CMS  9.5
AbstractValidatorTestcase.php
Go to the documentation of this file.
1 <?php
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
18 
23 abstract class ‪AbstractValidatorTestcase extends UnitTestCase
24 {
28  protected ‪$validatorClassName;
29 
33  protected ‪$validator;
34 
38  protected function ‪setUp()
39  {
40  $this->validator = $this->‪getValidator();
41  }
42 
48  protected function ‪getValidator($options = [])
49  {
50  trigger_error(
51  __CLASS__ . ' is deprecated and will be removed in TYPO3 v10.0.',
52  E_USER_DEPRECATED
53  );
54 
55  ‪$validator = new $this->validatorClassName($options);
56  return ‪$validator;
57  }
58 
63  protected function ‪validatorOptions($options)
64  {
65  trigger_error(
66  __CLASS__ . ' is deprecated and will be removed in TYPO3 v10.0.',
67  E_USER_DEPRECATED
68  );
69 
70  $this->validator = $this->‪getValidator($options);
71  }
72 }
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\AbstractValidatorTestcase\getValidator
‪mixed getValidator($options=[])
Definition: AbstractValidatorTestcase.php:46
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\AbstractValidatorTestcase\setUp
‪setUp()
Definition: AbstractValidatorTestcase.php:36
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\AbstractValidatorTestcase\$validator
‪TYPO3 CMS Extbase Validation Validator ValidatorInterface $validator
Definition: AbstractValidatorTestcase.php:31
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator
Definition: AbstractCompositeValidatorTest.php:2
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\AbstractValidatorTestcase\$validatorClassName
‪string $validatorClassName
Definition: AbstractValidatorTestcase.php:27
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\AbstractValidatorTestcase\validatorOptions
‪validatorOptions($options)
Definition: AbstractValidatorTestcase.php:61
‪TYPO3\CMS\Extbase\Tests\Unit\Validation\Validator\AbstractValidatorTestcase
Definition: AbstractValidatorTestcase.php:24