コード例 #1
0
ファイル: UrlTest.php プロジェクト: remi-san/twitter
 /**
  * @test
  */
 public function itShouldBuildTheObject()
 {
     $urlObject = TwitterUrl::create($this->url, $this->displayUrl, $this->expandedUrl, $this->indices);
     $this->assertEquals($this->url, $urlObject->getUrl());
     $this->assertEquals($this->displayUrl, $urlObject->getDisplayUrl());
     $this->assertEquals($this->expandedUrl, $urlObject->getExpandedUrl());
     $this->assertEquals($this->indices, $urlObject->getIndices());
 }
コード例 #2
0
 /**
  * @param  \stdClass $obj
  * @param  array     $context
  * @return TwitterUrl
  */
 public function unserialize($obj, array $context = [])
 {
     Assertion::true($this->canUnserialize($obj), 'object is not unserializable');
     return TwitterUrl::create($obj->url, $obj->display_url, $obj->expanded_url, $this->entityIndicesSerializer->unserialize($obj->indices));
 }
コード例 #3
0
 /**
  * @return TwitterUrl
  */
 private function getValidObject()
 {
     return TwitterUrl::create($this->url, $this->displayUrl, $this->expandedUrl, $this->indices);
 }