Beispiel #1
0
 /**
  * @param GithubRepo $githubRepo
  * @param            $sha
  *
  * @return GithubCommit
  */
 private function createCommitObjectFromSha(GithubRepo $githubRepo, $sha)
 {
     $commit = new GithubCommit();
     $commit->setGithubRepo($githubRepo);
     $commit->setSha($sha);
     return $commit;
 }
 /**
  * @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);
 }
 /**
  * @param $sha
  *
  * @return GithubCommit
  */
 public function create($sha)
 {
     $commit = new GithubCommit();
     $commit->setSha($sha);
     return $commit;
 }