From ac1d390bdb3d1ea3db394e46d20480c7b360ab51 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 6 Aug 2024 06:56:07 +0200 Subject: [PATCH] x --- tests/filters/localDate.phpt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/filters/localDate.phpt b/tests/filters/localDate.phpt index 288b1f23f..6c072dedb 100644 --- a/tests/filters/localDate.phpt +++ b/tests/filters/localDate.phpt @@ -2,7 +2,6 @@ /** * Test: Latte\Essential\Filters::localDate() - * @phpVersion 8.1 */ declare(strict_types=1); @@ -44,14 +43,16 @@ test('timestamp & zone', function () { Assert::same('7:09', $filters->localDate(1_408_284_571, 'jm')); }); -test('skeleton pattern', function () { - $filters = new Filters; - $filters->locale = 'cs_CZ'; +if (PHP_VERSION_ID >= 80100) { + test('skeleton pattern', function () { + $filters = new Filters; + $filters->locale = 'cs_CZ'; - Assert::same('květen', $filters->localDate('1978-05-05', 'MMMM')); - Assert::same('5. května', $filters->localDate('1978-05-05', 'd MMMM')); - Assert::same('květen 78', $filters->localDate('1978-05-05', 'MMMM yy')); -}); + Assert::same('květen', $filters->localDate('1978-05-05', 'MMMM')); + Assert::same('5. května', $filters->localDate('1978-05-05', 'd MMMM')); + Assert::same('květen 78', $filters->localDate('1978-05-05', 'MMMM yy')); + }); +} test('full/long/medium/short', function () { $filters = new Filters; @@ -67,7 +68,7 @@ test('full/long/medium/short', function () { Assert::same('12:13', $filters->localDate('12:13:14', time: 'short')); Assert::same('12:13:14', $filters->localDate('12:13:14', time: 'medium')); Assert::same('12:13:14 PDT', $filters->localDate('12:13:14', time: 'long')); - Assert::same('12:13:14, severoamerický pacifický letní čas', $filters->localDate('12:13:14', time: 'full')); + Assert::match('12:13:14%a%', $filters->localDate('12:13:14', time: 'full')); // combined Assert::same('05.05.78 12:13', $filters->localDate('1978-05-05 12:13:14', date: 'short', time: 'short'));