99use Prophecy \Argument ;
1010use Prophecy \PhpUnit \ProphecyTrait ;
1111use Symfony \Bridge \PhpUnit \ClockMock ;
12+ use Symfony \Component \Console \Input \ArrayInput ;
1213use Symfony \Component \Console \Input \InputInterface ;
1314use Symfony \Component \Console \Output \OutputInterface ;
1415
@@ -39,7 +40,6 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
3940 }
4041 };
4142
42- $ input = $ this ->prophesize (InputInterface::class);
4343 $ output = $ this ->prophesize (OutputInterface::class);
4444 $ output ->writeln (Argument::containingString ('Starting ' ), OutputInterface::VERBOSITY_VERBOSE )
4545 ->shouldBeCalledTimes (1 );
@@ -50,7 +50,7 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
5050
5151 ClockMock::withClockMock (true );
5252 $ start = ClockMock::time ();
53- $ exitCode = $ stubCommand ->run ($ input -> reveal ( ), $ output ->reveal ());
53+ $ exitCode = $ stubCommand ->run (new ArrayInput ([] ), $ output ->reveal ());
5454 $ end = ClockMock::time ();
5555
5656 $ this ->assertSame (0 , $ exitCode );
@@ -69,14 +69,13 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
6969 }
7070 };
7171
72- $ input = $ this ->prophesize (InputInterface::class);
7372 $ output = $ this ->prophesize (OutputInterface::class);
7473 $ output ->writeln (Argument::containingString ('Starting ' ), OutputInterface::VERBOSITY_VERBOSE )
7574 ->shouldBeCalledTimes (1 );
7675
7776 $ this ->expectException (\InvalidArgumentException::class);
7877
79- $ stubCommand ->run ($ input -> reveal ( ), $ output ->reveal ());
78+ $ stubCommand ->run (new ArrayInput ([] ), $ output ->reveal ());
8079 }
8180
8281 /**
@@ -102,14 +101,13 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
102101 }
103102 };
104103
105- $ input = $ this ->prophesize (InputInterface::class);
106104 $ output = $ this ->prophesize (OutputInterface::class);
107105 $ output ->writeln (Argument::containingString ('Starting ' ), OutputInterface::VERBOSITY_VERBOSE )
108106 ->shouldBeCalledTimes (1 );
109107 $ output ->writeln ('Signal received, terminating with exit code 143 ' , OutputInterface::VERBOSITY_NORMAL )
110108 ->shouldBeCalledTimes (1 );
111109
112- $ exitCode = $ stubCommand ->run ($ input -> reveal ( ), $ output ->reveal ());
110+ $ exitCode = $ stubCommand ->run (new ArrayInput ([] ), $ output ->reveal ());
113111
114112 $ this ->assertSame (143 , $ exitCode );
115113 }
@@ -126,7 +124,6 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
126124 }
127125 };
128126
129- $ input = $ this ->prophesize (InputInterface::class);
130127 $ output = $ this ->prophesize (OutputInterface::class);
131128 $ output ->writeln (Argument::containingString ('Starting ' ), OutputInterface::VERBOSITY_VERBOSE )
132129 ->shouldBeCalledTimes (1 )
@@ -136,7 +133,7 @@ protected function commandBody(InputInterface $input, OutputInterface $output):
136133 $ output ->writeln ('Signal received, skipping execution ' , OutputInterface::VERBOSITY_NORMAL )
137134 ->shouldBeCalledTimes (1 );
138135
139- $ exitCode = $ stubCommand ->run ($ input -> reveal ( ), $ output ->reveal ());
136+ $ exitCode = $ stubCommand ->run (new ArrayInput ([] ), $ output ->reveal ());
140137
141138 $ this ->assertSame (143 , $ exitCode );
142139 }
0 commit comments