@@ -17,16 +17,16 @@ public function testConfigureInputCallsCorrectFactory(): void
1717 $ manager = new RunnerManager ();
1818 $ command = new CommandDefinition ('my-command ' , [], 'var_dump ' );
1919
20- $ factory1 = $ this ->prophesize (ExerciseRunnerFactoryInterface::class);
21- $ factory1 ->supports ($ exercise )->willReturn (false );
22- $ factory1 ->configureInput ( $ command )-> shouldNotBeCalled ( );
20+ $ factory1 = $ this ->createMock (ExerciseRunnerFactoryInterface::class);
21+ $ factory1 ->method ( ' supports ' )-> with ($ exercise )->willReturn (false );
22+ $ factory1 ->expects ( $ this -> never ())-> method ( ' configureInput ' )-> with ( $ command );
2323
24- $ factory2 = $ this ->prophesize (ExerciseRunnerFactoryInterface::class);
25- $ factory2 ->supports ($ exercise )->willReturn (true );
26- $ factory2 ->configureInput ( $ command )-> shouldBeCalled ( );
24+ $ factory2 = $ this ->createMock (ExerciseRunnerFactoryInterface::class);
25+ $ factory2 ->method ( ' supports ' )-> with ($ exercise )->willReturn (true );
26+ $ factory2 ->expects ( $ this -> once ())-> method ( ' configureInput ' )-> with ( $ command );
2727
28- $ manager ->addFactory ($ factory1-> reveal () );
29- $ manager ->addFactory ($ factory2-> reveal () );
28+ $ manager ->addFactory ($ factory1 );
29+ $ manager ->addFactory ($ factory2 );
3030 $ manager ->configureInput ($ exercise , $ command );
3131 }
3232
@@ -35,16 +35,16 @@ public function testGetRunnerCallsCorrectFactory(): void
3535 $ exercise = new CliExerciseImpl ();
3636 $ manager = new RunnerManager ();
3737
38- $ factory1 = $ this ->prophesize (ExerciseRunnerFactoryInterface::class);
39- $ factory1 ->supports ($ exercise )->willReturn (false );
40- $ factory1 ->create ( $ exercise )-> shouldNotBeCalled ( );
38+ $ factory1 = $ this ->createMock (ExerciseRunnerFactoryInterface::class);
39+ $ factory1 ->method ( ' supports ' )-> with ($ exercise )->willReturn (false );
40+ $ factory1 ->expects ( $ this -> never ())-> method ( ' create ' )-> with ( $ exercise );
4141
42- $ factory2 = $ this ->prophesize (ExerciseRunnerFactoryInterface::class);
43- $ factory2 ->supports ($ exercise )->willReturn (true );
44- $ factory2 ->create ( $ exercise )-> shouldBeCalled ( );
42+ $ factory2 = $ this ->createMock (ExerciseRunnerFactoryInterface::class);
43+ $ factory2 ->method ( ' supports ' )-> with ($ exercise )->willReturn (true );
44+ $ factory2 ->expects ( $ this -> once ())-> method ( ' create ' )-> with ( $ exercise );
4545
46- $ manager ->addFactory ($ factory1-> reveal () );
47- $ manager ->addFactory ($ factory2-> reveal () );
46+ $ manager ->addFactory ($ factory1 );
47+ $ manager ->addFactory ($ factory2 );
4848 $ manager ->getRunner ($ exercise );
4949 }
5050
0 commit comments