Open
Description
Symfony version(s) affected
Latest 6 and 7, probably more
Description
Using CommandTester
with --help
options is not working.
How to reproduce
This test is passing (see here):
// src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php
public function testHelpDisplays()
{
$command = new Command('foo');
$command->setCode(function (OutputInterface $output) { $output->writeln('Hello foo!'); });
$application = new Application();
$application->setAutoExit(false);
$application->add($command);
$tester = new CommandTester($application->find('foo'));
$tester->execute(['--help' => true]);
$this->assertStringContainsString('Hello foo!', $tester->getDisplay());
$this->assertEquals('Hello foo!'.\PHP_EOL, $tester->getDisplay());
}
If --help
is replaced with --silent
or --quiet
the test is still passing.
Possible Solution
No response
Additional Context
No response