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 DateFormatConverterTest extends StructTest
12{
13    public function data_todate()
14    {
15        return [
16            ['Sometime %H:%M:%S %%', '\\S\\o\\m\\e\\t\\i\\m\\e H:i:s %'],
17        ];
18    }
19
20    /**
21     * @dataProvider data_todate
22     */
23    public function test_todate($input, $expect)
24    {
25        $this->assertEquals($expect, DateFormatConverter::toDate($input));
26    }
27
28
29    public function data_tostrftime()
30    {
31        return [
32            ['\\S\\o\\m\\e\\t\\i\\m\\e H:i:s %', 'Sometime %H:%M:%S %%'],
33        ];
34    }
35
36    /**
37     * @dataProvider data_tostrftime
38     */
39    public function test_tostrftime($input, $expect)
40    {
41        $this->assertEquals($expect, DateFormatConverter::toStrftime($input));
42    }
43}
44