]>
Commit | Line | Data |
---|---|---|
52b50310 A |
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 | } |