/** * @test */ public function itShouldBuildTheObject() { $hashtag = TwitterHashtag::create($this->text, $this->indices); $this->assertEquals($this->text, $hashtag->getText()); $this->assertEquals($this->indices, $hashtag->getIndices()); $this->assertEquals('#' . $this->text, (string) $hashtag); }
/** * @param \stdClass $obj * @param array $context * @return TwitterHashtag */ public function unserialize($obj, array $context = []) { Assertion::true($this->canUnserialize($obj), 'object is not unserializable'); return TwitterHashtag::create($obj->text, $this->entityIndicesSerializer->unserialize($obj->indices)); }
/** * @return TwitterHashtag */ private function getValidObject() { return TwitterHashtag::create($this->text, $this->indices); }