updated packages
This commit is contained in:
@@ -52,7 +52,7 @@ class ApplicationTester
|
||||
*
|
||||
* @return int The command exit code
|
||||
*/
|
||||
public function run(array $input, $options = array())
|
||||
public function run(array $input, $options = [])
|
||||
{
|
||||
$this->input = new ArrayInput($input);
|
||||
if (isset($options['interactive'])) {
|
||||
|
||||
@@ -48,7 +48,7 @@ class CommandTester
|
||||
*
|
||||
* @return int The command exit code
|
||||
*/
|
||||
public function execute(array $input, array $options = array())
|
||||
public function execute(array $input, array $options = [])
|
||||
{
|
||||
// set the command name automatically if the application requires
|
||||
// this argument and no command name was passed
|
||||
@@ -56,13 +56,12 @@ class CommandTester
|
||||
&& (null !== $application = $this->command->getApplication())
|
||||
&& $application->getDefinition()->hasArgument('command')
|
||||
) {
|
||||
$input = array_merge(array('command' => $this->command->getName()), $input);
|
||||
$input = array_merge(['command' => $this->command->getName()], $input);
|
||||
}
|
||||
|
||||
$this->input = new ArrayInput($input);
|
||||
if ($this->inputs) {
|
||||
$this->input->setStream(self::createStream($this->inputs));
|
||||
}
|
||||
// Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN.
|
||||
$this->input->setStream(self::createStream($this->inputs));
|
||||
|
||||
if (isset($options['interactive'])) {
|
||||
$this->input->setInteractive($options['interactive']);
|
||||
|
||||
@@ -23,7 +23,7 @@ trait TesterTrait
|
||||
{
|
||||
/** @var StreamOutput */
|
||||
private $output;
|
||||
private $inputs = array();
|
||||
private $inputs = [];
|
||||
private $captureStreamsIndependently = false;
|
||||
|
||||
/**
|
||||
@@ -35,6 +35,10 @@ trait TesterTrait
|
||||
*/
|
||||
public function getDisplay($normalize = false)
|
||||
{
|
||||
if (null === $this->output) {
|
||||
throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?');
|
||||
}
|
||||
|
||||
rewind($this->output->getStream());
|
||||
|
||||
$display = stream_get_contents($this->output->getStream());
|
||||
@@ -126,7 +130,7 @@ trait TesterTrait
|
||||
*/
|
||||
private function initOutput(array $options)
|
||||
{
|
||||
$this->captureStreamsIndependently = array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately'];
|
||||
$this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately'];
|
||||
if (!$this->captureStreamsIndependently) {
|
||||
$this->output = new StreamOutput(fopen('php://memory', 'w', false));
|
||||
if (isset($options['decorated'])) {
|
||||
|
||||
Reference in New Issue
Block a user