Fix ArrayInput::toString() for InputArgument::IS_ARRAY args
This commit is contained in:
parent
9587d04520
commit
f371fd8ced
@ -103,7 +103,7 @@ class ArrayInput extends Input
|
||||
$params[] = $param.('' != $val ? '='.$this->escapeToken($val) : '');
|
||||
}
|
||||
} else {
|
||||
$params[] = is_array($val) ? array_map(array($this, 'escapeToken'), $val) : $this->escapeToken($val);
|
||||
$params[] = is_array($val) ? implode(' ', array_map(array($this, 'escapeToken'), $val)) : $this->escapeToken($val);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,5 +143,8 @@ class ArrayInputTest extends TestCase
|
||||
|
||||
$input = new ArrayInput(array('-b' => array('bval_1', 'bval_2'), '--f' => array('fval_1', 'fval_2')));
|
||||
$this->assertSame('-b=bval_1 -b=bval_2 --f=fval_1 --f=fval_2', (string) $input);
|
||||
|
||||
$input = new ArrayInput(array('array_arg' => array('val_1', 'val_2')));
|
||||
$this->assertSame('val_1 val_2', (string) $input);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user