/** * @param GithubRepoDataInterface $githubRepo * @param GithubPullRequestDataInterface $githubPullRequest * @param User $user * * @return mixed */ public function fetch(GithubRepoDataInterface $githubRepo, GithubPullRequestDataInterface $githubPullRequest, User $user) { $client = $this->createClient($user); $remoteData = $client->api('repository')->pullRequestes($githubRepo->getOwner(), $githubRepo->getName(), $githubPullRequest->getName()); return $this->githubPullRequestDataFactory->create($remoteData); }
/** * @param GithubPullRequestDataInterface $remote * @param GithubPullRequest $entity * * @return bool */ public function map(GithubPullRequestDataInterface $remote, GithubPullRequest $entity) { $entity->setTitle($remote->getTitle()); return true; }
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); }