Example #1
0
 /**
  * @param GithubRepo $githubRepo
  * @param Branch     $branchValueObject
  *
  * @return GithubBranch
  */
 public function createFromValueObject(GithubRepo $githubRepo, Branch $branchValueObject)
 {
     $githubBranch = new GithubBranch();
     $githubBranch->setRepo($githubRepo);
     $this->mapper->map($branchValueObject, $githubBranch);
     return $githubBranch;
 }
Example #2
0
 /**
  * @Given there is :branchName branch on :githubRepoFullName github repo
  *
  * @param $branchName
  * @param $githubRepoFullName
  *
  * @throws \Exception
  */
 public function thereIsBranchOnGithubRepo($branchName, $githubRepoFullName)
 {
     $branch = new GithubBranch();
     $branch->setName($branchName)->setRepo($this->getGithubRepoByFullName($githubRepoFullName));
     $this->save($branch);
 }
 public function it_will_map_property_values_from_remote_to_entity(GithubBranchDataInterface $remote, GithubBranch $entity)
 {
     $remote->getName()->willReturn('name');
     $entity->setName('name')->shouldBeCalled();
     $this->map($remote, $entity)->shouldReturn(true);
 }
Example #4
0
 /**
  * @When I fill in details for :message github commit
  *
  * @param $message
  */
 public function iFillInDetailsForGithubCommit($message)
 {
     $this->target->setSha('sha1')->setMessage($message)->setGithubRepo($this->repo)->setAuthorDate(new \DateTime('2015-01-05 06:07:08'))->setCommitterDate(new \DateTime('2015-01-05 06:07:08'));
     $this->branch->setLastCommit($this->target);
     $this->validateAndSave($this->branch);
 }
Example #5
0
 /**
  * @param $name
  *
  * @return GithubBranch
  */
 private function createBranchObjectFromBranchName($name)
 {
     $branch = new GithubBranch();
     $branch->setName($name);
     return $branch;
 }
 /**
  * @param GithubBranchDataInterface $remote
  * @param GithubBranch              $entity
  *
  * @return bool
  */
 public function map(GithubBranchDataInterface $remote, GithubBranch $entity)
 {
     $entity->setName($remote->getName());
     return true;
 }
Example #7
0
 /**
  * @param \DevBoard\Github\Branch\Entity\GithubBranch  $masterBranch
  * @param \DevBoard\Github\Branch\Entity\GithubBranch  $devBranch
  * @param \Doctrine\Common\Collections\ArrayCollection $collection
  */
 public function it_can_return_branch_if_exists_on_repo($masterBranch, $devBranch, $collection)
 {
     $masterBranch->getName()->willReturn('master')->shouldBeCalled();
     $devBranch->getName()->willReturn('dev')->shouldBeCalled();
     $collection->getIterator()->willReturn(new \ArrayIterator([$masterBranch->getWrappedObject(), $devBranch->getWrappedObject()]));
     $this->setBranches($collection);
     $this->getBranchByName('dev')->shouldReturn($devBranch);
 }