Jyxo\Time\TimeTest::testCreateFromFormat PHP Method

testCreateFromFormat() public method

Tests the createFromFormat() method.
See also: Jyxo\Time\Time::createFromFormat()
    public function testCreateFromFormat()
    {
        $this->assertEquals(Time::get('2009-12-01')->format('Ym'), Time::createFromFormat('ym', '0912')->format('Ym'));
        $this->assertEquals(Time::get('2009-12-01')->format('Ymd'), Time::createFromFormat('ymd', '091201')->format('Ymd'));
        $this->assertEquals(Time::get('2009-12-01')->format('Ymd'), Time::createFromFormat('Ymd', '20091201')->format('Ymd'));
        $this->assertEquals(Time::get('2009-12-01 12:14:16')->format('Ymd His'), Time::createFromFormat('Y-m-d H:i:s', '2009-12-01 12:14:16')->format('Ymd His'));
    }