[Process] Make test AbstractProcessTest::testStartAfterATimeout useful again

This commit is contained in:
Daniel Beyer 2015-01-19 14:26:55 +01:00 committed by Fabien Potencier
parent b8e4b4af3d
commit 1be266fea0
1 changed files with 3 additions and 3 deletions

View File

@ -724,12 +724,12 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
public function testStartAfterATimeout()
{
$process = $this->getProcess('php -r "$n = 1000; while ($n--) {echo \'\'; usleep(1000); }"');
$process = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 1000; while ($n--) {echo \'\'; usleep(1000); }')));
$process->setTimeout(0.1);
try {
$process->run();
$this->fail('An exception should have been raised.');
} catch (\Exception $e) {
$this->fail('A RuntimeException should have been raised.');
} catch (RuntimeException $e) {
}
$process->start();
usleep(10000);