Skip to content

Commit 25330c1

Browse files
vbartuseviciusValentinas Bartusevičius
andauthored
Add support of approved_by_ids in MergeRequests API (#600)
Co-authored-by: Valentinas Bartusevičius <[email protected]>
1 parent 30a5501 commit 25330c1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Api/MergeRequests.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ public function all($project_id = null, array $parameters = [])
115115
$resolver->setDefined('with_merge_status_recheck')
116116
->setAllowedTypes('with_merge_status_recheck', 'bool')
117117
;
118+
$resolver->setDefined('approved_by_ids')
119+
->setAllowedTypes('approved_by_ids', 'array')
120+
->setAllowedValues('approved_by_ids', function (array $value) {
121+
return \count($value) === \count(\array_filter($value, 'is_int'));
122+
})
123+
;
118124

119125
$path = null === $project_id ? 'merge_requests' : $this->getProjectPath($project_id, 'merge_requests');
120126

tests/Api/MergeRequestsTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function shouldGetAllWithParams(): void
6666
'source_branch' => 'develop',
6767
'target_branch' => 'master',
6868
'with_merge_status_recheck' => true,
69+
'approved_by_ids' => [1],
6970
])
7071
->will($this->returnValue($expectedArray))
7172
;
@@ -84,6 +85,7 @@ public function shouldGetAllWithParams(): void
8485
'source_branch' => 'develop',
8586
'target_branch' => 'master',
8687
'with_merge_status_recheck' => true,
88+
'approved_by_ids' => [1],
8789
]));
8890
}
8991

0 commit comments

Comments
 (0)