Skip to content

Commit f5ef97a

Browse files
committed
updated PullRequests::all (+BC)
1 parent 5e248ab commit f5ef97a

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

lib/Bitbucket/API/Repositories/PullRequests.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ public function all($account, $repo, $params = array())
5353
$params
5454
);
5555

56-
$this->httpClient->setApiVersion('2.0');
57-
58-
return $this->requestGet(
56+
return $this->getClient()->setApiVersion('2.0')->get(
5957
sprintf('repositories/%s/%s/pullrequests', $account, $repo),
6058
$params
6159
);

test/Bitbucket/Tests/API/Repositories/PullRequestsTest.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,17 @@ class PullRequestsTest extends Tests\TestCase
1313
public function testGetAllPullRequests()
1414
{
1515
$endpoint = 'repositories/gentle/eof/pullrequests';
16-
$expectedResult = json_encode('dummy');
16+
$expectedResult = $this->fakeResponse(array('dummy'));
1717

18-
$pullRequests = $this->getApiMock('Bitbucket\API\Repositories\PullRequests');
19-
$pullRequests->expects($this->once())
20-
->method('requestGet')
18+
$client = $this->getHttpClientMock();
19+
$client->expects($this->once())
20+
->method('get')
2121
->with($endpoint)
2222
->will($this->returnValue($expectedResult));
2323

24-
/** @var $pullRequests \Bitbucket\API\Repositories\PullRequests */
25-
$actual = $pullRequests->all('gentle', 'eof');
24+
/** @var \Bitbucket\API\Repositories\PullRequests $pull */
25+
$pull = $this->getClassMock('Bitbucket\API\Repositories\PullRequests', $client);
26+
$actual = $pull->all('gentle', 'eof');
2627

2728
$this->assertEquals($expectedResult, $actual);
2829
}

0 commit comments

Comments
 (0)