Skip to content

Commit 25f9206

Browse files
authored
bug #915 Fix call to test a webhook method (morrislaptop)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- See renamed URL in the note at https://docs.github.com/en/rest/reference/repos#test-the-push-repository-webhook Using old URL gives an error "Resource not accessible by integration" Commits ------- 76510c3 Fix webhook test function 7c0c814 Update HooksTest.php
1 parent 88f8273 commit 25f9206

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/Github/Api/Repository/Hooks.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function ping($username, $repository, $id)
4747

4848
public function test($username, $repository, $id)
4949
{
50-
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id).'/test');
50+
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/hooks/'.rawurlencode($id).'/tests');
5151
}
5252

5353
public function remove($username, $repository, $id)

test/Github/Tests/Api/Repository/HooksTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function shouldTestHook()
144144
$api = $this->getApiMock();
145145
$api->expects($this->once())
146146
->method('post')
147-
->with('/repos/KnpLabs/php-github-api/hooks/123/test')
147+
->with('/repos/KnpLabs/php-github-api/hooks/123/tests')
148148
->will($this->returnValue($expectedValue));
149149

150150
$this->assertEquals($expectedValue, $api->test('KnpLabs', 'php-github-api', 123));

0 commit comments

Comments
 (0)