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); }
/** * @param GithubTagDataInterface $remote * @param GithubTag $entity * * @return bool */ public function map(GithubTagDataInterface $remote, GithubTag $entity) { $entity->setName($remote->getName()); return true; }
/** * @param GithubRepoDataInterface $githubRepo * @param GithubTagDataInterface $githubTag * @param User $user * * @return mixed */ public function fetch(GithubRepoDataInterface $githubRepo, GithubTagDataInterface $githubTag, User $user) { $client = $this->createClient($user); $remoteData = $client->api('repository')->tages($githubRepo->getOwner(), $githubRepo->getName(), $githubTag->getName()); return $this->githubTagDataFactory->create($remoteData); }