Пример #1
0
 /**
  * @param  \stdClass $obj
  * @param  array     $context
  * @return TwitterSymbol
  */
 public function unserialize($obj, array $context = [])
 {
     Assertion::true($this->canUnserialize($obj), 'object is not unserializable');
     return TwitterSymbol::create($obj->text, $this->entityIndicesSerializer->unserialize($obj->indices));
 }
Пример #2
0
 /**
  * @test
  */
 public function itShouldBuildTheObject()
 {
     $symbol = TwitterSymbol::create($this->text, $this->indices);
     $this->assertEquals($this->text, $symbol->getText());
     $this->assertEquals($this->indices, $symbol->getIndices());
 }