class ApplicationTester
Eases the testing of console applications.
When testing an application, don't forget to disable the auto exit flag:
$application = new Application();
$application->setAutoExit(false);
TesterTrait |
string | getDisplay(bool $normalize = false) Gets the display returned by the last execution of the command or application. | from TesterTrait |
InputInterface | getInput() Gets the input instance used by the last execution of the command or application. | from TesterTrait |
OutputInterface | getOutput() Gets the output instance used by the last execution of the command or application. | from TesterTrait |
int | getStatusCode() Gets the status code returned by the last execution of the command or application. | from TesterTrait |
TesterTrait | setInputs(array $inputs) Sets the user inputs. | from TesterTrait |
__construct(Application $application) | ||
int | run(array $input, array $options = array()) Executes the application. | |
string | getErrorOutput(bool $normalize = false) Gets the output written to STDERR by the application. |
Gets the display returned by the last execution of the command or application.
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 or application.
InputInterface | The current input instance |
Gets the output instance used by the last execution of the command or application.
OutputInterface | The current output instance |
Gets the status code returned by the last execution of the command or application.
int | The status code |
Sets the user inputs.
array | $inputs | array An array of strings representing each input passed to the command input stream |
TesterTrait |
Application | $application |
Executes the application.
Available options:
array | $input | An array of arguments and options |
array | $options | An array of options |
int | The command exit code |
Gets the output written to STDERR by the application.
bool | $normalize | Whether to normalize end of lines to \n or not |
string |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Console/Tester/ApplicationTester.html