diff --git a/lib/Github/Api/Repo.php b/lib/Github/Api/Repo.php index c8e6a24d631..37cb8aac794 100644 --- a/lib/Github/Api/Repo.php +++ b/lib/Github/Api/Repo.php @@ -2,6 +2,7 @@ namespace Github\Api; +use Github\Api\Repository\Checks; use Github\Api\Repository\Collaborators; use Github\Api\Repository\Comments; use Github\Api\Repository\Commits; @@ -682,4 +683,16 @@ public function transfer($username, $repository, $newOwner, $teamId = []) return $this->post('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/transfer', ['new_owner' => $newOwner, 'team_id' => $teamId]); } + + /** + * Manage the checks of a repository. + * + * @link https://developer.github.com/v3/checks + * + * @return Checks + */ + public function checks() + { + return new Checks($this->client); + } } diff --git a/test/Github/Tests/Api/RepoTest.php b/test/Github/Tests/Api/RepoTest.php index 3ddf7cf8054..e6dfaa619a9 100644 --- a/test/Github/Tests/Api/RepoTest.php +++ b/test/Github/Tests/Api/RepoTest.php @@ -607,6 +607,16 @@ public function shouldTransferRepository() $this->assertEquals($expectedArray, $api->transfer('KnpLabs', 'php-github-api', 'github', [1234, 1235])); } + /** + * @test + */ + public function shouldGetChecksApiObject() + { + $api = $this->getApiMock(); + + $this->assertInstanceOf(\Github\Api\Repository\Checks::class, $api->checks()); + } + /** * @return string */