/** * @return void */ public function testSetDateInputInvalidThrowsException() { $inputInvalid = "2007foo"; try { Technorati\Utils::normalizeDate($inputInvalid); $this->fail('Expected ZendService\\Technorati\\Exception\\RuntimeException not thrown'); } catch (\Exception $e) { $this->assertContains($inputInvalid, $e->getMessage()); } }
/** * Constructs a new object object from DOM Element. * * @param DomElement $dom the ReST fragment for this object */ public function __construct(DomElement $dom) { $this->fields = array('permalink' => 'permalink', 'excerpt' => 'excerpt', 'created' => 'created', 'title' => 'title'); parent::__construct($dom); // weblog object field $this->parseWeblog(); // filter fields $this->permalink = Utils::normalizeUriHttp($this->permalink); $this->created = Utils::normalizeDate($this->created); }
/** * Constructs a new object object from DOM Element. * * @param DomElement $dom the ReST fragment for this object */ public function __construct(DomElement $dom) { $this->fields = array('nearestPermalink' => 'nearestpermalink', 'excerpt' => 'excerpt', 'linkCreated' => 'linkcreated', 'linkUrl' => 'linkurl'); parent::__construct($dom); // weblog object field $this->parseWeblog(); // filter fields $this->nearestPermalink = Utils::normalizeUriHttp($this->nearestPermalink); $this->linkUrl = Utils::normalizeUriHttp($this->linkUrl); $this->linkCreated = Utils::normalizeDate($this->linkCreated); }
/** * Sets weblog Last Update timestamp. * * $datetime can be any value supported by * Utils::normalizeDate(). * * @param mixed $datetime A string representing the last update date time * in a valid date time format * @return Weblog $this instance * @throws Exception\RuntimeException */ public function setLastUpdate($datetime) { $this->lastUpdate = Utils::normalizeDate($datetime); return $this; }