1<?php
2/**
3 * Copyright 2011-2017 Horde LLC (http://www.horde.org/)
4 *
5 * See the enclosed file COPYING for license information (LGPL). If you
6 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
7 *
8 * @category   Horde
9 * @copyright  2011-2016 Horde LLC
10 * @license    http://www.horde.org/licenses/lgpl21 LGPL 2.1
11 * @package    Imap_Client
12 * @subpackage UnitTests
13 */
14
15/**
16 * Tests for the DateTime data format object.
17 *
18 * @author     Michael Slusarz <slusarz@horde.org>
19 * @category   Horde
20 * @copyright  2011-2016 Horde LLC
21 * @ignore
22 * @license    http://www.horde.org/licenses/lgpl21 LGPL 2.1
23 * @package    Imap_Client
24 * @subpackage UnitTests
25 */
26class Horde_Imap_Client_Data_Format_DateTimeTest
27extends Horde_Imap_Client_Data_Format_TestBase
28{
29    protected function getTestObs()
30    {
31        return array(
32            new Horde_Imap_Client_Data_Format_DateTime('January 1, 2010'),
33            new Horde_Imap_Client_Data_Format_DateTime('@1262304000')
34        );
35    }
36
37    /**
38     * @dataProvider obsProvider
39     */
40    public function testConstructor($ob)
41    {
42        $this->assertEquals(
43            new Horde_Imap_Client_DateTime('January 1, 2010'),
44            $ob->getData()
45        );
46    }
47
48    /**
49     * @dataProvider obsProvider
50     */
51    public function testStringRepresentation($ob)
52    {
53        $this->assertEquals(
54            '1-Jan-2010 00:00:00 +0000',
55            strval($ob)
56        );
57    }
58
59    /**
60     * @dataProvider obsProvider
61     */
62    public function testEscape($ob)
63    {
64        $this->assertEquals(
65            '"1-Jan-2010 00:00:00 +0000"',
66            $ob->escape()
67        );
68    }
69
70}
71