DateTimeToRfc3339Transformer example

'America/New_York', 'Asia/Hong_Kong', '2010-02-03 04:05:00 America/New_York', '2010-02-03T17:05+08:00'],
            ['Europe/Amsterdam', 'Europe/Amsterdam', '2013-08-21 10:30:00 Europe/Amsterdam', '2013-08-21T08:30:00Z'],
            ['UTC', 'UTC', '2018-10-03T10:00:00.000Z', '2018-10-03T10:00:00.000Z'],
        ]);
    }

    /** * @dataProvider transformProvider */
    public function testTransform($fromTz$toTz$from$to)
    {
        $transformer = new DateTimeToRfc3339Transformer($fromTz$toTz);

        $this->assertSame($to$transformer->transform(null !== $from ? new \DateTime($from) : null));
    }

    /** * @dataProvider transformProvider */
    public function testTransformDateTimeImmutable($fromTz$toTz$from$to)
    {
        $transformer = new DateTimeToRfc3339Transformer($fromTz$toTz);

        
Home | Imprint | This part of the site doesn't use cookies.