Skip to content

Commit 7a955c0

Browse files
committed
[Process][Tests] Prove process fail (Add more test case)
1 parent 598dcf3 commit 7a955c0

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,27 @@ public function testProcessPipes($expected, $code)
7676
$this->assertSame($expected, $p->getErrorOutput());
7777
}
7878

79-
public function testProcessOutput()
79+
public function chainedCommandsOutputProvider()
80+
{
81+
return array(
82+
array('11', ';', '1'),
83+
array('22', '&&', '2'),
84+
);
85+
}
86+
87+
/**
88+
*
89+
* @dataProvider chainedCommandsOutputProvider
90+
*/
91+
public function testChainedCommandsOutput($expected, $operator, $input)
8092
{
8193
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
8294
$this->markTestSkipped('Does it work on windows ?');
8395
}
8496

85-
$process = $this->getProcess("echo -n 1 ; echo -n 1");
97+
$process = $this->getProcess(sprintf('echo -n %s %s echo -n %s', $input, $operator, $input));
8698
$process->run();
87-
$this->assertEquals('11', $process->getOutput());
99+
$this->assertEquals($expected, $process->getOutput());
88100
}
89101

90102
public function testCallbackIsExecutedForOutput()

0 commit comments

Comments
 (0)