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 @@ -310,6 +310,16 @@ public function closedByMergeRequests($project_id, $issue_iid)
310
310
return $ this ->get ($ this ->getProjectPath ($ project_id , 'issues/ ' .$ this ->encodePath ($ issue_iid )).'/closed_by ' );
311
311
}
312
312
313
+ /**
314
+ * @param int $project_id
315
+ * @param int $issue_iid
316
+ * @return mixed
317
+ */
318
+ public function showParticipants ($ project_id , $ issue_iid )
319
+ {
320
+ return $ this ->get ($ this ->getProjectPath ($ project_id , 'issues/ ' .$ this ->encodePath ($ issue_iid )).'/participants ' );
321
+ }
322
+
313
323
/**
314
324
* {@inheritDoc}
315
325
*/
Original file line number Diff line number Diff line change @@ -514,6 +514,40 @@ public function shouldGetProjectIssuesByAssignee()
514
514
$ this ->assertEquals ($ expectedArray , $ api ->all (1 , array ('assignee_id ' => 1 )));
515
515
}
516
516
517
+ /**
518
+ * @test
519
+ */
520
+ public function shouldGetIssueParticipants ()
521
+ {
522
+ $ expectedArray = array (
523
+ array (
524
+ "id " => 1 ,
525
+ "name " => "John Doe1 " ,
526
+ "username " => "user1 " ,
527
+ "state " => "active " ,
528
+ "avatar_url " => "http://www.gravatar.com/avatar/c922747a93b40d1ea88262bf1aebee62?s=80&d=identicon " ,
529
+ "web_url " => "http://localhost/user1 " ,
530
+ ),
531
+ array (
532
+ "id " => 5 ,
533
+ "name " => "John Doe5 " ,
534
+ "username " => "user5 " ,
535
+ "state " => "active " ,
536
+ "avatar_url " => "http://www.gravatar.com/avatar/4aea8cf834ed91844a2da4ff7ae6b491?s=80&d=identicon " ,
537
+ "web_url " => "http://localhost/user5 " ,
538
+ )
539
+ );
540
+
541
+ $ api = $ this ->getApiMock ();
542
+ $ api ->expects ($ this ->once ())
543
+ ->method ('get ' )
544
+ ->with ('projects/1/issues/2/participants ' )
545
+ ->will ($ this ->returnValue ($ expectedArray ))
546
+ ;
547
+
548
+ $ this ->assertEquals ($ expectedArray , $ api ->showParticipants (1 , 2 ));
549
+ }
550
+
517
551
protected function getApiClass ()
518
552
{
519
553
return 'Gitlab\Api\Issues ' ;
You can’t perform that action at this time.
0 commit comments