Skip to content

Commit 3c1b28a

Browse files
committed
Added unit test for pull requests
1 parent cb8b867 commit 3c1b28a

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@
1010
*/
1111
class PullRequestsTest extends Tests\TestCase
1212
{
13-
public function testDummy()
14-
{}
13+
public function testGetAllPullRequests()
14+
{
15+
$endpoint = 'repositories/gentle/eof/pullrequests';
16+
$expectedResult = json_encode('dummy');
17+
18+
$pullRequests = $this->getApiMock('Bitbucket\API\Repositories\PullRequests');
19+
$pullRequests->expects($this->once())
20+
->method('requestGet')
21+
->with($endpoint)
22+
->will( $this->returnValue($expectedResult) );
23+
24+
/** @var $pullRequests \Bitbucket\API\Repositories\PullRequests */
25+
$actual = $pullRequests->all('gentle', 'eof');
26+
27+
$this->assertEquals($expectedResult, $actual);
28+
}
1529
}

0 commit comments

Comments
 (0)