diff --git a/lib/Github/Api/PullRequest/ReviewRequest.php b/lib/Github/Api/PullRequest/ReviewRequest.php index 8321fd27cac..540307559e2 100644 --- a/lib/Github/Api/PullRequest/ReviewRequest.php +++ b/lib/Github/Api/PullRequest/ReviewRequest.php @@ -39,12 +39,13 @@ public function all($username, $repository, $pullRequest, array $params = []) * @param string $repository * @param int $pullRequest * @param array $reviewers + * @param array $teamReviewers * * @return string */ - public function create($username, $repository, $pullRequest, array $reviewers) + public function create($username, $repository, $pullRequest, array $reviewers = [], array $teamReviewers = []) { - return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', ['reviewers' => $reviewers]); + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', ['reviewers' => $reviewers, 'team_reviewers' => $teamReviewers]); } /** @@ -54,11 +55,12 @@ public function create($username, $repository, $pullRequest, array $reviewers) * @param string $repository * @param int $pullRequest * @param array $reviewers + * @param array $teamReviewers * * @return string */ - public function remove($username, $repository, $pullRequest, array $reviewers) + public function remove($username, $repository, $pullRequest, array $reviewers = [], array $teamReviewers = []) { - return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', ['reviewers' => $reviewers]); + return $this->delete('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/pulls/'.$pullRequest.'/requested_reviewers', ['reviewers' => $reviewers, 'team_reviewers' => $teamReviewers]); } } diff --git a/test/Github/Tests/Api/PullRequest/ReviewRequestTest.php b/test/Github/Tests/Api/PullRequest/ReviewRequestTest.php index f6d98cb3a77..3335b4a3494 100644 --- a/test/Github/Tests/Api/PullRequest/ReviewRequestTest.php +++ b/test/Github/Tests/Api/PullRequest/ReviewRequestTest.php @@ -35,10 +35,10 @@ public function shouldCreateReviewRequest() $api = $this->getApiMock(); $api->expects($this->once()) ->method('post') - ->with('/repos/octocat/Hello-World/pulls/12/requested_reviewers', ['reviewers' => ['testuser']]) + ->with('/repos/octocat/Hello-World/pulls/12/requested_reviewers', ['reviewers' => ['testuser'], 'team_reviewers' => ['testteam']]) ; - $api->create('octocat', 'Hello-World', 12, ['testuser']); + $api->create('octocat', 'Hello-World', 12, ['testuser'], ['testteam']); } /** @@ -49,10 +49,10 @@ public function shouldDeleteReviewRequest() $api = $this->getApiMock(); $api->expects($this->once()) ->method('delete') - ->with('/repos/octocat/Hello-World/pulls/12/requested_reviewers', ['reviewers' => ['testuser']]) + ->with('/repos/octocat/Hello-World/pulls/12/requested_reviewers', ['reviewers' => ['testuser'], 'team_reviewers' => ['testteam']]) ; - $api->remove('octocat', 'Hello-World', 12, ['testuser']); + $api->remove('octocat', 'Hello-World', 12, ['testuser'], ['testteam']); } /**