[Process] Use correct test for empty string in UnixPipes
This commit is contained in:
parent
ea45769aab
commit
9e1ea4aa4b
@ -313,11 +313,11 @@ class ProcessPipes
|
|||||||
$type = array_search($pipe, $this->pipes);
|
$type = array_search($pipe, $this->pipes);
|
||||||
|
|
||||||
$data = '';
|
$data = '';
|
||||||
while ($dataread = fread($pipe, self::CHUNK_SIZE)) {
|
while ('' !== $dataread = (string) fread($pipe, self::CHUNK_SIZE)) {
|
||||||
$data .= $dataread;
|
$data .= $dataread;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($data) {
|
if ('' !== $data) {
|
||||||
$read[$type] = $data;
|
$read[$type] = $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,6 +287,12 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testZeroAsOutput(){
|
||||||
|
$p = $this->getProcess('printf 0');
|
||||||
|
$p->run();
|
||||||
|
$this->assertSame('0', $p->getOutput());
|
||||||
|
}
|
||||||
|
|
||||||
public function testExitCodeCommandFailed()
|
public function testExitCodeCommandFailed()
|
||||||
{
|
{
|
||||||
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
|
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
|
||||||
|
Reference in New Issue
Block a user