Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/console/Tester/CommandTester.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | 129ea1e6d783 |
children |
comparison
equal
deleted
inserted
replaced
17:129ea1e6d783 | 18:af1871eacc83 |
---|---|
60 ) { | 60 ) { |
61 $input = array_merge(['command' => $this->command->getName()], $input); | 61 $input = array_merge(['command' => $this->command->getName()], $input); |
62 } | 62 } |
63 | 63 |
64 $this->input = new ArrayInput($input); | 64 $this->input = new ArrayInput($input); |
65 if ($this->inputs) { | 65 // Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN. |
66 $this->input->setStream(self::createStream($this->inputs)); | 66 $this->input->setStream(self::createStream($this->inputs)); |
67 } | |
68 | 67 |
69 if (isset($options['interactive'])) { | 68 if (isset($options['interactive'])) { |
70 $this->input->setInteractive($options['interactive']); | 69 $this->input->setInteractive($options['interactive']); |
71 } | 70 } |
72 | 71 |
86 * | 85 * |
87 * @return string The display | 86 * @return string The display |
88 */ | 87 */ |
89 public function getDisplay($normalize = false) | 88 public function getDisplay($normalize = false) |
90 { | 89 { |
90 if (null === $this->output) { | |
91 throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); | |
92 } | |
93 | |
91 rewind($this->output->getStream()); | 94 rewind($this->output->getStream()); |
92 | 95 |
93 $display = stream_get_contents($this->output->getStream()); | 96 $display = stream_get_contents($this->output->getStream()); |
94 | 97 |
95 if ($normalize) { | 98 if ($normalize) { |