|
14 | 14 | use Symfony\Component\Validator\Constraint;
|
15 | 15 | use Symfony\Component\Validator\Constraints\GreaterThan;
|
16 | 16 | use Symfony\Component\Validator\Constraints\GreaterThanValidator;
|
| 17 | +use Symfony\Component\Validator\Tests\IcuCompatibilityTrait; |
17 | 18 |
|
18 | 19 | /**
|
19 | 20 | * @author Daniel Holmes <daniel@danielholmes.org>
|
20 | 21 | */
|
21 | 22 | class GreaterThanValidatorTest extends AbstractComparisonValidatorTestCase
|
22 | 23 | {
|
| 24 | + use IcuCompatibilityTrait; |
| 25 | + |
23 | 26 | protected function createValidator()
|
24 | 27 | {
|
25 | 28 | return new GreaterThanValidator();
|
@@ -69,20 +72,20 @@ public static function provideInvalidComparisons(): array
|
69 | 72 | return [
|
70 | 73 | [1, '1', 2, '2', 'int'],
|
71 | 74 | [2, '2', 2, '2', 'int'],
|
72 |
| - [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2005/01/01'), 'Jan 1, 2005, 12:00 AM', 'DateTime'], |
73 |
| - [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'], |
74 |
| - [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2005/01/01', 'Jan 1, 2005, 12:00 AM', 'DateTime'], |
75 |
| - [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2000/01/01', 'Jan 1, 2000, 12:00 AM', 'DateTime'], |
76 |
| - [new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2005/01/01 UTC', 'Jan 1, 2005, 12:00 AM', 'DateTime'], |
77 |
| - [new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000/01/01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'], |
| 75 | + [new \DateTime('2000/01/01'), self::normalizeIcuSpaces("Jan 1, 2000, 12:00\u{202F}AM"), new \DateTime('2005/01/01'), self::normalizeIcuSpaces("Jan 1, 2005, 12:00\u{202F}AM"), 'DateTime'], |
| 76 | + [new \DateTime('2000/01/01'), self::normalizeIcuSpaces("Jan 1, 2000, 12:00\u{202F}AM"), new \DateTime('2000/01/01'), self::normalizeIcuSpaces("Jan 1, 2000, 12:00\u{202F}AM"), 'DateTime'], |
| 77 | + [new \DateTime('2000/01/01'), self::normalizeIcuSpaces("Jan 1, 2000, 12:00\u{202F}AM"), '2005/01/01', self::normalizeIcuSpaces("Jan 1, 2005, 12:00\u{202F}AM"), 'DateTime'], |
| 78 | + [new \DateTime('2000/01/01'), self::normalizeIcuSpaces("Jan 1, 2000, 12:00\u{202F}AM"), '2000/01/01', self::normalizeIcuSpaces("Jan 1, 2000, 12:00\u{202F}AM"), 'DateTime'], |
| 79 | + [new \DateTime('2000/01/01 UTC'), self::normalizeIcuSpaces("Jan 1, 2000, 12:00\u{202F}AM"), '2005/01/01 UTC', self::normalizeIcuSpaces("Jan 1, 2005, 12:00\u{202F}AM"), 'DateTime'], |
| 80 | + [new \DateTime('2000/01/01 UTC'), self::normalizeIcuSpaces("Jan 1, 2000, 12:00\u{202F}AM"), '2000/01/01 UTC', self::normalizeIcuSpaces("Jan 1, 2000, 12:00\u{202F}AM"), 'DateTime'], |
78 | 81 | [new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
|
79 | 82 | [new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
|
80 | 83 | ['22', '"22"', '333', '"333"', 'string'],
|
81 | 84 | ['22', '"22"', '22', '"22"', 'string'],
|
82 | 85 | ];
|
83 | 86 | }
|
84 | 87 |
|
85 |
| - public static function provideComparisonsToNullValueAtPropertyPath() |
| 88 | + public static function provideComparisonsToNullValueAtPropertyPath(): array |
86 | 89 | {
|
87 | 90 | return [
|
88 | 91 | [5, '5', true],
|
|
0 commit comments