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);
Methods
__construct(Application $application) | ||
int | run(array $input, array $options = array()) Executes the application. | |
string | getDisplay(bool $normalize = false) Gets the display returned by the last execution of the application. | |
string | getErrorOutput(bool $normalize = false) Gets the output written to STDERR by the application. | |
InputInterface | getInput() Gets the input instance used by the last execution of the application. | |
OutputInterface | getOutput() Gets the output instance used by the last execution of the application. | |
int | getStatusCode() Gets the status code returned by the last execution of the application. |
Details
__construct(Application $application)
int run(array $input, array $options = array())
Executes the application.
Available options:
- interactive: Sets the input interactive flag
- decorated: Sets the output decorated flag
- verbosity: Sets the output verbosity flag
- capturestderrseparately: Make output of stdOut and stdErr separately available
string getDisplay(bool $normalize = false)
Gets the display returned by the last execution of the application.
string getErrorOutput(bool $normalize = false)
Gets the output written to STDERR by the application.
InputInterface getInput()
Gets the input instance used by the last execution of the application.
OutputInterface getOutput()
Gets the output instance used by the last execution of the application.
int getStatusCode()
Gets the status code returned by the last execution of the application.
Please login to continue.