Skip to content

Commit

Permalink
Merge pull request #22 from localheinz/fix/participation
Browse files Browse the repository at this point in the history
Fix: Participation vs. partecipation
  • Loading branch information
Gianluca Arbezzano committed Mar 6, 2015
2 parents da9c895 + c74af1e commit 6fdb8f2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
15 changes: 13 additions & 2 deletions src/EdpGithub/Api/Repos.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,25 @@ public function codeFrequency($owner, $repo)
}

/**
* Get partecipation
* @param string $owner
* @param string $repo
* @return string
*/
public function participation($owner, $repo)
{
return $this->get('repos/' . $owner . '/' . $repo . '/stats/participation');
}

/**
* @deprecated
*
* @param string $owner
* @param string $repo
* @return string
*/
public function partecipation($owner, $repo)
{
return $this->get('repos/' . $owner . '/' . $repo . '/stats/partecipation');
return $this->participation($owner, $repo);
}

/**
Expand Down
13 changes: 12 additions & 1 deletion test/EdpGithubTest/Api/ReposTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,21 @@ public function testCodeFrequency()
$this->assertEquals($result, $expectedArray);
}

public function testParticipation()
{
$expectedArray = array('id' => 1, 'name' => 'repo');
$client = $this->getClientMock('repos/owner/repo/stats/participation', $expectedArray);
$api = new Repos();
$api->setClient($client);
$result = $api->participation('owner', 'repo');

$this->assertEquals($result, $expectedArray);
}

public function testPartecipation()
{
$expectedArray = array('id' => 1, 'name' => 'repo');
$client = $this->getClientMock('repos/owner/repo/stats/partecipation', $expectedArray);
$client = $this->getClientMock('repos/owner/repo/stats/participation', $expectedArray);
$api = new Repos();
$api->setClient($client);
$result = $api->partecipation('owner', 'repo');
Expand Down

0 comments on commit 6fdb8f2

Please sign in to comment.