@@ -131,10 +131,8 @@ public function testIfPDOThrowsExceptionItCleansUp(): void
131
131
132
132
$ this ->exercise
133
133
->expects ($ this ->once ())
134
- ->method ('configure ' )
135
- ->willReturnCallback (function (ExerciseDispatcher $ dispatcher ) {
136
- $ dispatcher ->requireCheck (DatabaseCheck::class);
137
- });
134
+ ->method ('getRequiredChecks ' )
135
+ ->willReturn ([DatabaseCheck::class]);
138
136
139
137
$ this ->exercise
140
138
->expects ($ this ->once ())
@@ -172,10 +170,8 @@ public function testSuccessIsReturnedIfDatabaseVerificationPassed(): void
172
170
173
171
$ this ->exercise
174
172
->expects ($ this ->once ())
175
- ->method ('configure ' )
176
- ->willReturnCallback (function (ExerciseDispatcher $ dispatcher ) {
177
- $ dispatcher ->requireCheck (DatabaseCheck::class);
178
- });
173
+ ->method ('getRequiredChecks ' )
174
+ ->willReturn ([DatabaseCheck::class]);
179
175
180
176
$ this ->exercise
181
177
->expects ($ this ->once ())
@@ -207,13 +203,6 @@ public function testRunExercise(): void
207
203
->method ('getArgs ' )
208
204
->willReturn ([]);
209
205
210
- $ this ->exercise
211
- ->expects ($ this ->once ())
212
- ->method ('configure ' )
213
- ->willReturnCallback (function (ExerciseDispatcher $ dispatcher ) {
214
- $ dispatcher ->requireCheck (DatabaseCheck::class);
215
- });
216
-
217
206
$ this ->checkRepository ->registerCheck ($ this ->check );
218
207
219
208
$ results = new ResultAggregator ();
@@ -248,10 +237,8 @@ public function testFailureIsReturnedIfDatabaseVerificationFails(): void
248
237
249
238
$ this ->exercise
250
239
->expects ($ this ->once ())
251
- ->method ('configure ' )
252
- ->willReturnCallback (function (ExerciseDispatcher $ dispatcher ) {
253
- $ dispatcher ->requireCheck (DatabaseCheck::class);
254
- });
240
+ ->method ('getRequiredChecks ' )
241
+ ->willReturn ([DatabaseCheck::class]);
255
242
256
243
$ this ->exercise
257
244
->expects ($ this ->once ())
@@ -296,10 +283,8 @@ public function testAlteringDatabaseInSolutionDoesNotEffectDatabaseInUserSolutio
296
283
297
284
$ this ->exercise
298
285
->expects ($ this ->once ())
299
- ->method ('configure ' )
300
- ->willReturnCallback (function (ExerciseDispatcher $ dispatcher ) {
301
- $ dispatcher ->requireCheck (DatabaseCheck::class);
302
- });
286
+ ->method ('getRequiredChecks ' )
287
+ ->willReturn ([DatabaseCheck::class]);
303
288
304
289
$ this ->exercise
305
290
->expects ($ this ->once ())
0 commit comments