File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ $team->profile($team_name);
1919$team->members($team_name);
2020```
2121
22+ ### Get the team followers: (API 2.0)
23+ ``` php
24+ $team->followers($team_name);
25+ ```
26+
2227----
2328
2429#### Related:
Original file line number Diff line number Diff line change @@ -45,4 +45,18 @@ public function members($name)
4545 sprintf ('teams/%s/members ' , $ name )
4646 );
4747 }
48+
49+ /**
50+ * Get the team followers list.
51+ *
52+ * @access public
53+ * @param string $name The team's name.
54+ * @return MessageInterface
55+ */
56+ public function followers ($ name )
57+ {
58+ return $ this ->getClient ()->setApiVersion ('2.0 ' )->get (
59+ sprintf ('teams/%s/followers ' , $ name )
60+ );
61+ }
4862}
Original file line number Diff line number Diff line change @@ -41,4 +41,22 @@ public function testGetTeamMembers()
4141
4242 $ this ->assertEquals ($ expectedResult , $ actual );
4343 }
44+
45+ public function testGetTeamFollowers ()
46+ {
47+ $ endpoint = 'teams/gentle-web/followers ' ;
48+ $ expectedResult = $ this ->fakeResponse (array ('dummy ' ));
49+
50+ $ client = $ this ->getHttpClientMock ();
51+ $ client ->expects ($ this ->once ())
52+ ->method ('get ' )
53+ ->with ($ endpoint )
54+ ->will ($ this ->returnValue ($ expectedResult ));
55+
56+ /** @var \Bitbucket\API\Teams $team */
57+ $ team = $ this ->getClassMock ('Bitbucket\API\Teams ' , $ client );
58+ $ actual = $ team ->followers ('gentle-web ' );
59+
60+ $ this ->assertEquals ($ expectedResult , $ actual );
61+ }
4462}
You can’t perform that action at this time.
0 commit comments