Annotation of embedaddon/php/ext/zlib/tests/gzfile_variation10.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
1.1.1.2 ! misho 2: Test function gzfile() by substituting argument 2 with emptyUnsetUndefNull values.
1.1 misho 3: --SKIPIF--
4: <?php
5: if (!extension_loaded('zlib')) die ('skip zlib extension not available in this build');
6: ?>
7: --FILE--
8: <?php
9:
10:
11: $filename = dirname(__FILE__)."/004.txt.gz";
12:
13:
14: $unset_var = 10;
15: unset($unset_var);
16:
17: $variation = array(
18: 'unset var' => @$unset_var,
19: 'undefined var' => @$undefined_var,
20: 'empty string DQ' => "",
21: 'empty string SQ' => '',
22: 'uppercase NULL' => NULL,
23: 'lowercase null' => null,
24: );
25:
26:
27: foreach ( $variation as $var ) {
28: var_dump(gzfile( $filename, $var ) );
29: }
30: ?>
31: ===DONE===
32: --EXPECTF--
33: array(6) {
34: [0]=>
35: string(36) "When you're taught through feelings
36: "
37: [1]=>
38: string(26) "Destiny flying high above
39: "
40: [2]=>
41: string(38) "all I know is that you can realize it
42: "
43: [3]=>
44: string(18) "Destiny who cares
45: "
46: [4]=>
47: string(19) "as it turns around
48: "
49: [5]=>
50: string(39) "and I know that it descends down on me
51: "
52: }
53: array(6) {
54: [0]=>
55: string(36) "When you're taught through feelings
56: "
57: [1]=>
58: string(26) "Destiny flying high above
59: "
60: [2]=>
61: string(38) "all I know is that you can realize it
62: "
63: [3]=>
64: string(18) "Destiny who cares
65: "
66: [4]=>
67: string(19) "as it turns around
68: "
69: [5]=>
70: string(39) "and I know that it descends down on me
71: "
72: }
73:
74: Warning: gzfile() expects parameter 2 to be long, string given in %s on line %d
75: NULL
76:
77: Warning: gzfile() expects parameter 2 to be long, string given in %s on line %d
78: NULL
79: array(6) {
80: [0]=>
81: string(36) "When you're taught through feelings
82: "
83: [1]=>
84: string(26) "Destiny flying high above
85: "
86: [2]=>
87: string(38) "all I know is that you can realize it
88: "
89: [3]=>
90: string(18) "Destiny who cares
91: "
92: [4]=>
93: string(19) "as it turns around
94: "
95: [5]=>
96: string(39) "and I know that it descends down on me
97: "
98: }
99: array(6) {
100: [0]=>
101: string(36) "When you're taught through feelings
102: "
103: [1]=>
104: string(26) "Destiny flying high above
105: "
106: [2]=>
107: string(38) "all I know is that you can realize it
108: "
109: [3]=>
110: string(18) "Destiny who cares
111: "
112: [4]=>
113: string(19) "as it turns around
114: "
115: [5]=>
116: string(39) "and I know that it descends down on me
117: "
118: }
119: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>