/** * @param GithubPullRequestDataInterface $remote * @param GithubPullRequest $entity * * @return bool */ public function map(GithubPullRequestDataInterface $remote, GithubPullRequest $entity) { $entity->setTitle($remote->getTitle()); return true; }
/** * @param $name * * @return GithubPullRequest */ private function createPullRequestObjectFromPullRequestName($name) { $pullRequest = new GithubPullRequest(); $pullRequest->setName($name); return $pullRequest; }
/** * @param GithubRepo $githubRepo * @param PullRequest $pullRequestValueObject * * @return GithubPullRequest */ public function createFromValueObject(GithubRepo $githubRepo, PullRequest $pullRequestValueObject) { $githubPullRequest = new GithubPullRequest(); $githubPullRequest->setRepo($githubRepo); $githubPullRequest->setNumber($pullRequestValueObject->getNumber()); $githubPullRequest->setTitle($pullRequestValueObject->getTitle()); $githubPullRequest->setBody($pullRequestValueObject->getBody()); $githubPullRequest->setState(GithubPullRequestState::convert($pullRequestValueObject->getState())); $githubPullRequest->setLocked($pullRequestValueObject->isLocked()); $githubPullRequest->setMerged($pullRequestValueObject->isMerged()); $githubPullRequest->setGithubCreatedAt($pullRequestValueObject->getGithubCreatedAt()); $githubPullRequest->setGithubUpdatedAt($pullRequestValueObject->getGithubUpdatedAt()); $this->mapper->map($pullRequestValueObject, $githubPullRequest); return $githubPullRequest; }
/** * @Given there is :pullRequestName pullRequest on :githubRepoFullName github repo * * @param $pullRequestName * @param $githubRepoFullName * * @throws \Exception */ public function thereIsPullRequestOnGithubRepo($pullRequestName, $githubRepoFullName) { $pullRequest = new GithubPullRequest(); $pullRequest->setName($pullRequestName)->setRepo($this->getGithubRepoByFullName($githubRepoFullName)); $this->save($pullRequest); }
public function it_will_map_property_values_from_remote_to_entity(GithubPullRequestDataInterface $remote, GithubPullRequest $entity) { $remote->getTitle()->willReturn('name'); $entity->setTitle('name')->shouldBeCalled(); $this->map($remote, $entity)->shouldReturn(true); }