File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -328,4 +328,14 @@ public function closedByMergeRequests($project_id, $issue_iid)
328328 {
329329 return $ this ->get ($ this ->getProjectPath ($ project_id , 'issues/ ' .$ this ->encodePath ($ issue_iid )).'/closed_by ' );
330330 }
331+
332+ /**
333+ * @param int $project_id
334+ * @param int $issue_iid
335+ * @return mixed
336+ */
337+ public function showParticipants ($ project_id , $ issue_iid )
338+ {
339+ return $ this ->get ($ this ->getProjectPath ($ project_id , 'issues/ ' .$ this ->encodePath ($ issue_iid )).'/participants ' );
340+ }
331341}
Original file line number Diff line number Diff line change @@ -454,6 +454,40 @@ public function shouldGetProjectIssuesByAssignee()
454454 $ this ->assertEquals ($ expectedArray , $ api ->all (1 , array ('assignee_id ' => 1 )));
455455 }
456456
457+ /**
458+ * @test
459+ */
460+ public function shouldGetIssueParticipants ()
461+ {
462+ $ expectedArray = array (
463+ array (
464+ "id " => 1 ,
465+ "name " => "John Doe1 " ,
466+ "username " => "user1 " ,
467+ "state " => "active " ,
468+ "avatar_url " => "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon " ,
469+ "web_url " => "http://localhost/user1 " ,
470+ ),
471+ array (
472+ "id " => 5 ,
473+ "name " => "John Doe5 " ,
474+ "username " => "user5 " ,
475+ "state " => "active " ,
476+ "avatar_url " => "http://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80&d=identicon " ,
477+ "web_url " => "http://localhost/user5 " ,
478+ )
479+ );
480+
481+ $ api = $ this ->getApiMock ();
482+ $ api ->expects ($ this ->once ())
483+ ->method ('get ' )
484+ ->with ('projects/1/issues/2/participants ' )
485+ ->will ($ this ->returnValue ($ expectedArray ))
486+ ;
487+
488+ $ this ->assertEquals ($ expectedArray , $ api ->showParticipants (1 , 2 ));
489+ }
490+
457491 protected function getApiClass ()
458492 {
459493 return 'Gitlab\Api\Issues ' ;
You can’t perform that action at this time.
0 commit comments