Skip to content

Commit

Permalink
fix intl-extra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Jan 24, 2025
1 parent 939c032 commit fb18767
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
6 changes: 4 additions & 2 deletions extra/intl-extra/Tests/Fixtures/format_date.test
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--TEST--
"format_date" filter
--CONDITION--
version_compare(Symfony\Component\Intl\Intl::getIcuVersion(), '72.1', '<')
--TEMPLATE--
{{ '2019-08-07 23:39:12'|format_datetime() }}
{{ '2019-08-07 23:39:12'|format_datetime(locale='fr') }}
Expand All @@ -14,7 +16,7 @@
--DATA--
return [];
--EXPECT--
Aug 7, 2019, 11:39:12 PM
Aug 7, 2019, 11:39:12PM
7 août 2019, 23:39:12
23:39
07/08/2019
Expand All @@ -23,4 +25,4 @@ mercredi 7 août 2019 à 23:39:12 temps universel coordonné

Aug 7, 2019
7 août 2019
11:39:12 PM
11:39:12PM
28 changes: 28 additions & 0 deletions extra/intl-extra/Tests/Fixtures/format_date_ICU72.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
--TEST--
"format_date" filter
--CONDITION--
version_compare(Symfony\Component\Intl\Intl::getIcuVersion(), '72.1', '>=')
--TEMPLATE--
{{ '2019-08-07 23:39:12'|format_datetime() }}
{{ '2019-08-07 23:39:12'|format_datetime(locale='fr') }}
{{ '2019-08-07 23:39:12'|format_datetime('none', 'short', locale='fr') }}
{{ '2019-08-07 23:39:12'|format_datetime('short', 'none', locale='fr') }}
{{ '2019-08-07 23:39:12'|format_datetime('full', 'full', locale='fr') }}
{{ '2019-08-07 23:39:12'|format_datetime(pattern="hh 'oclock' a, zzzz") }}

{{ '2019-08-07 23:39:12'|format_date }}
{{ '2019-08-07 23:39:12'|format_date(locale='fr') }}
{{ '2019-08-07 23:39:12'|format_time }}
--DATA--
return [];
--EXPECT--
Aug 7, 2019, 11:39:12 PM
7 août 2019, 23:39:12
23:39
07/08/2019
mercredi 7 août 2019 à 23:39:12 temps universel coordonné
11 oclock PM, Coordinated Universal Time

Aug 7, 2019
7 août 2019
11:39:12 PM
2 changes: 1 addition & 1 deletion extra/intl-extra/Tests/Fixtures/format_date_php8.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--TEST--
"format_date" filter
--CONDITION--
PHP_VERSION_ID >= 80000
PHP_VERSION_ID >= 80000 && version_compare(Symfony\Component\Intl\Intl::getIcuVersion(), '72.1', '<')
--TEMPLATE--
{{ 'today 23:39:12'|format_datetime('relative_short', 'none', locale='fr') }}
{{ 'today 23:39:12'|format_datetime('relative_full', 'full', locale='fr') }}
Expand Down
12 changes: 12 additions & 0 deletions extra/intl-extra/Tests/Fixtures/format_date_php8_ICU72.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
"format_date" filter
--CONDITION--
PHP_VERSION_ID >= 80000 && version_compare(Symfony\Component\Intl\Intl::getIcuVersion(), '72.1', '>=')
--TEMPLATE--
{{ 'today 23:39:12'|format_datetime('relative_short', 'none', locale='fr') }}
{{ 'today 23:39:12'|format_datetime('relative_full', 'full', locale='fr') }}
--DATA--
return [];
--EXPECT--
aujourd’hui
aujourd’hui, 23:39:12 temps universel coordonné

0 comments on commit fb18767

Please sign in to comment.