1717 */
1818class ConcreteTestCommand extends AbstractCommand
1919{
20+ /**
21+ * @var int
22+ */
2023 private int $ executeCommandReturn = Cli::RETURN_SUCCESS ;
24+ /**
25+ * @var ?\Throwable
26+ */
2127 private ?\Throwable $ throwOnExecute = null ;
28+ /**
29+ * @var ?bool
30+ */
2231 private ?bool $ realTtyAvailableOverride = null ;
2332
33+ /**
34+ * Configures the command name.
35+ */
2436 protected function configure (): void
2537 {
2638 $ this ->setName ('test:concrete-command ' );
2739 }
2840
41+ /**
42+ * Returns the preconfigured exit code, or throws the preconfigured exception.
43+ *
44+ * @param InputInterface $input
45+ * @param OutputInterface $output
46+ */
2947 protected function executeCommand (InputInterface $ input , OutputInterface $ output ): int
3048 {
3149 if ($ this ->throwOnExecute !== null ) {
@@ -35,60 +53,114 @@ protected function executeCommand(InputInterface $input, OutputInterface $output
3553 return $ this ->executeCommandReturn ;
3654 }
3755
56+ /**
57+ * Returns the overridden TTY availability, falling back to the parent implementation.
58+ */
3859 protected function isRealTtyAvailable (): bool
3960 {
4061 return $ this ->realTtyAvailableOverride ?? parent ::isRealTtyAvailable ();
4162 }
4263
64+ /**
65+ * Overrides the TTY availability reported to the command.
66+ *
67+ * @param ?bool $available
68+ */
4369 public function setRealTtyAvailable (?bool $ available ): void
4470 {
4571 $ this ->realTtyAvailableOverride = $ available ;
4672 }
4773
74+ /**
75+ * Sets the exit code returned by executeCommand().
76+ *
77+ * @param int $code
78+ */
4879 public function setExecuteCommandReturn (int $ code ): void
4980 {
5081 $ this ->executeCommandReturn = $ code ;
5182 }
5283
84+ /**
85+ * Makes executeCommand() throw the given exception.
86+ *
87+ * @param \Throwable $exception
88+ */
5389 public function setThrowOnExecute (\Throwable $ exception ): void
5490 {
5591 $ this ->throwOnExecute = $ exception ;
5692 }
5793
94+ /**
95+ * Injects the SymfonyStyle IO used by the command.
96+ *
97+ * @param SymfonyStyle $io
98+ */
5899 public function setIoForTest (SymfonyStyle $ io ): void
59100 {
60101 $ this ->io = $ io ;
61102 }
62103
104+ /**
105+ * Exposes the protected getCommandName().
106+ *
107+ * @param string $group
108+ * @param string $command
109+ */
63110 public function callGetCommandName (string $ group , string $ command ): string
64111 {
65112 return $ this ->getCommandName ($ group , $ command );
66113 }
67114
115+ /**
116+ * Exposes the protected isVerbose().
117+ *
118+ * @param OutputInterface $output
119+ */
68120 public function callIsVerbose (OutputInterface $ output ): bool
69121 {
70122 return $ this ->isVerbose ($ output );
71123 }
72124
125+ /**
126+ * Exposes the protected isVeryVerbose().
127+ *
128+ * @param OutputInterface $output
129+ */
73130 public function callIsVeryVerbose (OutputInterface $ output ): bool
74131 {
75132 return $ this ->isVeryVerbose ($ output );
76133 }
77134
135+ /**
136+ * Exposes the protected isDebug().
137+ *
138+ * @param OutputInterface $output
139+ */
78140 public function callIsDebug (OutputInterface $ output ): bool
79141 {
80142 return $ this ->isDebug ($ output );
81143 }
82144
83145 /**
146+ * Exposes the protected resolveVendorThemes().
147+ *
84148 * @param array<string> $themeCodes
149+ * @param ThemeList $themeList
85150 * @return array<string>
86151 */
87152 public function callResolveVendorThemes (array $ themeCodes , ThemeList $ themeList ): array
88153 {
89154 return $ this ->resolveVendorThemes ($ themeCodes , $ themeList );
90155 }
91156
157+ /**
158+ * Exposes the protected handleInvalidThemeWithSuggestions().
159+ *
160+ * @param string $invalidTheme
161+ * @param ThemeSuggester $themeSuggester
162+ * @param OutputInterface $output
163+ */
92164 public function callHandleInvalidThemeWithSuggestions (
93165 string $ invalidTheme ,
94166 ThemeSuggester $ themeSuggester ,
@@ -97,16 +169,27 @@ public function callHandleInvalidThemeWithSuggestions(
97169 return $ this ->handleInvalidThemeWithSuggestions ($ invalidTheme , $ themeSuggester , $ output );
98170 }
99171
172+ /**
173+ * Exposes the protected isInteractiveTerminal().
174+ *
175+ * @param OutputInterface $output
176+ */
100177 public function callIsInteractiveTerminal (OutputInterface $ output ): bool
101178 {
102179 return $ this ->isInteractiveTerminal ($ output );
103180 }
104181
182+ /**
183+ * Exposes the protected setPromptEnvironment().
184+ */
105185 public function callSetPromptEnvironment (): void
106186 {
107187 $ this ->setPromptEnvironment ();
108188 }
109189
190+ /**
191+ * Exposes the protected resetPromptEnvironment().
192+ */
110193 public function callResetPromptEnvironment (): void
111194 {
112195 $ this ->resetPromptEnvironment ();
0 commit comments