public function AbstractProcessTest::testGetIncrementalErrorOutput

File

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

Class

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

Namespace

Symfony\Component\Process\Tests

Code

public function testGetIncrementalErrorOutput() {
  $p = new Process(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { usleep(50000); file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }')));
  $p
    ->start();
  while ($p
    ->isRunning()) {
    $this
      ->assertLessThanOrEqual(1, preg_match_all('/ERROR/', $p
      ->getIncrementalErrorOutput(), $matches));
    usleep(20000);
  }
}