diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-03-06 21:13:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-06 21:13:48 +0100 |
commit | 9971f7c82cc47446b457464cec5b4fefcae470e1 (patch) | |
tree | 87b01fc1dd9d0ca1f0c874aad847029eab74d0d8 /tests/languages/de/UtilsDeTest.php | |
parent | 236239be752a7bb24547237b5751ac4fcbc0e549 (diff) | |
parent | 36c8fb1ef869c29e783f0dd5ebef2fb5566e2611 (diff) | |
download | Shaarli-9971f7c82cc47446b457464cec5b4fefcae470e1.tar.gz Shaarli-9971f7c82cc47446b457464cec5b4fefcae470e1.tar.zst Shaarli-9971f7c82cc47446b457464cec5b4fefcae470e1.zip |
Merge pull request #750 from ArthurHoaro/feature/intl-dates
Improve datetime display
Diffstat (limited to 'tests/languages/de/UtilsDeTest.php')
-rw-r--r-- | tests/languages/de/UtilsDeTest.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/languages/de/UtilsDeTest.php b/tests/languages/de/UtilsDeTest.php new file mode 100644 index 00000000..8a740389 --- /dev/null +++ b/tests/languages/de/UtilsDeTest.php | |||
@@ -0,0 +1,25 @@ | |||
1 | <?php | ||
2 | |||
3 | require_once 'tests/UtilsTest.php'; | ||
4 | |||
5 | |||
6 | class UtilsDeTest extends UtilsTest | ||
7 | { | ||
8 | /** | ||
9 | * Test date_format(). | ||
10 | */ | ||
11 | public function testDateFormat() | ||
12 | { | ||
13 | $date = DateTime::createFromFormat('Ymd_His', '20170101_101112'); | ||
14 | $this->assertRegExp('/1. Januar 2017 (um )?10:11:12 GMT\+0?3(:00)?/', format_date($date, true)); | ||
15 | } | ||
16 | |||
17 | /** | ||
18 | * Test date_format() using builtin PHP function strftime. | ||
19 | */ | ||
20 | public function testDateFormatDefault() | ||
21 | { | ||
22 | $date = DateTime::createFromFormat('Ymd_His', '20170101_101112'); | ||
23 | $this->assertEquals('So 01 Jan 2017 10:11:12 EAT', format_date($date, false)); | ||
24 | } | ||
25 | } | ||