Annotation of embedaddon/php/ext/standard/tests/general_functions/bug44667.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #44667 (proc_open() does not handle pipes with the mode 'wb' correctly)
        !             3: --SKIPIF--
        !             4: <?php if (!is_executable('/bin/cat')) echo 'skip cat not found'; ?>
        !             5: --FILE--
        !             6: <?php
        !             7: 
        !             8: $pipes = array();
        !             9: 
        !            10: $descriptor_spec = array(
        !            11:        0 => array('pipe', 'rb'),
        !            12:        1 => array('pipe', 'wb'),
        !            13: );
        !            14:         
        !            15: $proc = proc_open('cat', $descriptor_spec, $pipes);
        !            16:         
        !            17: fwrite($pipes[0], 'Hello', 5);
        !            18: fflush($pipes[0]);
        !            19: fclose($pipes[0]);
        !            20:         
        !            21: $result = fread($pipes[1], 5);
        !            22: fclose($pipes[1]);
        !            23:         
        !            24: proc_close($proc);
        !            25:         
        !            26: echo "Result is: ", $result, "\n";        
        !            27: 
        !            28: echo "Done\n";
        !            29: 
        !            30: ?>
        !            31: --EXPECTF--
        !            32: Result is: Hello
        !            33: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>