|
15 | 15 | use PhpSchool\PhpWorkshop\ExerciseDispatcher; |
16 | 16 | use PhpSchool\PhpWorkshop\ExerciseRunner\CliRunner; |
17 | 17 | use PhpSchool\PhpWorkshop\Factory\RunnerFactory; |
| 18 | +use PhpSchool\PhpWorkshop\Input\Input; |
18 | 19 | use PhpSchool\PhpWorkshop\Output\OutputInterface; |
19 | 20 | use PhpSchool\PhpWorkshop\ResultAggregator; |
20 | 21 | use PhpSchool\PhpWorkshop\Solution\SingleFileSolution; |
|
24 | 25 | use RuntimeException; |
25 | 26 |
|
26 | 27 | /** |
27 | | - * Class DatabaseCheckTest |
28 | 28 | * @package PhpSchool\PhpWorkshopTest\Check |
29 | 29 | * @author Aydin Hassan <aydin@hotmail.co.uk> |
30 | 30 | */ |
@@ -159,7 +159,7 @@ public function testIfPDOThrowsExceptionItCleansUp() |
159 | 159 | $this->checkRepository |
160 | 160 | ); |
161 | 161 |
|
162 | | - $dispatcher->verify($this->exercise, __DIR__ . '/../res/database/user.php'); |
| 162 | + $dispatcher->verify($this->exercise, new Input('app', ['program' => __DIR__ . '/../res/database/user.php'])); |
163 | 163 | $this->assertTrue($results->isSuccessful()); |
164 | 164 | } |
165 | 165 |
|
@@ -200,7 +200,8 @@ public function testSuccessIsReturnedIfDatabaseVerificationPassed() |
200 | 200 | $this->checkRepository |
201 | 201 | ); |
202 | 202 |
|
203 | | - $dispatcher->verify($this->exercise, __DIR__ . '/../res/database/user.php'); |
| 203 | + |
| 204 | + $dispatcher->verify($this->exercise, new Input('app', ['program' => __DIR__ . '/../res/database/user.php'])); |
204 | 205 |
|
205 | 206 | $this->assertTrue($results->isSuccessful()); |
206 | 207 | } |
@@ -232,7 +233,7 @@ public function testRunExercise() |
232 | 233 |
|
233 | 234 | $dispatcher->run( |
234 | 235 | $this->exercise, |
235 | | - __DIR__ . '/../res/database/user-solution-alter-db.php', |
| 236 | + new Input('app', ['program' => __DIR__ . '/../res/database/user-solution-alter-db.php']), |
236 | 237 | $this->createMock(OutputInterface::class) |
237 | 238 | ); |
238 | 239 | } |
@@ -274,7 +275,7 @@ public function testFailureIsReturnedIfDatabaseVerificationFails() |
274 | 275 | $this->checkRepository |
275 | 276 | ); |
276 | 277 |
|
277 | | - $dispatcher->verify($this->exercise, __DIR__ . '/../res/database/user.php'); |
| 278 | + $dispatcher->verify($this->exercise, new Input('app', ['program' => __DIR__ . '/../res/database/user.php'])); |
278 | 279 |
|
279 | 280 | $this->assertFalse($results->isSuccessful()); |
280 | 281 | $results = iterator_to_array($results); |
@@ -342,6 +343,9 @@ public function testAlteringDatabaseInSolutionDoesNotEffectDatabaseInUserSolutio |
342 | 343 | $this->checkRepository |
343 | 344 | ); |
344 | 345 |
|
345 | | - $dispatcher->verify($this->exercise, __DIR__ . '/../res/database/user-solution-alter-db.php'); |
| 346 | + $dispatcher->verify( |
| 347 | + $this->exercise, |
| 348 | + new Input('app', ['program' => __DIR__ . '/../res/database/user-solution-alter-db.php']) |
| 349 | + ); |
346 | 350 | } |
347 | 351 | } |
0 commit comments