10000 [Process] Dont test TTY if there is no TTY support by Nyholm · Pull Request #38950 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Process] Dont test TTY if there is no TTY support #38950

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Process] Dont test TTY if there is no TTY support
  • Loading branch information
Nyholm authored and nicolas-grekas committed Nov 2, 2020
commit e918e5ab30c69475127e47546d2210296edfd227
19 changes: 9 additions & 10 deletions src/Symfony/Component/Process/Tests/ProcessTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,10 @@ public function testTTYCommand()
$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();
Expand All @@ -491,6 +495,10 @@ public function testTTYCommandExitCode()
$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();
Expand Down Expand Up @@ -1433,16 +1441,7 @@ public function testRawCommandLine()
$p = Process::fromShellCommandline(sprintf('"%s" -r %s "a" "" "b"', self::$phpBin, escapeshellarg('print_r($argv);')));
$p->run();

$expected = <<<EOTXT
Array
(
[0] => -
[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()));
}

Expand Down
0