Skip to content

Commit 8449003

Browse files
committed
implemented Teams::followers (API 2.0)
1 parent 554918f commit 8449003

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

docs/teams.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff 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:

lib/Bitbucket/API/Teams.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

test/Bitbucket/Tests/API/TeamsTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)