Skip to content

Commit 0082a05

Browse files
Deprecated test fixes
1 parent 9269633 commit 0082a05

30 files changed

+449
-449
lines changed

tests/Api/DeployKeysTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function shouldGetAllDeployKeys(): void
2929
$api->expects($this->once())
3030
->method('get')
3131
->with('deploy_keys', ['page' => 2, 'per_page' => 5])
32-
->will($this->returnValue($expectedArray))
32+
->willReturn($expectedArray)
3333
;
3434

3535
$this->assertEquals($expectedArray, $api->all(['page' => 2, 'per_page' => 5]));

tests/Api/DeploymentsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function shouldShowDeployment(): void
106106
$api->expects($this->once())
107107
->method('get')
108108
->with('projects/1/deployments/42')
109-
->will($this->returnValue($expectedArray));
109+
->willReturn($expectedArray);
110110
$this->assertEquals($expectedArray, $api->show(1, 42));
111111
}
112112

@@ -250,7 +250,7 @@ protected function getMultipleDeploymentsRequestMock(string $path, array $expect
250250
$api->expects($this->once())
251251
->method('get')
252252
->with($path, $expectedParameters)
253-
->will($this->returnValue($expectedArray));
253+
->willReturn($expectedArray);
254254

255255
return $api;
256256
}

tests/Api/EnvironmentsTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function shouldGetAllEnvironments(): void
4242
$api->expects($this->once())
4343
->method('get')
4444
->with('projects/1/environments')
45-
->will($this->returnValue($expectedArray));
45+
->willReturn($expectedArray);
4646
$this->assertEquals($expectedArray, $api->all(1));
4747
}
4848

@@ -61,7 +61,7 @@ public function shouldFilterEnvironmentByName(): void
6161
$api->expects($this->once())
6262
->method('get')
6363
->with('projects/1/environments')
64-
->will($this->returnValue($expected));
64+
->willReturn($expected);
6565
$this->assertEquals($expected, $api->all(1, ['name' => 'review/fix-bar']));
6666
}
6767

@@ -140,7 +140,7 @@ public function shouldGetSingleEnvironment(): void
140140
$api->expects($this->once())
141141
->method('get')
142142
->with('projects/1/environments/1')
143-
->will($this->returnValue($expected));
143+
->willReturn($expected);
144144
$this->assertEquals($expected, $api->show(1, 1));
145145
}
146146

@@ -169,7 +169,7 @@ public function shouldCreateEnvironment(): void
169169
$api->expects($this->once())
170170
->method('post')
171171
->with('projects/1/environments', $params)
172-
->will($this->returnValue($expectedArray));
172+
->willReturn($expectedArray);
173173

174174
$this->assertEquals($expectedArray, $api->create(1, $params));
175175
}
@@ -185,7 +185,7 @@ public function shouldRemoveEnvironment(): void
185185
$api->expects($this->once())
186186
->method('delete')
187187
->with('projects/1/environments/3')
188-
->will($this->returnValue($expectedBool));
188+
->willReturn($expectedBool);;
189189
$this->assertEquals($expectedBool, $api->remove(1, 3));
190190
}
191191

@@ -200,7 +200,7 @@ public function shouldStopEnvironment(): void
200200
$api->expects($this->once())
201201
->method('post')
202202
->with('projects/1/environments/3/stop')
203-
->will($this->returnValue($expectedBool));
203+
->willReturn($expectedBool);;
204204
$this->assertEquals($expectedBool, $api->stop(1, 3));
205205
}
206206

tests/Api/EventsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function shouldGetAllEvents(): void
3636
$api->expects($this->once())
3737
->method('get')
3838
->with('events', [])
39-
->will($this->returnValue($expectedArray))
39+
->willReturn($expectedArray)
4040
;
4141

4242
$this->assertEquals($expectedArray, $api->all());
@@ -56,7 +56,7 @@ public function shouldGetEventsAfter(): void
5656
$api->expects($this->once())
5757
->method('get')
5858
->with('events', ['after' => '1970-01-01'])
59-
->will($this->returnValue($expectedArray))
59+
->willReturn($expectedArray)
6060
;
6161

6262
$this->assertEquals($expectedArray, $api->all(['after' => new \DateTime('1970-01-01')]));

tests/Api/GroupBoardsTest.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function shouldGetAllBoards(): void
3232
$api->expects($this->once())
3333
->method('get')
3434
->with('boards', [])
35-
->will($this->returnValue($expectedArray))
35+
->willReturn($expectedArray)
3636
;
3737

3838
$this->assertEquals($expectedArray, $api->all());
@@ -49,7 +49,7 @@ public function shouldShowIssueBoard(): void
4949
$api->expects($this->once())
5050
->method('get')
5151
->with('groups/1/boards/2')
52-
->will($this->returnValue($expectedArray))
52+
->willReturn($expectedArray)
5353
;
5454

5555
$this->assertEquals($expectedArray, $api->show(1, 2));
@@ -66,7 +66,7 @@ public function shouldCreateIssueBoard(): void
6666
$api->expects($this->once())
6767
->method('post')
6868
->with('groups/1/boards', ['name' => 'A new issue board'])
69-
->will($this->returnValue($expectedArray))
69+
->willReturn($expectedArray)
7070
;
7171

7272
$this->assertEquals($expectedArray, $api->create(1, ['name' => 'A new issue board']));
@@ -83,7 +83,7 @@ public function shouldUpdateIssueBoard(): void
8383
$api->expects($this->once())
8484
->method('put')
8585
->with('groups/1/boards/2', ['name' => 'A renamed issue board', 'labels' => 'foo'])
86-
->will($this->returnValue($expectedArray))
86+
->willReturn($expectedArray)
8787
;
8888

8989
$this->assertEquals($expectedArray, $api->update(1, 2, ['name' => 'A renamed issue board', 'labels' => 'foo']));
@@ -100,7 +100,7 @@ public function shouldRemoveIssueBoard(): void
100100
$api->expects($this->once())
101101
->method('delete')
102102
->with('groups/1/boards/2')
103-
->will($this->returnValue($expectedBool))
103+
->willReturn($expectedBool);
104104
;
105105

106106
$this->assertEquals($expectedBool, $api->remove(1, 2));
@@ -135,7 +135,7 @@ public function shouldGetAllLists(): void
135135
$api->expects($this->once())
136136
->method('get')
137137
->with('groups/1/boards/2/lists')
138-
->will($this->returnValue($expectedArray))
138+
->willReturn($expectedArray)
139139
;
140140

141141
$this->assertEquals($expectedArray, $api->allLists(1, 2));
@@ -162,7 +162,7 @@ public function shouldGetList(): void
162162
$api->expects($this->once())
163163
->method('get')
164164
->with('groups/1/boards/2/lists/3')
165-
->will($this->returnValue($expectedArray))
165+
->willReturn($expectedArray)
166166
;
167167

168168
$this->assertEquals($expectedArray, $api->showList(1, 2, 3));
@@ -189,7 +189,7 @@ public function shouldCreateList(): void
189189
$api->expects($this->once())
190190
->method('post')
191191
->with('groups/1/boards/2/lists', ['label_id' => 4])
192-
->will($this->returnValue($expectedArray))
192+
->willReturn($expectedArray)
193193
;
194194

195195
$this->assertEquals($expectedArray, $api->createList(1, 2, 4));
@@ -216,7 +216,7 @@ public function shouldUpdateList(): void
216216
$api->expects($this->once())
217217
->method('put')
218218
->with('groups/5/boards/2/lists/3', ['position' => 1])
219-
->will($this->returnValue($expectedArray))
219+
->willReturn($expectedArray)
220220
;
221221

222222
$this->assertEquals($expectedArray, $api->updateList(5, 2, 3, 1));
@@ -233,7 +233,7 @@ public function shouldDeleteList(): void
233233
$api->expects($this->once())
234234
->method('delete')
235235
->with('groups/1/boards/2/lists/3')
236-
->will($this->returnValue($expectedBool))
236+
->willReturn($expectedBool);
237237
;
238238

239239
$this->assertEquals($expectedBool, $api->deleteList(1, 2, 3));

tests/Api/GroupsEpicsTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function shouldGetAllEpics(): void
3232
$api->expects($this->once())
3333
->method('get')
3434
->with('groups/1/epics')
35-
->will($this->returnValue($expectedArray))
35+
->willReturn($expectedArray)
3636
;
3737

3838
$this->assertEquals($expectedArray, $api->all(1));
@@ -49,7 +49,7 @@ public function shouldShowEpic(): void
4949
$api->expects($this->once())
5050
->method('get')
5151
->with('groups/1/epics/2')
52-
->will($this->returnValue($expectedArray))
52+
->willReturn($expectedArray)
5353
;
5454

5555
$this->assertEquals($expectedArray, $api->show(1, 2));
@@ -66,7 +66,7 @@ public function shouldCreateEpic(): void
6666
$api->expects($this->once())
6767
->method('post')
6868
->with('groups/1/epics', ['description' => 'Some text', 'title' => 'A new epic'])
69-
->will($this->returnValue($expectedArray))
69+
->willReturn($expectedArray)
7070
;
7171

7272
$this->assertEquals($expectedArray, $api->create(1, ['description' => 'Some text', 'title' => 'A new epic']));
@@ -83,7 +83,7 @@ public function shouldUpdateEpic(): void
8383
$api->expects($this->once())
8484
->method('put')
8585
->with('groups/1/epics/3', ['title' => 'Updated epic', 'description' => 'Updated description', 'state_event' => 'close'])
86-
->will($this->returnValue($expectedArray))
86+
->willReturn($expectedArray)
8787
;
8888

8989
$this->assertEquals($expectedArray, $api->update(1, 3, ['title' => 'Updated epic', 'description' => 'Updated description', 'state_event' => 'close']));
@@ -100,7 +100,7 @@ public function shouldRemoveEpic(): void
100100
$api->expects($this->once())
101101
->method('delete')
102102
->with('groups/1/epics/2')
103-
->will($this->returnValue($expectedBool))
103+
->willReturn($expectedBool);
104104
;
105105

106106
$this->assertEquals($expectedBool, $api->remove(1, 2));
@@ -120,7 +120,7 @@ public function shouldGetEpicsIssues(): void
120120
$api->expects($this->once())
121121
->method('get')
122122
->with('groups/1/epics/2/issues')
123-
->will($this->returnValue($expectedArray))
123+
->willReturn($expectedArray)
124124
;
125125

126126
$this->assertEquals($expectedArray, $api->issues(1, 2));

tests/Api/GroupsMilestonesTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function shouldGetAllMilestones(): void
3232
$api->expects($this->once())
3333
->method('get')
3434
->with('groups/1/milestones')
35-
->will($this->returnValue($expectedArray))
35+
->willReturn($expectedArray)
3636
;
3737

3838
$this->assertEquals($expectedArray, $api->all(1));
@@ -149,7 +149,7 @@ public function shouldShowMilestone(): void
149149
$api->expects($this->once())
150150
->method('get')
151151
->with('groups/1/milestones/2')
152-
->will($this->returnValue($expectedArray))
152+
->willReturn($expectedArray)
153153
;
154154

155155
$this->assertEquals($expectedArray, $api->show(1, 2));
@@ -166,7 +166,7 @@ public function shouldCreateMilestone(): void
166166
$api->expects($this->once())
167167
->method('post')
168168
->with('groups/1/milestones', ['description' => 'Some text', 'title' => 'A new milestone'])
169-
->will($this->returnValue($expectedArray))
169+
->willReturn($expectedArray)
170170
;
171171

172172
$this->assertEquals($expectedArray, $api->create(1, ['description' => 'Some text', 'title' => 'A new milestone']));
@@ -183,7 +183,7 @@ public function shouldUpdateMilestone(): void
183183
$api->expects($this->once())
184184
->method('put')
185185
->with('groups/1/milestones/3', ['title' => 'Updated milestone', 'due_date' => '2015-04-01', 'state_event' => 'close'])
186-
->will($this->returnValue($expectedArray))
186+
->willReturn($expectedArray)
187187
;
188188

189189
$this->assertEquals($expectedArray, $api->update(1, 3, ['title' => 'Updated milestone', 'due_date' => '2015-04-01', 'state_event' => 'close']));
@@ -200,7 +200,7 @@ public function shouldRemoveMilestone(): void
200200
$api->expects($this->once())
201201
->method('delete')
202202
->with('groups/1/milestones/2')
203-
->will($this->returnValue($expectedBool))
203+
->willReturn($expectedBool);
204204
;
205205

206206
$this->assertEquals($expectedBool, $api->remove(1, 2));
@@ -220,7 +220,7 @@ public function shouldGetMilestonesIssues(): void
220220
$api->expects($this->once())
221221
->method('get')
222222
->with('groups/1/milestones/3/issues')
223-
->will($this->returnValue($expectedArray))
223+
->willReturn($expectedArray)
224224
;
225225

226226
$this->assertEquals($expectedArray, $api->issues(1, 3));
@@ -240,7 +240,7 @@ public function shouldGetMilestonesMergeRequests(): void
240240
$api->expects($this->once())
241241
->method('get')
242242
->with('groups/1/milestones/3/merge_requests')
243-
->will($this->returnValue($expectedArray))
243+
->willReturn($expectedArray)
244244
;
245245

246246
$this->assertEquals($expectedArray, $api->mergeRequests(1, 3));

0 commit comments

Comments
 (0)