-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: 3 / 4
Description
CommandTester https://github.com/symfony/console/blob/master/Tester/CommandTester.php#L71
Creates an instance of StreamOutput this makes it difficult to test ->getErrorOutput as that is only implemented in ConsoleOutputInterface
In the ApplicationTester there is a option to enable it https://github.com/symfony/console/blob/master/Tester/ApplicationTester.php#L51
It would be nice if the same option was available in CommandTester.
How to reproduce
$cmd = new CommandTester($cmd);
if (!$cmd->getOutput() instanceof \Symfony\Component\Console\Output\ConsoleOutputInterface) {
throw new \Exception('Nope');
}
Possible Solution
Make it configurable the same as in ApplicationTester