File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,19 @@ public function findInstallations()
53
53
return $ this ->get ('/app/installations ' );
54
54
}
55
55
56
+ /**
57
+ * Get an installation of the application
58
+ *
59
+ * @link https://developer.github.com/v3/apps/#get-an-installation
60
+ *
61
+ * @param $installation_id An integration installation id
62
+ * @return array
63
+ */
64
+ public function getInstallation ($ installation_id )
65
+ {
66
+ return $ this ->get ('/app/installations/ ' .rawurldecode ($ installation_id ));
67
+ }
68
+
56
69
/**
57
70
* List repositories that are accessible to the authenticated installation.
58
71
*
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public function shouldCreateInstallationTokenForInstallation()
27
27
/**
28
28
* @test
29
29
*/
30
- public function shouldFindRepositoriesForApplication ()
30
+ public function shouldFindInstallationsForApplication ()
31
31
{
32
32
$ result = ['installation1 ' , 'installation2 ' ];
33
33
@@ -40,6 +40,22 @@ public function shouldFindRepositoriesForApplication()
40
40
$ this ->assertEquals ($ result , $ api ->findInstallations ());
41
41
}
42
42
43
+ /**
44
+ * @test
45
+ */
46
+ public function shouldGetInstallationForApplication ()
47
+ {
48
+ $ result = ['installation1 ' ];
49
+
50
+ $ api = $ this ->getApiMock ();
51
+ $ api ->expects ($ this ->once ())
52
+ ->method ('get ' )
53
+ ->with ('/app/installations/1234 ' )
54
+ ->willReturn ($ result );
55
+
56
+ $ this ->assertEquals ($ result , $ api ->getInstallation ('1234 ' ));
57
+ }
58
+
43
59
/**
44
60
* @test
45
61
*/
You can’t perform that action at this time.
0 commit comments