Skip to content

Commit 8e207cb

Browse files
Added test for the new activity() method.
1 parent f082186 commit 8e207cb

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/Github/Tests/Api/RepoTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,22 @@ public function shouldGetReleasesApiObject()
417417
$this->assertInstanceOf('Github\Api\Repository\Releases', $api->releases());
418418
}
419419

420+
/**
421+
* @test
422+
*/
423+
public function shouldGetCommitActivity()
424+
{
425+
$expectedArray = array(array('days' => array(0, 3, 26, 20, 39, 1, 0), 'total' => 89, 'week' => 1336280400));
426+
427+
$api = $this->getApiMock();
428+
$api->expects($this->once())
429+
->method('get')
430+
->with('repos/KnpLabs/php-github-api/stats/commit_activity')
431+
->will($this->returnValue($expectedArray));
432+
433+
$this->assertEquals($expectedArray, $api->activity('KnpLabs', 'php-github-api'));
434+
}
435+
420436
protected function getApiClass()
421437
{
422438
return 'Github\Api\Repo';

0 commit comments

Comments
 (0)