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