public function AbstractProcessTest::testProcessPipes

tests results from sub processes

@dataProvider pipesCodeProvider

File

drupal/core/vendor/symfony/process/Symfony/Component/Process/Tests/AbstractProcessTest.php, line 88

Class

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

Namespace

Symfony\Component\Process\Tests

Code

public function testProcessPipes($code, $size) {
  if (defined('PHP_WINDOWS_VERSION_BUILD')) {
    $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');
  }
  $expected = str_repeat(str_repeat('*', 1024), $size) . '!';
  $expectedLength = 1024 * $size + 1;
  $p = $this
    ->getProcess(sprintf('php -r %s', escapeshellarg($code)));
  $p
    ->setStdin($expected);
  $p
    ->run();
  $this
    ->assertEquals($expectedLength, strlen($p
    ->getOutput()));
  $this
    ->assertEquals($expectedLength, strlen($p
    ->getErrorOutput()));
}