@@ -226,6 +226,48 @@ public function executeWillSkipWhenWikiTargetDoesNotExist(): void
226226 self ::assertSame (WikiCommand::SUCCESS , $ this ->executeCommand ());
227227 }
228228
229+ /**
230+ * @return void
231+ */
232+ #[Test]
233+ public function executeWillGenerateWhenCustomWikiTargetDoesNotExist (): void
234+ {
235+ $ this ->input ->getOption ('target ' )
236+ ->willReturn ('build/wiki ' );
237+ $ this ->projectCapabilitiesResolver ->resolve (Argument::any (), Argument::any (), Argument::any ())
238+ ->willReturn (new ProjectCapabilities (['src/ ' ], 'FastForward \\DevTools ' , false , false , false , true ));
239+ $ this ->filesystem ->getAbsolutePath ('src/ ' )
240+ ->willReturn (getcwd () . '/src ' )
241+ ->shouldBeCalled ();
242+ $ this ->processBuilder ->withArgument ('--target ' , 'build/wiki ' )
243+ ->willReturn ($ this ->processBuilder ->reveal ())
244+ ->shouldBeCalled ();
245+ $ this ->processBuilder ->withArgument ('--directory ' , getcwd () . '/src ' )
246+ ->willReturn ($ this ->processBuilder ->reveal ())
247+ ->shouldBeCalled ();
248+ $ this ->processQueue ->add ($ this ->process ->reveal (), Argument::cetera ())
249+ ->shouldBeCalled ();
250+ $ this ->processQueue ->run ($ this ->output ->reveal ())
251+ ->willReturn (WikiCommand::SUCCESS )
252+ ->shouldBeCalled ();
253+ $ this ->logger ->info ('Generating wiki documentation... ' , Argument::that (
254+ static fn (array $ context ): bool => $ context ['input ' ] instanceof InputInterface
255+ ))->shouldBeCalled ();
256+ $ this ->logger ->log (
257+ 'info ' ,
258+ 'Wiki documentation generated successfully. ' ,
259+ Argument::that (static fn (array $ context ): bool => $ context ['input ' ] instanceof InputInterface
260+ && $ context ['output ' ] instanceof OutputInterface),
261+ )->shouldBeCalled ();
262+ $ this ->logger ->log (
263+ 'warning ' ,
264+ 'Skipping wiki documentation generation because the wiki target does not exist at {target}. ' ,
265+ Argument::cetera (),
266+ )->shouldNotBeCalled ();
267+
268+ self ::assertSame (WikiCommand::SUCCESS , $ this ->executeCommand ());
269+ }
270+
229271 /**
230272 * @return void
231273 */
0 commit comments