|
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(): GreaterThanValidator
|
24 | 27 | {
|
25 | 28 | return new GreaterThanValidator();
|
@@ -60,20 +63,20 @@ public static function provideInvalidComparisons(): array
|
60 | 63 | return [
|
61 | 64 | [1, '1', 2, '2', 'int'],
|
62 | 65 | [2, '2', 2, '2', 'int'],
|
63 |
| - [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2005/01/01'), 'Jan 1, 2005, 12:00 AM', 'DateTime'], |
64 |
| - [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'], |
65 |
| - [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2005/01/01', 'Jan 1, 2005, 12:00 AM', 'DateTime'], |
66 |
| - [new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', '2000/01/01', 'Jan 1, 2000, 12:00 AM', 'DateTime'], |
67 |
| - [new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2005/01/01 UTC', 'Jan 1, 2005, 12:00 AM', 'DateTime'], |
68 |
| - [new \DateTime('2000/01/01 UTC'), 'Jan 1, 2000, 12:00 AM', '2000/01/01 UTC', 'Jan 1, 2000, 12:00 AM', 'DateTime'], |
| 66 | + [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'], |
| 67 | + [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'], |
| 68 | + [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'], |
| 69 | + [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'], |
| 70 | + [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'], |
| 71 | + [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'], |
69 | 72 | [new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
|
70 | 73 | [new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'],
|
71 | 74 | ['22', '"22"', '333', '"333"', 'string'],
|
72 | 75 | ['22', '"22"', '22', '"22"', 'string'],
|
73 | 76 | ];
|
74 | 77 | }
|
75 | 78 |
|
76 |
| - public static function provideComparisonsToNullValueAtPropertyPath() |
| 79 | + public static function provideComparisonsToNullValueAtPropertyPath(): array |
77 | 80 | {
|
78 | 81 | return [
|
79 | 82 | [5, '5', true],
|
|
0 commit comments