File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Test xzopen() function : error conditions
3
+ --SKIPIF--
4
+ <?php
5
+ if (!extension_loaded ("xz " )) {
6
+ print "skip - XZ extension not loaded " ;
7
+ }
8
+ ?>
9
+ --FILE--
10
+ <?php
11
+ /* Prototype : resource xzopen(string filename, string mode)
12
+ * Description: Open a xz file and return a xz file pointer
13
+ * Source code: ext/xz/xz.c
14
+ * Alias to functions:
15
+ */
16
+
17
+ echo "*** Testing xzopen() : error conditions *** \n" ;
18
+
19
+
20
+ //Test gzopen with one more than the expected number of arguments
21
+ echo "\n-- Testing xzopen() function with invalid mode -- \n" ;
22
+ $ filename = 'string_val ' ;
23
+ $ mode = 'a ' ;
24
+ var_dump ( xzopen ($ filename , $ mode ) );
25
+
26
+ ?>
27
+ ===DONE===
28
+ --EXPECTF--
29
+ *** Testing xzopen() : error conditions ***
30
+
31
+ -- Testing xzopen() function with invalid mode --
32
+
33
+ Warning: xzopen(): Can only open in read (r) or write (w) mode.
34
+ bool(false)
35
+ ===DONE===
You can’t perform that action at this time.
0 commit comments