コード例 #1
0
ファイル: UtilsTest.php プロジェクト: allan2012/laraspiked
 /**
  * @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());
     }
 }
コード例 #2
0
ファイル: SearchResult.php プロジェクト: allan2012/laraspiked
 /**
  * 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);
 }
コード例 #3
0
ファイル: CosmosResult.php プロジェクト: allan2012/laraspiked
 /**
  * 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);
 }
コード例 #4
0
ファイル: Weblog.php プロジェクト: allan2012/laraspiked
 /**
  * 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;
 }