Skip to content

Commit 1c76433

Browse files
[11.8] Add support for GroupEpics::issues() (#706)
* add list epic issues endpoint * fix style
1 parent 5eaab34 commit 1c76433

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/Api/GroupsEpics.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,15 @@ public function remove($group_id, int $epic_id)
103103
{
104104
return $this->delete('groups/'.self::encodePath($group_id).'/epics/'.self::encodePath($epic_id));
105105
}
106+
107+
/**
108+
* @param int|string $group_id
109+
* @param int $epic_iid
110+
*
111+
* @return mixed
112+
*/
113+
public function issues($group_id, int $epic_iid)
114+
{
115+
return $this->get('groups/'.self::encodePath($group_id).'/epics/'.self::encodePath($epic_iid).'/issues');
116+
}
106117
}

tests/Api/GroupsEpicsTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,26 @@ public function shouldRemoveEpic(): void
106106
$this->assertEquals($expectedBool, $api->remove(1, 2));
107107
}
108108

109+
/**
110+
* @test
111+
*/
112+
public function shouldGetEpicsIssues(): void
113+
{
114+
$expectedArray = [
115+
['id' => 1, 'title' => 'An issue'],
116+
['id' => 2, 'title' => 'Another issue'],
117+
];
118+
119+
$api = $this->getApiMock();
120+
$api->expects($this->once())
121+
->method('get')
122+
->with('groups/1/epics/2/issues')
123+
->will($this->returnValue($expectedArray))
124+
;
125+
126+
$this->assertEquals($expectedArray, $api->issues(1, 2));
127+
}
128+
109129
protected function getApiClass()
110130
{
111131
return GroupsEpics::class;

0 commit comments

Comments
 (0)