Skip to content

Commit 200c536

Browse files
authored
Adding test for getting merge requests that close issue
1 parent 2c494f7 commit 200c536

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/Gitlab/Tests/Api/IssuesTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,26 @@ public function shouldGetIssueAwardEmoji()
290290
$this->assertEquals($expectedArray, $api->awardEmoji(1, 2));
291291
}
292292

293+
/**
294+
* @test
295+
*/
296+
public function shouldGetIssueClosedByMergeRequests()
297+
{
298+
$expectedArray = array(
299+
array('id' => 1, 'iid' => '1111', 'title' => 'Just saving the world'),
300+
array('id' => 2, 'iid' => '1112', 'title' => 'Adding new feature to get merge requests that close an issue'),
301+
);
302+
303+
$api = $this->getApiMock();
304+
$api->expects($this->once())
305+
->method('get')
306+
->with('projects/1/issues/2/closed_by')
307+
->will($this->returnValue($expectedArray))
308+
;
309+
310+
$this->assertEquals($expectedArray, $api->closedByMergeRequests(1, 2));
311+
}
312+
293313
protected function getApiClass()
294314
{
295315
return 'Gitlab\Api\Issues';

0 commit comments

Comments
 (0)