Skip to content

Commit ad6aa93

Browse files
committed
add Apps endpoint delete /apps/installations/:installation_id:
1 parent adeb763 commit ad6aa93

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

lib/Github/Api/Apps.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ public function getInstallation($installation_id)
6666
return $this->get('/app/installations/'.rawurldecode($installation_id));
6767
}
6868

69+
/**
70+
* Delete an installation of the application
71+
*
72+
* @link https://developer.github.com/v3/apps/#delete-an-installation
73+
*
74+
* @param $installation_id An integration installation id
75+
*/
76+
public function removeInstallation($installation_id)
77+
{
78+
$this->delete('/app/installations/'.rawurldecode($installation_id));
79+
}
80+
6981
/**
7082
* List repositories that are accessible to the authenticated installation.
7183
*

test/Github/Tests/Api/AppTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ public function shouldGetInstallationForApplication()
5656
$this->assertEquals($result, $api->getInstallation('1234'));
5757
}
5858

59+
/**
60+
* @test
61+
*/
62+
public function shouldDeleteInstallationForApplication()
63+
{
64+
$id = 123;
65+
$api = $this->getApiMock();
66+
$api->expects($this->once())
67+
->method('delete')
68+
->with('/app/installations/'.$id);
69+
70+
$api->removeInstallation($id);
71+
}
72+
5973
/**
6074
* @test
6175
*/

0 commit comments

Comments
 (0)