File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,20 @@ public function getInstallationForOrganization($org)
79
79
return $ this ->get ('/org/ ' .rawurldecode ($ org ).'/installation ' );
80
80
}
81
81
82
+ /**
83
+ * Get an installation of the application for a repository
84
+ *
85
+ * @link https://developer.github.com/v3/apps/#get-a-repository-installation
86
+ *
87
+ * @param $owner the owner of a repository
88
+ * @param $repo the name of the repository
89
+ * @return array
90
+ */
91
+ public function getInstallationForRepo ($ owner , $ repo )
92
+ {
93
+ return $ this ->get ('/repos/ ' .rawurldecode ($ owner ).'/ ' .rawurldecode ($ repo ).'/installation ' );
94
+ }
95
+
82
96
/**
83
97
* Delete an installation of the application
84
98
*
Original file line number Diff line number Diff line change @@ -72,6 +72,22 @@ public function shouldGetInstallationForOrganization()
72
72
$ this ->assertEquals ($ result , $ api ->getInstallationForOrganization ('1234 ' ));
73
73
}
74
74
75
+ /**
76
+ * @test
77
+ */
78
+ public function shouldGetInstallationForRepo ()
79
+ {
80
+ $ result = ['installation1 ' ];
81
+
82
+ $ api = $ this ->getApiMock ();
83
+ $ api ->expects ($ this ->once ())
84
+ ->method ('get ' )
85
+ ->with ('/repos/MyOrg/MyRepo/installation ' )
86
+ ->willReturn ($ result );
87
+
88
+ $ this ->assertEquals ($ result , $ api ->getInstallationForRepo ('MyOrg ' , 'MyRepo ' ));
89
+ }
90
+
75
91
/**
76
92
* @test
77
93
*/
You can’t perform that action at this time.
0 commit comments