/** * Test transform to DateTime */ public function testToDateTime() { $this->assertInstanceOf('Zork\\Stdlib\\DateTime', Transform::toDateTime(new DateTime())); $this->assertInstanceOf('Zork\\Stdlib\\DateTime', Transform::toDateTime(new \DateTime())); $this->assertInstanceOf('Zork\\Stdlib\\DateTime', Transform::toDateTime(time())); $this->assertInstanceOf('Zork\\Stdlib\\DateTime', Transform::toDateTime(date('Y-m-d H:i:s'))); $this->assertInstanceOf('Zork\\Stdlib\\DateTime', Transform::toDateTime(date('Y-m-dTH:i:s'))); $this->assertInstanceOf('Zork\\Stdlib\\DateTime', Transform::toDateTime(date(DATE_ISO8601))); $this->assertInstanceOf('Zork\\Stdlib\\DateTime', Transform::toDateTime(date(DATE_W3C))); $this->assertInstanceOf('Zork\\Stdlib\\DateTime', Transform::toDateTime($this)); }