ApplicationTester
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);
Traits
Methods
Gets the display returned by the last execution of the command or application.
Gets the output written to STDERR by the application.
Gets the input instance used by the last execution of the command or application.
Gets the output instance used by the last execution of the command or application.
Gets the status code returned by the last execution of the command or application.
Executes the application.
Details
string
getDisplay(bool $normalize = false)
Gets the display returned by the last execution of the command or 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 command or application.
OutputInterface
getOutput()
Gets the output instance used by the last execution of the command or application.
int
getStatusCode()
Gets the status code returned by the last execution of the command or 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
- capture_stderr_separately: Make output of stdOut and stdErr separately available