1<?php
2
3namespace dokuwiki\plugin\struct\test;
4
5use dokuwiki\plugin\struct\meta\DateFormatConverter;
6
7/**
8 * @group plugin_struct
9 * @group plugins
10 */
11class DateFormatConverter_struct_test extends StructTest
12{
13
14
15    public function data_todate()
16    {
17        return array(
18            array('Sometime %H:%M:%S %%', '\\S\\o\\m\\e\\t\\i\\m\\e H:i:s %'),
19        );
20    }
21
22    /**
23     * @dataProvider data_todate
24     */
25    public function test_todate($input, $expect)
26    {
27        $this->assertEquals($expect, DateFormatConverter::toDate($input));
28    }
29
30
31    public function data_tostrftime()
32    {
33        return array(
34            array('\\S\\o\\m\\e\\t\\i\\m\\e H:i:s %', 'Sometime %H:%M:%S %%'),
35        );
36    }
37
38    /**
39     * @dataProvider data_tostrftime
40     */
41    public function test_tostrftime($input, $expect)
42    {
43        $this->assertEquals($expect, DateFormatConverter::toStrftime($input));
44    }
45}
46