|  | 
| 8 | 8 | use PhpSchool\PhpWorkshop\UserState\UserState; | 
| 9 | 9 | use PhpSchool\PhpWorkshop\Utils\Path; | 
| 10 | 10 | use PhpSchool\PhpWorkshop\Utils\System; | 
| 11 |  | -use PhpSchool\PhpWorkshopTest\Asset\CliExerciseInterface; | 
|  | 11 | +use PhpSchool\PhpWorkshopTest\Asset\CliExerciseImpl; | 
| 12 | 12 | use PhpSchool\PhpWorkshopTest\BaseTest; | 
| 13 | 13 | use Yoast\PHPUnitPolyfills\Polyfills\AssertionRenames; | 
| 14 | 14 | 
 | 
| 15 | 15 | class LocalJsonSerializerTest extends BaseTest | 
| 16 | 16 | { | 
| 17 | 17 |  use AssertionRenames; | 
| 18 | 18 | 
 | 
| 19 |  | - /** | 
| 20 |  | - * @var string | 
| 21 |  | - */ | 
| 22 |  | - private $tmpDir; | 
| 23 |  | - | 
| 24 |  | - /** | 
| 25 |  | - * @var string | 
| 26 |  | - */ | 
| 27 |  | - private $tmpFile; | 
| 28 |  | - | 
| 29 |  | - /** | 
| 30 |  | - * @var string | 
| 31 |  | - */ | 
| 32 |  | - private $workshopName = 'My Workshop'; | 
| 33 |  | - | 
| 34 |  | - /** | 
| 35 |  | - * @var ExerciseRepository | 
| 36 |  | - */ | 
| 37 |  | - private $exerciseRepository; | 
|  | 19 | + private string $tmpDir; | 
|  | 20 | + private string $tmpFile; | 
|  | 21 | + private string $workshopName = 'My Workshop'; | 
|  | 22 | + private ExerciseRepository $exerciseRepository; | 
| 38 | 23 | 
 | 
| 39 | 24 |  public function setUp(): void | 
| 40 | 25 |  { | 
| @@ -201,12 +186,8 @@ public function deserializerProvider(): array | 
| 201 | 186 | 
 | 
| 202 | 187 |  public function testOldDataWillBeMigratedWhenInCorrectWorkshop(): void | 
| 203 | 188 |  { | 
| 204 |  | - $exercise1 = $this->createMock(CliExerciseInterface::class); | 
| 205 |  | - $exercise2 = $this->createMock(CliExerciseInterface::class); | 
| 206 |  | - $exercise1->method('getType')->willReturn(ExerciseType::CLI()); | 
| 207 |  | - $exercise2->method('getType')->willReturn(ExerciseType::CLI()); | 
| 208 |  | - $exercise1->method('getName')->willReturn('Exercise 1'); | 
| 209 |  | - $exercise2->method('getName')->willReturn('Exercise 2'); | 
|  | 189 | + $exercise1 = new CliExerciseImpl('Exercise 1'); | 
|  | 190 | + $exercise2 = new CliExerciseImpl('Exercise 2'); | 
| 210 | 191 | 
 | 
| 211 | 192 |  $oldData = [ | 
| 212 | 193 |  'current_exercise' => 'Exercise 3', | 
| @@ -246,12 +227,8 @@ public function testOldDataWillBeMigratedWhenInCorrectWorkshop(): void | 
| 246 | 227 | 
 | 
| 247 | 228 |  public function testOldDataWillNotBeMigratedWhenNotInCorrectWorkshop(): void | 
| 248 | 229 |  { | 
| 249 |  | - $exercise1 = $this->createMock(CliExerciseInterface::class); | 
| 250 |  | - $exercise2 = $this->createMock(CliExerciseInterface::class); | 
| 251 |  | - $exercise1->method('getType')->willReturn(ExerciseType::CLI()); | 
| 252 |  | - $exercise2->method('getType')->willReturn(ExerciseType::CLI()); | 
| 253 |  | - $exercise1->method('getName')->willReturn('Exercise 1'); | 
| 254 |  | - $exercise2->method('getName')->willReturn('Exercise 2'); | 
|  | 230 | + $exercise1 = new CliExerciseImpl('Exercise 1'); | 
|  | 231 | + $exercise2 = new CliExerciseImpl('Exercise 2'); | 
| 255 | 232 | 
 | 
| 256 | 233 |  $exercises = [ | 
| 257 | 234 |  $exercise1, | 
| @@ -279,12 +256,8 @@ public function testOldDataWillNotBeMigratedWhenNotInCorrectWorkshop(): void | 
| 279 | 256 | 
 | 
| 280 | 257 |  public function testOldDataWillNotBeMigratedWhenNotInCorrectWorkshopWithOtherWorkshop(): void | 
| 281 | 258 |  { | 
| 282 |  | - $exercise1 = $this->createMock(CliExerciseInterface::class); | 
| 283 |  | - $exercise2 = $this->createMock(CliExerciseInterface::class); | 
| 284 |  | - $exercise1->method('getType')->willReturn(ExerciseType::CLI()); | 
| 285 |  | - $exercise2->method('getType')->willReturn(ExerciseType::CLI()); | 
| 286 |  | - $exercise1->method('getName')->willReturn('Exercise 1'); | 
| 287 |  | - $exercise2->method('getName')->willReturn('Exercise 2'); | 
|  | 259 | + $exercise1 = new CliExerciseImpl('Exercise 1'); | 
|  | 260 | + $exercise2 = new CliExerciseImpl('Exercise 2'); | 
| 288 | 261 | 
 | 
| 289 | 262 |  $oldData = [ | 
| 290 | 263 |  'current_exercise' => 'Exercise 3', | 
|  | 
0 commit comments