Skip to content

Commit

Permalink
Merge branch '4.4' into 5.1
Browse files Browse the repository at this point in the history
* 4.4:
  [Process] Dont test TTY if there is no TTY support
  Fixing some Mongolian
  translating the validators for european portuguese language
  Fix CI
  Update validators.he.xlf
  Update security.he.xlf
  Update validators.he.xlf
  Improve performances in CircualReference detection
  [PHPUnitBridge] Fixed crash on Windows with PHP 8
  Fix session called initized several time
  • Loading branch information
nicolas-grekas committed Nov 2, 2020
2 parents 74693ef + ec1482f commit b25b468
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions 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 comments on commit b25b468

Please sign in to comment.