diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-03-28 20:40:14 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-03-28 20:43:30 +0200 |
commit | 81bd104daa26204b8deffcd2d0723d234c9514a6 (patch) | |
tree | 78caf8953e049376a4b33cb3810c4fc7dd56704f /tests/languages/fr | |
parent | b64d83cd2b60b6851741787f8ce2ae2c93092841 (diff) | |
download | Shaarli-81bd104daa26204b8deffcd2d0723d234c9514a6.tar.gz Shaarli-81bd104daa26204b8deffcd2d0723d234c9514a6.tar.zst Shaarli-81bd104daa26204b8deffcd2d0723d234c9514a6.zip |
Theme: use format_date function for daily date
Diffstat (limited to 'tests/languages/fr')
-rw-r--r-- | tests/languages/fr/UtilsFrTest.php | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/languages/fr/UtilsFrTest.php b/tests/languages/fr/UtilsFrTest.php index 45996ee2..0d50a878 100644 --- a/tests/languages/fr/UtilsFrTest.php +++ b/tests/languages/fr/UtilsFrTest.php | |||
@@ -15,12 +15,30 @@ class UtilsFrTest extends UtilsTest | |||
15 | } | 15 | } |
16 | 16 | ||
17 | /** | 17 | /** |
18 | * Test date_format() without time. | ||
19 | */ | ||
20 | public function testDateFormatNoTime() | ||
21 | { | ||
22 | $date = DateTime::createFromFormat('Ymd_His', '20170101_101112'); | ||
23 | $this->assertRegExp('/1 janvier 2017/', format_date($date, false, true)); | ||
24 | } | ||
25 | |||
26 | /** | ||
18 | * Test date_format() using builtin PHP function strftime. | 27 | * Test date_format() using builtin PHP function strftime. |
19 | */ | 28 | */ |
20 | public function testDateFormatDefault() | 29 | public function testDateFormatDefault() |
21 | { | 30 | { |
22 | $date = DateTime::createFromFormat('Ymd_His', '20170101_101112'); | 31 | $date = DateTime::createFromFormat('Ymd_His', '20170101_101112'); |
23 | $this->assertEquals('dim. 01 janv. 2017 10:11:12 EAT', format_date($date, false)); | 32 | $this->assertEquals('dim. 01 janv. 2017 10:11:12 EAT', format_date($date, true, false)); |
33 | } | ||
34 | |||
35 | /** | ||
36 | * Test date_format() using builtin PHP function strftime without time. | ||
37 | */ | ||
38 | public function testDateFormatDefaultNoTime() | ||
39 | { | ||
40 | $date = DateTime::createFromFormat('Ymd_His', '20170201_101112'); | ||
41 | $this->assertEquals('01/02/2017', format_date($date, false, false)); | ||
24 | } | 42 | } |
25 | 43 | ||
26 | /** | 44 | /** |