/** * @param GithubRepo $githubRepo * @param Tag $tagValueObject * * @return GithubTag */ public function createFromValueObject(GithubRepo $githubRepo, Tag $tagValueObject) { $githubTag = new GithubTag(); $githubTag->setRepo($githubRepo); $this->mapper->map($tagValueObject, $githubTag); return $githubTag; }
/** * @param GithubTagDataInterface $remote * @param GithubTag $entity * * @return bool */ public function map(GithubTagDataInterface $remote, GithubTag $entity) { $entity->setName($remote->getName()); return true; }
public function it_will_map_property_values_from_remote_to_entity(GithubTagDataInterface $remote, GithubTag $entity) { $remote->getName()->willReturn('name'); $entity->setName('name')->shouldBeCalled(); $this->map($remote, $entity)->shouldReturn(true); }
/** * @Given there is :tagName tag on :githubRepoFullName github repo * * @param $tagName * @param $githubRepoFullName * * @throws \Exception */ public function thereIsTagOnGithubRepo($tagName, $githubRepoFullName) { $tag = new GithubTag(); $tag->setName($tagName)->setRepo($this->getGithubRepoByFullName($githubRepoFullName)); $this->save($tag); }
/** * @param $name * * @return GithubTag */ private function createTagObjectFromTagName($name) { $tag = new GithubTag(); $tag->setName($name); return $tag; }