Skip to content

Commit 2c55a2d

Browse files
committed
minor symfony#10421 [Process] Fix some unit tests that create the process object instead of delegate it to the implementation (romainneutron)
This PR was merged into the 2.3 branch. Discussion ---------- [Process] Fix some unit tests that create the process object instead of delegate it to the implementation | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT This is a minor error ; creating the process must be delegated to the implementation Commits ------- 227b85b [Process] Fix some unit tests that create the process object instead of delegate it to the implementation
2 parents 53a0403 + 227b85b commit 2c55a2d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/Process/Tests/AbstractProcessTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,15 +166,15 @@ public function testCallbackIsExecutedForOutput()
166166

167167
public function testGetErrorOutput()
168168
{
169-
$p = new Process(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }')));
169+
$p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }')));
170170

171171
$p->run();
172172
$this->assertEquals(3, preg_match_all('/ERROR/', $p->getErrorOutput(), $matches));
173173
}
174174

175175
public function testGetIncrementalErrorOutput()
176176
{
177-
$p = new Process(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { usleep(50000); file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }')));
177+
$p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { usleep(50000); file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }')));
178178

179179
$p->start();
180180
while ($p->isRunning()) {
@@ -185,15 +185,15 @@ public function testGetIncrementalErrorOutput()
185185

186186
public function testGetOutput()
187187
{
188-
$p = new Process(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) {echo \' foo \';$n++; usleep(500); }')));
188+
$p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) {echo \' foo \';$n++; usleep(500); }')));
189189

190190
$p->run();
191191
$this->assertEquals(3, preg_match_all('/foo/', $p->getOutput(), $matches));
192192
}
193193

194194
public function testGetIncrementalOutput()
195195
{
196-
$p = new Process(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) { echo \' foo \'; usleep(50000); $n++; }')));
196+
$p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n=0;while ($n<3) { echo \' foo \'; usleep(50000); $n++; }')));
197197

198198
$p->start();
199199
while ($p->isRunning()) {

0 commit comments

Comments
 (0)