public function ProcessTest::testProcessPipes

tests results from sub processes

@dataProvider pipesCodeProvider

File

drupal/core/vendor/symfony/process/Symfony/Component/Process/Tests/ProcessTest.php, line 65

Class

ProcessTest
@author Robert Schönthal <seroscho@googlemail.com>

Namespace

Symfony\Component\Process\Tests

Code

public function testProcessPipes($expected, $code) {
  if (strpos(PHP_OS, "WIN") === 0) {
    $this
      ->markTestSkipped('Test hangs on Windows & PHP due to https://bugs.php.net/bug.php?id=60120 and https://bugs.php.net/bug.php?id=51800');
  }
  $p = new Process(sprintf('php -r %s', escapeshellarg($code)));
  $p
    ->setStdin($expected);
  $p
    ->run();
  $this
    ->assertSame($expected, $p
    ->getOutput());
  $this
    ->assertSame($expected, $p
    ->getErrorOutput());
  $this
    ->assertSame(0, $p
    ->getExitCode());
}