Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e918e5a

Browse files
Nyholmnicolas-grekas
authored andcommitted
[Process] Dont test TTY if there is no TTY support
1 parent 91fb5fa commit e918e5a

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/Symfony/Component/Process/Tests/ProcessTest.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,10 @@ public function testTTYCommand()
476476
$this->markTestSkipped('Windows does not have /dev/tty support');
477477
}
478478

479+
if (!Process::isTtySupported()) {
480+
$this->markTestSkipped('There is no TTY support');
481+
}
482+
479483
$process = $this->getProcess('echo "foo" >> /dev/null && '.$this->getProcessForCode('usleep(100000);')->getCommandLine());
480484
$process->setTty(true);
481485
$process->start();
@@ -491,6 +495,10 @@ public function testTTYCommandExitCode()
491495
$this->markTestSkipped('Windows does have /dev/tty support');
492496
}
493497

498+
if (!Process::isTtySupported()) {
499+
$this->markTestSkipped('There is no TTY support');
500+
}
501+
494502
$process = $this->getProcess('echo "foo" >> /dev/null');
495503
$process->setTty(true);
496504
$process->run();
@@ -1433,16 +1441,7 @@ public function testRawCommandLine()
14331441
$p = Process::fromShellCommandline(sprintf('"%s" -r %s "a" "" "b"', self::$phpBin, escapeshellarg('print_r($argv);')));
14341442
$p->run();
14351443

1436-
$expected = <<<EOTXT
1437-
Array
1438-
(
1439-
[0] => -
1440-
[1] => a
1441-
[2] =>
1442-
[3] => b
1443-
)
1444-
1445-
EOTXT;
1444+
$expected = "Array\n(\n [0] => -\n [1] => a\n [2] => \n [3] => b\n)\n";
14461445
$this->assertSame($expected, str_replace('Standard input code', '-', $p->getOutput()));
14471446
}
14481447

0 commit comments

Comments
 (0)