Closed
Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
RFC? | no |
Symfony version | 4.1 |
Hi, iam trying to test a Command using symfony style
https://github.com/FroggDev/Symfony_StockManager/blob/master/src/Command/UserManager.php
I tried a lot of things without success in phpUnit with KernelTestCase.
This is the version of the code i am using to test the command:
// Get the command tester
$commandTester = new CommandTester(self::$command);
// Set input scenario
$commandTester->setInputs([0]); // display user list
$commandTester->setInputs([5]); // exit
echo "BEFORE";
// Execute the command
$commandTester->execute(['command' => self::$command->getName()]);
echo "AFTER";
Based on https://symfony.com/doc/current/components/console/helpers/questionhelper.html
The string "Before" is displayed but after the excecute no more output are displayed.
Even any phpUnit output.
Is there anyway to solve this trouble ?
Thanks