From e918e5ab30c69475127e47546d2210296edfd227 Mon Sep 17 00:00:00 2001 From: Nyholm Date: Sun, 1 Nov 2020 20:26:06 +0100 Subject: [PATCH] [Process] Dont test TTY if there is no TTY support --- .../Component/Process/Tests/ProcessTest.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Symfony/Component/Process/Tests/ProcessTest.php b/src/Symfony/Component/Process/Tests/ProcessTest.php index 6b525d2684..62bffec88f 100644 --- a/src/Symfony/Component/Process/Tests/ProcessTest.php +++ b/src/Symfony/Component/Process/Tests/ProcessTest.php @@ -476,6 +476,10 @@ class ProcessTest extends TestCase $this->markTestSkipped('Windows does not have /dev/tty support'); } + if (!Process::isTtySupported()) { + $this->markTestSkipped('There is no TTY support'); + } + $process = $this->getProcess('echo "foo" >> /dev/null && '.$this->getProcessForCode('usleep(100000);')->getCommandLine()); $process->setTty(true); $process->start(); @@ -491,6 +495,10 @@ class ProcessTest extends TestCase $this->markTestSkipped('Windows does have /dev/tty support'); } + if (!Process::isTtySupported()) { + $this->markTestSkipped('There is no TTY support'); + } + $process = $this->getProcess('echo "foo" >> /dev/null'); $process->setTty(true); $process->run(); @@ -1433,16 +1441,7 @@ class ProcessTest extends TestCase $p = Process::fromShellCommandline(sprintf('"%s" -r %s "a" "" "b"', self::$phpBin, escapeshellarg('print_r($argv);'))); $p->run(); - $expected = << - - [1] => a - [2] => - [3] => b -) - -EOTXT; + $expected = "Array\n(\n [0] => -\n [1] => a\n [2] => \n [3] => b\n)\n"; $this->assertSame($expected, str_replace('Standard input code', '-', $p->getOutput())); }