xref: /PHP-7.1/ext/bz2/tests/001.phpt (revision 7af945e2)
1--TEST--
2bzopen() and invalid parameters
3--SKIPIF--
4<?php if (!extension_loaded("bz2")) print "skip"; ?>
5--FILE--
6<?php
7
8var_dump(bzopen());
9var_dump(bzopen("", ""));
10var_dump(bzopen("", "r"));
11var_dump(bzopen("", "w"));
12var_dump(bzopen("", "x"));
13var_dump(bzopen("", "rw"));
14var_dump(bzopen("no_such_file", "r"));
15
16$fp = fopen(__FILE__,"r");
17var_dump(bzopen($fp, "r"));
18
19echo "Done\n";
20?>
21--EXPECTF--
22Warning: bzopen() expects exactly 2 parameters, 0 given in %s on line %d
23NULL
24
25Warning: bzopen(): '' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
26bool(false)
27
28Warning: bzopen(): filename cannot be empty in %s on line %d
29bool(false)
30
31Warning: bzopen(): filename cannot be empty in %s on line %d
32bool(false)
33
34Warning: bzopen(): 'x' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
35bool(false)
36
37Warning: bzopen(): 'rw' is not a valid mode for bzopen(). Only 'w' and 'r' are supported. in %s on line %d
38bool(false)
39
40Warning: bzopen(no_such_file): failed to open stream: No such file or directory in %s on line %d
41bool(false)
42resource(%d) of type (stream)
43Done
44