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 @@ -24,6 +24,11 @@ $team->members($team_name);
2424$team->followers($team_name);
2525```
2626
27+ ### Get a list of accounts the team is following: (API 2.0)
28+ ``` php
29+ $team->following($team_name);
30+ ```
31+
2732----
2833
2934#### Related:
Original file line number Diff line number Diff line change @@ -59,4 +59,18 @@ public function followers($name)
5959 sprintf ('teams/%s/followers ' , $ name )
6060 );
6161 }
62+
63+ /**
64+ * Get a list of accounts the team is following.
65+ *
66+ * @access public
67+ * @param string $name The team's name.
68+ * @return MessageInterface
69+ */
70+ public function following ($ name )
71+ {
72+ return $ this ->getClient ()->setApiVersion ('2.0 ' )->get (
73+ sprintf ('teams/%s/following ' , $ name )
74+ );
75+ }
6276}
Original file line number Diff line number Diff line change @@ -59,4 +59,22 @@ public function testGetTeamFollowers()
5959
6060 $ this ->assertEquals ($ expectedResult , $ actual );
6161 }
62+
63+ public function testGetTeamFollowing ()
64+ {
65+ $ endpoint = 'teams/gentle-web/following ' ;
66+ $ expectedResult = $ this ->fakeResponse (array ('dummy ' ));
67+
68+ $ client = $ this ->getHttpClientMock ();
69+ $ client ->expects ($ this ->once ())
70+ ->method ('get ' )
71+ ->with ($ endpoint )
72+ ->will ($ this ->returnValue ($ expectedResult ));
73+
74+ /** @var \Bitbucket\API\Teams $team */
75+ $ team = $ this ->getClassMock ('Bitbucket\API\Teams ' , $ client );
76+ $ actual = $ team ->following ('gentle-web ' );
77+
78+ $ this ->assertEquals ($ expectedResult , $ actual );
79+ }
6280}
You can’t perform that action at this time.
0 commit comments