示例#1
0
 /**
  * @param GithubCommitDataInterface $remote
  * @param GithubCommit              $entity
  *
  * @return bool
  */
 public function map(GithubCommitDataInterface $remote, GithubCommit $entity)
 {
     $entity->setSha($remote->getSha());
     $entity->setAuthorDate($remote->getAuthorDate());
     $entity->setCommitterDate($remote->getCommitterDate());
     $entity->setMessage($remote->getMessage());
     return true;
 }
 public function it_will_map_property_values_from_remote_to_entity(GithubCommitDataInterface $remote, GithubCommit $entity, DateTime $authorDate, DateTime $committerDate)
 {
     $remote->getSha()->willReturn('name');
     $remote->getAuthorDate()->willReturn($authorDate);
     $remote->getCommitterDate()->willReturn($committerDate);
     $remote->getMessage()->willReturn('message');
     $entity->setSha('name')->shouldBeCalled();
     $entity->setAuthorDate($authorDate)->shouldBeCalled();
     $entity->setCommitterDate($committerDate)->shouldBeCalled();
     $entity->setMessage('message')->shouldBeCalled();
     $this->map($remote, $entity)->shouldReturn(true);
 }