/** * @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()); }
/** * @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)); }
/** * @return TwitterUrl */ private function getValidObject() { return TwitterUrl::create($this->url, $this->displayUrl, $this->expandedUrl, $this->indices); }