[Process] Adjust PR #11264, make it Windows compatible and fix CS

This commit is contained in:
Romain Neutron 2014-07-12 16:27:05 +02:00
parent 9e1ea4aa4b
commit cec0a45ff5
1 changed files with 9 additions and 2 deletions

View File

@ -287,8 +287,15 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
}
}
public function testZeroAsOutput(){
$p = $this->getProcess('printf 0');
public function testZeroAsOutput()
{
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
// see http://stackoverflow.com/questions/7105433/windows-batch-echo-without-new-line
$p = $this->getProcess('echo | set /p dummyName=0');
} else {
$p = $this->getProcess('printf 0');
}
$p->run();
$this->assertSame('0', $p->getOutput());
}