Esempio n. 1
0
 /**
  * Finds a gist by ID. Grabs data from Eloquent and GitHub API.
  *
  * @param $id
  * @return Gist
  */
 public function findById($id)
 {
     $eloquentGist = EloquentGist::find($id);
     $gh = new GitHub($eloquentGist->user);
     $gist = $gh->gist($id);
     $this->updateFromGitHub($id, $gist);
     return Gist::fromGitHub($eloquentGist, $gist);
 }
Esempio n. 2
0
 /** @test */
 public function it_should_return_correct_votes_gh()
 {
     list($eloquentGist, $githubGist) = $this->buildGithubGist();
     $gistFromGithub = Gist::fromGitHub($eloquentGist, $githubGist);
     $this->assertCount(0, $gistFromGithub->getPositiveVotes());
     $this->assertCount(1, $gistFromGithub->getNegativeVotes());
 }