diff 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
line wrap: on
line diff
--- a/vendor/symfony/console/Tester/CommandTester.php	Thu Feb 28 13:21:36 2019 +0000
+++ b/vendor/symfony/console/Tester/CommandTester.php	Thu May 09 15:33:08 2019 +0100
@@ -62,9 +62,8 @@
         }
 
         $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']);
@@ -88,6 +87,10 @@
      */
     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());