Пример #1
0
 /**
  * @test
  */
 public function itShouldBuildTheObject()
 {
     $userMention = TwitterUserMention::create($this->id, $this->screenName, $this->name, $this->indices);
     $this->assertEquals($this->id, $userMention->getId());
     $this->assertEquals($this->screenName, $userMention->getScreenName());
     $this->assertEquals($this->name, $userMention->getName());
     $this->assertEquals($this->indices, $userMention->getIndices());
     $this->assertEquals('@' . $this->screenName, (string) $userMention);
 }
Пример #2
0
 private function messageContainsUserMention()
 {
     $this->userMention->shouldReceive('__toString')->andReturn('@' . $this->userName);
     $this->entities->shouldReceive('getUserMentions')->withNoArgs()->andReturn(array($this->userMention));
 }
 /**
  * @return TwitterUserMention
  */
 private function getValidObject()
 {
     return TwitterUserMention::create($this->id, $this->screenName, $this->name, $this->indices);
 }
 /**
  * @param  \stdClass $obj
  * @param  array     $context
  * @return TwitterUserMention
  */
 public function unserialize($obj, array $context = [])
 {
     Assertion::true($this->canUnserialize($obj), 'object is not unserializable');
     return TwitterUserMention::create($obj->id, $obj->screen_name, $obj->name, $this->entityIndicesSerializer->unserialize($obj->indices));
 }