コード例 #1
0
ファイル: HookClientSpec.php プロジェクト: brankol/devboard
 public function let(Client $client, HookSettings $hookSettings, GithubRepo $githubRepo, Repo $repo, Hooks $hooks)
 {
     $githubRepo->getOwner()->willReturn('owner');
     $githubRepo->getName()->willReturn('repository');
     $client->repo()->willReturn($repo);
     $repo->hooks()->willReturn($hooks);
     $hookSettings->getCreateHookParams()->willReturn(['params']);
     $this->beConstructedWith($client, $hookSettings, $githubRepo);
 }
コード例 #2
0
 public function it_will_fetch_commit_details_from_github($authenticatedClientFactory, $githubCommitDataFactory, GithubCommitDataInterface $githubCommit, GithubRepo $githubRepo, User $user, Client $client, Repo $repositoryApi, Commits $commitApi, GithubCommitData $githubCommitData)
 {
     $githubRepo->getOwner()->willReturn('owner');
     $githubRepo->getName()->willReturn('name');
     $githubCommit->getSha()->willReturn('sha');
     $authenticatedClientFactory->create($user)->willReturn($client);
     $client->api('repository')->willReturn($repositoryApi);
     $repositoryApi->commits()->willReturn($commitApi);
     $commitApi->show('owner', 'name', 'sha')->willReturn(['data']);
     $githubCommitDataFactory->create($githubRepo, ['data'])->willReturn($githubCommitData);
     $this->fetch($githubCommit, $githubRepo, $user)->shouldReturn($githubCommitData);
 }