@@ -146,6 +146,18 @@ public function commandWillSetExpectedNameDescriptionAndHelp(): void
146146 self ::assertSame ('This command runs PHPUnit to execute your tests. ' , $ this ->command ->getHelp ());
147147 }
148148
149+ /**
150+ * @return void
151+ */
152+ #[Test]
153+ public function commandWillHaveExpectedOutputOptions (): void
154+ {
155+ $ definition = $ this ->command ->getDefinition ();
156+
157+ self ::assertTrue ($ definition ->hasOption ('no-progress ' ));
158+ self ::assertTrue ($ definition ->hasOption ('coverage-summary ' ));
159+ }
160+
149161 /**
150162 * @return void
151163 */
@@ -172,6 +184,7 @@ public function executeWithCoverageWillIncludeCoverageArguments(): void
172184 $ commandLine = $ process ->getCommandLine ();
173185
174186 return str_contains ($ commandLine , '--coverage-text ' )
187+ && ! str_contains ($ commandLine , '--only-summary-for-coverage-text ' )
175188 && str_contains ($ commandLine , '--coverage-html= ' . getcwd () . '/public/coverage ' );
176189 });
177190
@@ -181,6 +194,63 @@ public function executeWithCoverageWillIncludeCoverageArguments(): void
181194 $ this ->invokeExecute ();
182195 }
183196
197+ /**
198+ * @return void
199+ */
200+ #[Test]
201+ public function executeWithNoProgressWillForwardNoProgressToPhpUnit (): void
202+ {
203+ $ this ->willQueueProcessMatching (static fn (Process $ process ): bool => str_contains (
204+ $ process ->getCommandLine (),
205+ '--no-progress ' ,
206+ ));
207+
208+ $ this ->input ->getOption ('no-progress ' )
209+ ->willReturn (true );
210+
211+ $ this ->invokeExecute ();
212+ }
213+
214+ /**
215+ * @return void
216+ */
217+ #[Test]
218+ public function executeWithCoverageSummaryWillIncludeCoverageTextSummaryArgument (): void
219+ {
220+ $ this ->willQueueProcessMatching (function (Process $ process ): bool {
221+ $ commandLine = $ process ->getCommandLine ();
222+
223+ return str_contains ($ commandLine , '--coverage-text ' )
224+ && str_contains ($ commandLine , '--only-summary-for-coverage-text ' );
225+ });
226+
227+ $ this ->input ->getOption ('coverage ' )
228+ ->willReturn ('public/coverage ' );
229+ $ this ->input ->getOption ('coverage-summary ' )
230+ ->willReturn (true );
231+
232+ $ this ->invokeExecute ();
233+ }
234+
235+ /**
236+ * @return void
237+ */
238+ #[Test]
239+ public function executeWithCoverageSummaryWithoutCoverageWillNotGenerateCoverageTextSummary (): void
240+ {
241+ $ this ->willQueueProcessMatching (static function (Process $ process ): bool {
242+ $ commandLine = $ process ->getCommandLine ();
243+
244+ return ! str_contains ($ commandLine , '--coverage-text ' )
245+ && ! str_contains ($ commandLine , '--only-summary-for-coverage-text ' );
246+ });
247+
248+ $ this ->input ->getOption ('coverage-summary ' )
249+ ->willReturn (true );
250+
251+ $ this ->invokeExecute ();
252+ }
253+
184254 /**
185255 * @return void
186256 */
0 commit comments