class CommandTester
Eases the testing of console commands.
__construct(Command $command) | ||
int | execute(array $input, array $options = array()) Executes the command. | |
string | getDisplay(bool $normalize = false) Gets the display returned by the last execution of the command. | |
InputInterface | getInput() Gets the input instance used by the last execution of the command. | |
OutputInterface | getOutput() Gets the output instance used by the last execution of the command. | |
int | getStatusCode() Gets the status code returned by the last execution of the application. | |
CommandTester | setInputs(array $inputs) Sets the user inputs. |
Command | $command |
Executes the command.
Available execution options:
array | $input | An array of command arguments and options |
array | $options | An array of execution options |
int | The command exit code |
Gets the display returned by the last execution of the command.
bool | $normalize | Whether to normalize end of lines to \n or not |
string | The display |
Gets the input instance used by the last execution of the command.
InputInterface | The current input instance |
Gets the output instance used by the last execution of the command.
OutputInterface | The current output instance |
Gets the status code returned by the last execution of the application.
int | The status code |
Sets the user inputs.
array | $inputs | An array of strings representing each input passed to the command input stream |
CommandTester |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Console/Tester/CommandTester.html