Skip to content

Commit

Permalink
Fix: Method is misspelled, too
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Mar 6, 2015
1 parent dc9d973 commit c74af1e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 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,16 +78,27 @@ public function codeFrequency($owner, $repo)
}

/**
* Get partecipation
* @param string $owner
* @param string $repo
* @return string
*/
public function partecipation($owner, $repo)
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->participation($owner, $repo);
}

/**
* Get punch card
* @param string $owner
Expand Down
11 changes: 11 additions & 0 deletions test/EdpGithubTest/Api/ReposTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ 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');
Expand Down

0 comments on commit c74af1e

Please sign in to comment.