public function getDate() { $date = $this->getMeta('SERVER.REQUEST_TIME'); if ($date) { return new DateTime('@' . $date); } return new DateTime('now'); }
public function testGetDateFallback() { $data = array('meta' => array('SERVER' => array())); $profile = new Xhgui_Profile($data); $result = $profile->getDate(); $this->assertInstanceOf('DateTime', $result); }