Skip to content

Commit 1919769

Browse files
author
Leon Husmann
committed
add existing checks to repo as described in the docs
1 parent b82ed17 commit 1919769

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

lib/Github/Api/Repo.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Github\Api;
44

5+
use Github\Api\Repository\Checks;
56
use Github\Api\Repository\Collaborators;
67
use Github\Api\Repository\Comments;
78
use Github\Api\Repository\Commits;
@@ -682,4 +683,16 @@ public function transfer($username, $repository, $newOwner, $teamId = [])
682683

683684
return $this->post('/repos/'.rawurldecode($username).'/'.rawurldecode($repository).'/transfer', ['new_owner' => $newOwner, 'team_id' => $teamId]);
684685
}
686+
687+
/**
688+
* Manage the checks of a repository.
689+
*
690+
* @link https://developer.github.com/v3/checks
691+
*
692+
* @return Checks
693+
*/
694+
public function checks()
695+
{
696+
return new Checks($this->client);
697+
}
685698
}

test/Github/Tests/Api/RepoTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,16 @@ public function shouldTransferRepository()
607607
$this->assertEquals($expectedArray, $api->transfer('KnpLabs', 'php-github-api', 'github', [1234, 1235]));
608608
}
609609

610+
/**
611+
* @test
612+
*/
613+
public function shouldGetChecksApiObject()
614+
{
615+
$api = $this->getApiMock();
616+
617+
$this->assertInstanceOf(\Github\Api\Repository\Checks::class, $api->checks());
618+
}
619+
610620
/**
611621
* @return string
612622
*/

0 commit comments

Comments
 (0)