Annotation of embedaddon/php/ext/bz2/tests/002.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: bzopen() using fd opened in wrong mode
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded("bz2")) print "skip"; ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: @unlink("bz_open_002.txt");
                      9: 
                     10: $fp = fopen("bz_open_002.txt", "w");
                     11: var_dump(bzopen($fp, "w"));
                     12: 
                     13: $fp = fopen("bz_open_002.txt", "r");
                     14: var_dump(bzopen($fp, "r"));
                     15: 
                     16: @unlink("bz_open_002.txt");
                     17: $fp = fopen("bz_open_002.txt", "x");
                     18: var_dump(bzopen($fp, "w"));
                     19: 
                     20: @unlink("bz_open_002.txt");
                     21: $fp = fopen("bz_open_002.txt", "x");
                     22: var_dump(bzopen($fp, "r"));
                     23: 
                     24: $fp = fopen("bz_open_002.txt", "rb");
                     25: var_dump(bzopen($fp, "r"));
                     26: 
                     27: $fp = fopen("bz_open_002.txt", "wb");
                     28: var_dump(bzopen($fp, "w"));
                     29: 
                     30: $fp = fopen("bz_open_002.txt", "br");
                     31: var_dump(bzopen($fp, "r"));
                     32: 
                     33: $fp = fopen("bz_open_002.txt", "br");
                     34: var_dump(bzopen($fp, "w"));
                     35: 
                     36: $fp = fopen("bz_open_002.txt", "r");
                     37: var_dump(bzopen($fp, "w"));
                     38: 
                     39: $fp = fopen("bz_open_002.txt", "w");
                     40: var_dump(bzopen($fp, "r"));
                     41: 
                     42: $fp = fopen("bz_open_002.txt", "rw");
                     43: var_dump(bzopen($fp, "w"));
                     44: 
                     45: $fp = fopen("bz_open_002.txt", "rw");
                     46: var_dump(bzopen($fp, "r"));
                     47: 
                     48: $fp = fopen("bz_open_002.txt", "wr");
                     49: var_dump(bzopen($fp, "w"));
                     50: 
                     51: $fp = fopen("bz_open_002.txt", "wr");
                     52: var_dump(bzopen($fp, "r"));
                     53: 
                     54: $fp = fopen("bz_open_002.txt", "r+");
                     55: var_dump(bzopen($fp, "r"));
                     56: 
                     57: $fp = fopen("bz_open_002.txt", "r+");
                     58: var_dump(bzopen($fp, "w"));
                     59: 
                     60: $fp = fopen("bz_open_002.txt", "w+");
                     61: var_dump(bzopen($fp, "r"));
                     62: 
                     63: $fp = fopen("bz_open_002.txt", "w+");
                     64: var_dump(bzopen($fp, "w"));
                     65: 
                     66: $fp = fopen("bz_open_002.txt", "a");
                     67: var_dump(bzopen($fp, "r"));
                     68: 
                     69: $fp = fopen("bz_open_002.txt", "a");
                     70: var_dump(bzopen($fp, "w"));
                     71: 
                     72: @unlink("bz_open_002.txt");
                     73: 
                     74: echo "Done\n";
                     75: ?>
                     76: --EXPECTF--    
                     77: resource(%d) of type (stream)
                     78: resource(%d) of type (stream)
                     79: resource(%d) of type (stream)
                     80: 
                     81: Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
                     82: bool(false)
                     83: resource(%d) of type (stream)
                     84: resource(%d) of type (stream)
                     85: 
                     86: Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d
                     87: 
                     88: Warning: bzopen(): first parameter has to be string or file-resource in %s on line %d
                     89: bool(false)
                     90: 
                     91: Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d
                     92: 
                     93: Warning: bzopen(): first parameter has to be string or file-resource in %s on line %d
                     94: bool(false)
                     95: 
                     96: Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d
                     97: bool(false)
                     98: 
                     99: Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
                    100: bool(false)
                    101: 
                    102: Warning: bzopen(): cannot use stream opened in mode 'rw' in %s on line %d
                    103: bool(false)
                    104: 
                    105: Warning: bzopen(): cannot use stream opened in mode 'rw' in %s on line %d
                    106: bool(false)
                    107: 
                    108: Warning: bzopen(): cannot use stream opened in mode 'wr' in %s on line %d
                    109: bool(false)
                    110: 
                    111: Warning: bzopen(): cannot use stream opened in mode 'wr' in %s on line %d
                    112: bool(false)
                    113: 
                    114: Warning: bzopen(): cannot use stream opened in mode 'r+' in %s on line %d
                    115: bool(false)
                    116: 
                    117: Warning: bzopen(): cannot use stream opened in mode 'r+' in %s on line %d
                    118: bool(false)
                    119: 
                    120: Warning: bzopen(): cannot use stream opened in mode 'w+' in %s on line %d
                    121: bool(false)
                    122: 
                    123: Warning: bzopen(): cannot use stream opened in mode 'w+' in %s on line %d
                    124: bool(false)
                    125: 
                    126: Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
                    127: bool(false)
                    128: resource(%d) of type (stream)
                    129: Done

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