|
33 | 33 | * @no-final |
34 | 34 | */ |
35 | 35 | #[Group('Others')] |
36 | | -class ValidationTest extends CIUnitTestCase |
| 36 | +final class ValidationTest extends CIUnitTestCase |
37 | 37 | { |
38 | | - protected Validation $validation; |
| 38 | + private Validation $validation; |
39 | 39 |
|
40 | 40 | /** |
41 | 41 | * @var array<string, array<int|string, array<string, array<string, string>|string>|string>|string> |
42 | 42 | */ |
43 | | - protected static array $config = [ |
| 43 | + private static array $config = [ |
44 | 44 | 'ruleSets' => [ |
45 | 45 | Rules::class, |
46 | 46 | FormatRules::class, |
@@ -82,7 +82,7 @@ class ValidationTest extends CIUnitTestCase |
82 | 82 | protected function setUp(): void |
83 | 83 | { |
84 | 84 | parent::setUp(); |
85 | | - $this->validation = new Validation((object) static::$config, service('renderer')); |
| 85 | + $this->validation = new Validation((object) self::$config, service('renderer')); |
86 | 86 | $this->validation->reset(); |
87 | 87 | } |
88 | 88 |
|
@@ -227,7 +227,7 @@ public static function provideSetRuleRulesFormat(): iterable |
227 | 227 |
|
228 | 228 | yield 'fail-deep-object' => [ |
229 | 229 | false, |
230 | | - new Validation((object) static::$config, service('renderer')), |
| 230 | + new Validation((object) self::$config, service('renderer')), |
231 | 231 | ]; |
232 | 232 |
|
233 | 233 | yield 'pass-multiple-string' => [ |
@@ -1007,18 +1007,18 @@ public function testShowBadTemplate(): void |
1007 | 1007 | public function testNoRuleSetsSetup(): void |
1008 | 1008 | { |
1009 | 1009 | try { |
1010 | | - $rulesets = static::$config['ruleSets']; |
| 1010 | + $rulesets = self::$config['ruleSets']; |
1011 | 1011 |
|
1012 | | - static::$config['ruleSets'] = null; |
1013 | | - (new Validation((object) static::$config, service('renderer'))) |
| 1012 | + self::$config['ruleSets'] = null; |
| 1013 | + (new Validation((object) self::$config, service('renderer'))) |
1014 | 1014 | ->reset() |
1015 | 1015 | ->run(['foo' => '']); |
1016 | 1016 |
|
1017 | 1017 | $this->fail(sprintf('%s should throw %s.', __METHOD__, ValidationException::class)); |
1018 | 1018 | } catch (Throwable $e) { |
1019 | 1019 | $this->assertInstanceOf(ValidationException::class, $e); |
1020 | 1020 | } finally { |
1021 | | - static::$config['ruleSets'] = $rulesets; |
| 1021 | + self::$config['ruleSets'] = $rulesets; |
1022 | 1022 | } |
1023 | 1023 | } |
1024 | 1024 |
|
|
0 commit comments