pass command name automatically if required by the application
This commit is contained in:
parent
426559f65e
commit
81aead238b
@ -55,6 +55,18 @@ class CommandTester
|
||||
*/
|
||||
public function execute(array $input, array $options = array())
|
||||
{
|
||||
// set the command name automatically if the application requires
|
||||
// this argument and no command name was passed
|
||||
if (!isset($input['command'])) {
|
||||
$application = $this->command->getApplication();
|
||||
if (null !== $application) {
|
||||
$definition = $application->getDefinition();
|
||||
if ($definition->hasArgument('command')) {
|
||||
$input['command'] = $this->command->getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->input = new ArrayInput($input);
|
||||
if (isset($options['interactive'])) {
|
||||
$this->input->setInteractive($options['interactive']);
|
||||
|
Reference in New Issue
Block a user