File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -27,4 +27,23 @@ public function getAdmins($options = [])
2727 {
2828 return $ this ->client ->get ("admins " , $ options );
2929 }
30+
31+ /**
32+ * Gets a single Admin based on the Intercom ID.
33+ * @see https://developers.intercom.com/v2.0/reference#view-an-admin
34+ * @param integer $id
35+ * @param array $options
36+ * @return mixed
37+ * @throws \GuzzleHttp\Exception\GuzzleException
38+ */
39+ public function getAdmin ($ id , $ options = [])
40+ {
41+ $ path = $ this ->adminPath ($ id );
42+ return $ this ->client ->get ($ path , $ options );
43+ }
44+
45+ public function adminPath ($ id )
46+ {
47+ return 'admins/ ' . $ id ;
48+ }
3049}
Original file line number Diff line number Diff line change @@ -11,4 +11,13 @@ public function testAdminsList()
1111 $ users = new IntercomAdmins ($ stub );
1212 $ this ->assertEquals ('foo ' , $ users ->getAdmins ());
1313 }
14+
15+ public function testAdminsGet ()
16+ {
17+ $ stub = $ this ->getMockBuilder ('Intercom\IntercomClient ' )->disableOriginalConstructor ()->getMock ();
18+ $ stub ->method ('get ' )->willReturn ('foo ' );
19+
20+ $ users = new IntercomAdmins ($ stub );
21+ $ this ->assertEquals ('foo ' , $ users ->getAdmin (1 ));
22+ }
1423}
You can’t perform that action at this time.
0 commit comments