Skip to content

Commit c267c41

Browse files
committed
replace merge_request endpoint by merge_requests
1 parent 324000b commit c267c41

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

lib/Gitlab/Api/MergeRequests.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function closed($project_id, $page = 1, $per_page = self::PER_PAGE, $orde
9090
*/
9191
public function show($project_id, $mr_id)
9292
{
93-
return $this->get($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id)));
93+
return $this->get($this->getProjectPath($project_id, 'merge_requests/'.$this->encodePath($mr_id)));
9494
}
9595

9696
/**
@@ -123,7 +123,7 @@ public function create($project_id, $source, $target, $title, $assignee = null,
123123
*/
124124
public function update($project_id, $mr_id, array $params)
125125
{
126-
return $this->put($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id)), $params);
126+
return $this->put($this->getProjectPath($project_id, 'merge_requests/'.$this->encodePath($mr_id)), $params);
127127
}
128128

129129
/**
@@ -140,7 +140,7 @@ public function merge($project_id, $mr_id, $message = null)
140140
$params = array('merge_commit_message' => $message);
141141
}
142142

143-
return $this->put($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id).'/merge'), $params);
143+
return $this->put($this->getProjectPath($project_id, 'merge_requests/'.$this->encodePath($mr_id).'/merge'), $params);
144144
}
145145

146146
/**
@@ -173,7 +173,7 @@ public function addNote($project_id, $mr_id, $note)
173173
*/
174174
public function showComments($project_id, $mr_id)
175175
{
176-
return $this->get($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id).'/comments'));
176+
return $this->get($this->getProjectPath($project_id, 'merge_requests/'.$this->encodePath($mr_id).'/comments'));
177177
}
178178

179179
/**
@@ -184,7 +184,7 @@ public function showComments($project_id, $mr_id)
184184
*/
185185
public function addComment($project_id, $mr_id, $note)
186186
{
187-
return $this->post($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id).'/comments'), array(
187+
return $this->post($this->getProjectPath($project_id, 'merge_requests/'.$this->encodePath($mr_id).'/comments'), array(
188188
'note' => $note
189189
));
190190
}
@@ -196,7 +196,7 @@ public function addComment($project_id, $mr_id, $note)
196196
*/
197197
public function changes($project_id, $mr_id)
198198
{
199-
return $this->get($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id).'/changes'));
199+
return $this->get($this->getProjectPath($project_id, 'merge_requests/'.$this->encodePath($mr_id).'/changes'));
200200
}
201201

202202
/**
@@ -216,7 +216,7 @@ public function getByIid($project_id, $mr_iid)
216216
*/
217217
public function commits($project_id, $mr_id)
218218
{
219-
return $this->get($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id).'/commits'));
219+
return $this->get($this->getProjectPath($project_id, 'merge_requests/'.$this->encodePath($mr_id).'/commits'));
220220
}
221221

222222
/**
@@ -226,7 +226,7 @@ public function commits($project_id, $mr_id)
226226
*/
227227
public function closesIssues($project_id, $mr_id)
228228
{
229-
return $this->get($this->getProjectPath($project_id, 'merge_request/'.$this->encodePath($mr_id).'/closes_issues'));
229+
return $this->get($this->getProjectPath($project_id, 'merge_requests/'.$this->encodePath($mr_id).'/closes_issues'));
230230
}
231231

232232
/**

test/Gitlab/Tests/Api/MergeRequestsTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public function shouldShowMergeRequest()
168168
$api = $this->getApiMock();
169169
$api->expects($this->once())
170170
->method('get')
171-
->with('projects/1/merge_request/2')
171+
->with('projects/1/merge_requests/2')
172172
->will($this->returnValue($expectedArray))
173173
;
174174

@@ -233,7 +233,7 @@ public function shouldUpdateMergeRequest()
233233
$api = $this->getApiMock();
234234
$api->expects($this->once())
235235
->method('put')
236-
->with('projects/1/merge_request/2', array('title' => 'Updated title', 'description' => 'No so many changes now', 'state_event' => 'close'))
236+
->with('projects/1/merge_requests/2', array('title' => 'Updated title', 'description' => 'No so many changes now', 'state_event' => 'close'))
237237
->will($this->returnValue($expectedArray))
238238
;
239239

@@ -254,7 +254,7 @@ public function shouldMergeMergeRequest()
254254
$api = $this->getApiMock();
255255
$api->expects($this->exactly(2))
256256
->method('put')
257-
->with('projects/1/merge_request/2/merge', array('merge_commit_message' => 'Accepted'))
257+
->with('projects/1/merge_requests/2/merge', array('merge_commit_message' => 'Accepted'))
258258
->will($this->returnValue($expectedArray))
259259
;
260260

@@ -295,7 +295,7 @@ public function shouldGetMergeRequestComments()
295295
$api = $this->getApiMock();
296296
$api->expects($this->once())
297297
->method('get')
298-
->with('projects/1/merge_request/2/comments')
298+
->with('projects/1/merge_requests/2/comments')
299299
->will($this->returnValue($expectedArray))
300300
;
301301

@@ -312,7 +312,7 @@ public function shouldAddMergeRequestComment()
312312
$api = $this->getApiMock();
313313
$api->expects($this->once())
314314
->method('post')
315-
->with('projects/1/merge_request/2/comments', array('note' => 'A comment'))
315+
->with('projects/1/merge_requests/2/comments', array('note' => 'A comment'))
316316
->will($this->returnValue($expectedArray))
317317
;
318318

@@ -329,7 +329,7 @@ public function shouldGetMergeRequestChanges()
329329
$api = $this->getApiMock();
330330
$api->expects($this->once())
331331
->method('get')
332-
->with('projects/1/merge_request/2/changes')
332+
->with('projects/1/merge_requests/2/changes')
333333
->will($this->returnValue($expectedArray))
334334
;
335335

@@ -347,7 +347,7 @@ public function shouldGetIssuesClosedByMergeRequest()
347347
$api = $this->getApiMock();
348348
$api->expects($this->once())
349349
->method('get')
350-
->with('projects/1/merge_request/2/closes_issues')
350+
->with('projects/1/merge_requests/2/closes_issues')
351351
->will($this->returnValue($expectedArray))
352352
;
353353

0 commit comments

Comments
 (0)