Annotation of embedaddon/php/ext/standard/tests/file/fwrite.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: fwrite() tests
        !             3: --FILE--
        !             4: <?php
        !             5: 
        !             6: $filename = dirname(__FILE__)."/fwrite.dat";
        !             7: 
        !             8: $fp = fopen($filename, "w");
        !             9: var_dump(fwrite($fp));
        !            10: var_dump(fwrite($fp, array()));
        !            11: fclose($fp);
        !            12: 
        !            13: $fp = fopen($filename, "r");
        !            14: var_dump(fwrite($fp, "data"));
        !            15: 
        !            16: $fp = fopen($filename, "w");
        !            17: var_dump(fwrite($fp, "data", -1));
        !            18: var_dump(fwrite($fp, "data", 100000));
        !            19: fclose($fp);
        !            20: 
        !            21: var_dump(fwrite($fp, "data", -1));
        !            22: 
        !            23: var_dump(fwrite(array(), "data", -1));
        !            24: var_dump(fwrite(array(), "data"));
        !            25: var_dump(fwrite(array()));
        !            26: 
        !            27: var_dump(file_get_contents($filename));
        !            28: 
        !            29: @unlink($filename);
        !            30: echo "Done\n";
        !            31: ?>
        !            32: --EXPECTF--    
        !            33: Warning: fwrite() expects at least 2 parameters, 1 given in %s on line %d
        !            34: bool(false)
        !            35: 
        !            36: Warning: fwrite() expects parameter 2 to be string, array given in %s on line %d
        !            37: bool(false)
        !            38: int(0)
        !            39: int(0)
        !            40: int(4)
        !            41: int(0)
        !            42: 
        !            43: Warning: fwrite() expects parameter 1 to be resource, array given in %s on line %d
        !            44: bool(false)
        !            45: 
        !            46: Warning: fwrite() expects parameter 1 to be resource, array given in %s on line %d
        !            47: bool(false)
        !            48: 
        !            49: Warning: fwrite() expects at least 2 parameters, 1 given in %s on line %d
        !            50: bool(false)
        !            51: string(4) "data"
        !            52: Done

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