From 227b85bc27ee51a3a489e13804dae07477965c30 Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Tue, 11 Mar 2014 18:32:12 +0100 Subject: [PATCH] [Process] Fix some unit tests that create the process object instead of delegate it to the implementation --- .../Component/Process/Tests/AbstractProcessTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Process/Tests/AbstractProcessTest.php b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php index 1baf15f3d659..b5b34b2197ac 100644 --- a/src/Symfony/Component/Process/Tests/AbstractProcessTest.php +++ b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php @@ -166,7 +166,7 @@ public function testCallbackIsExecutedForOutput() public function testGetErrorOutput() { - $p = new Process(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); + $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); $p->run(); $this->assertEquals(3, preg_match_all('/ERROR/', $p->getErrorOutput(), $matches)); @@ -174,7 +174,7 @@ public function testGetErrorOutput() 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 = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { usleep(50000); file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }'))); $p->start(); while ($p->isRunning()) { @@ -185,7 +185,7 @@ public function testGetIncrementalErrorOutput() public function testGetOutput() { - $p = new Process(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) {echo \' foo \';$n++; usleep(500); }'))); + $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) {echo \' foo \';$n++; usleep(500); }'))); $p->run(); $this->assertEquals(3, preg_match_all('/foo/', $p->getOutput(), $matches)); @@ -193,7 +193,7 @@ public function testGetOutput() public function testGetIncrementalOutput() { - $p = new Process(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) { echo \' foo \'; usleep(50000); $n++; }'))); + $p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) { echo \' foo \'; usleep(50000); $n++; }'))); $p->start(); while ($p->isRunning()) {