File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,12 @@ $team->followers($team_name);
2929$team->following($team_name);
3030```
3131
32+ ### Get the team's repositories: (API 2.0)
33+ ``` php
34+ $team->repositories($team_name);
35+ ```
36+
37+
3238----
3339
3440#### Related:
Original file line number Diff line number Diff line change @@ -73,4 +73,18 @@ public function following($name)
7373 sprintf ('teams/%s/following ' , $ name )
7474 );
7575 }
76+
77+ /**
78+ * Get the team's repositories.
79+ *
80+ * @access public
81+ * @param string $name The team's name.
82+ * @return MessageInterface
83+ */
84+ public function repositories ($ name )
85+ {
86+ return $ this ->getClient ()->setApiVersion ('2.0 ' )->get (
87+ sprintf ('teams/%s/repositories ' , $ name )
88+ );
89+ }
7690}
Original file line number Diff line number Diff line change @@ -77,4 +77,22 @@ public function testGetTeamFollowing()
7777
7878 $ this ->assertEquals ($ expectedResult , $ actual );
7979 }
80+
81+ public function testGetTeamRepositories ()
82+ {
83+ $ endpoint = 'teams/gentle-web/repositories ' ;
84+ $ expectedResult = $ this ->fakeResponse (array ('dummy ' ));
85+
86+ $ client = $ this ->getHttpClientMock ();
87+ $ client ->expects ($ this ->once ())
88+ ->method ('get ' )
89+ ->with ($ endpoint )
90+ ->will ($ this ->returnValue ($ expectedResult ));
91+
92+ /** @var \Bitbucket\API\Teams $team */
93+ $ team = $ this ->getClassMock ('Bitbucket\API\Teams ' , $ client );
94+ $ actual = $ team ->repositories ('gentle-web ' );
95+
96+ $ this ->assertEquals ($ expectedResult , $ actual );
97+ }
8098}
You can’t perform that action at this time.
0 commit comments