Symfony2 API
Class

Symfony\Component\Console\Tester\CommandTester

class CommandTester

Eases the testing of console commands.

Methods

__construct(Command $command)

Constructor.

integer execute(array $input, array $options = array())

Executes the command.

string getDisplay(Boolean $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.

integer getStatusCode()

Gets the status code returned by the last execution of the application.

Details

at line 35
public __construct(Command $command)

Constructor.

Parameters

Command $command A Command instance to test.

at line 54
public integer execute(array $input, array $options = array())

Executes the command.

Available options:

Parameters

array $input An array of arguments and options
array $options An array of options

Return Value

integer The command exit code

at line 79
public string getDisplay(Boolean $normalize = false)

Gets the display returned by the last execution of the command.

Parameters

Boolean $normalize Whether to normalize end of lines to \n or not

Return Value

string The display

at line 97
public InputInterface getInput()

Gets the input instance used by the last execution of the command.

Return Value

InputInterface The current input instance

at line 107
public OutputInterface getOutput()

Gets the output instance used by the last execution of the command.

Return Value

OutputInterface The current output instance

at line 117
public integer getStatusCode()

Gets the status code returned by the last execution of the application.

Return Value

integer The status code