From fc4a0d3886c6e47472142be9740a745cc1c2046d Mon Sep 17 00:00:00 2001 From: Dave Kelsey Date: Mon, 19 Jan 2009 14:03:19 +0000 Subject: [PATCH] new tests for zlib extension, tested on windows, linux and linux64 --- ext/zlib/tests/gzclose_basic.phpt | 39 +++ ext/zlib/tests/gzclose_error.phpt | 33 +++ ext/zlib/tests/gzeof_basic.phpt | 58 +++++ ext/zlib/tests/gzeof_error.phpt | 28 +++ ext/zlib/tests/gzeof_variation1.phpt | 31 +++ ext/zlib/tests/gzfile_basic.phpt | 39 +++ ext/zlib/tests/gzfile_basic2.phpt | 39 +++ ext/zlib/tests/gzfile_error.phpt | 29 +++ ext/zlib/tests/gzfile_variation1.phpt | 43 ++++ ext/zlib/tests/gzfile_variation10.phpt | 119 +++++++++ ext/zlib/tests/gzfile_variation11.phpt | 129 ++++++++++ ext/zlib/tests/gzfile_variation12.phpt | 108 +++++++++ ext/zlib/tests/gzfile_variation13.phpt | 51 ++++ ext/zlib/tests/gzfile_variation14.phpt | 44 ++++ ext/zlib/tests/gzfile_variation15.phpt | 109 +++++++++ ext/zlib/tests/gzfile_variation2.phpt | 40 +++ ext/zlib/tests/gzfile_variation3.phpt | 50 ++++ ext/zlib/tests/gzfile_variation4.phpt | 43 ++++ ext/zlib/tests/gzfile_variation5.phpt | 39 +++ ext/zlib/tests/gzfile_variation6.phpt | 49 ++++ ext/zlib/tests/gzfile_variation7.phpt | 44 ++++ ext/zlib/tests/gzfile_variation8.phpt | 43 ++++ ext/zlib/tests/gzfile_variation9.phpt | 107 +++++++++ ext/zlib/tests/gzgetc_basic.phpt | 38 +++ ext/zlib/tests/gzgetc_error.phpt | 29 +++ ext/zlib/tests/gzgets_basic.phpt | 46 ++++ ext/zlib/tests/gzgets_error.phpt | 30 +++ ext/zlib/tests/gzopen_basic.phpt | 51 ++++ ext/zlib/tests/gzopen_basic2.phpt | 52 ++++ ext/zlib/tests/gzopen_error.phpt | 47 ++++ ext/zlib/tests/gzopen_include_path.inc | 92 +++++++ ext/zlib/tests/gzopen_variation1.phpt | 227 ++++++++++++++++++ ext/zlib/tests/gzopen_variation2.phpt | 227 ++++++++++++++++++ ext/zlib/tests/gzopen_variation3.phpt | 218 +++++++++++++++++ ext/zlib/tests/gzopen_variation4.phpt | 191 +++++++++++++++ ext/zlib/tests/gzopen_variation5.phpt | 71 ++++++ ext/zlib/tests/gzopen_variation6.phpt | 47 ++++ ext/zlib/tests/gzopen_variation7.phpt | 31 +++ ext/zlib/tests/gzpassthru_basic.phpt | 32 +++ ext/zlib/tests/gzpassthru_error.phpt | 29 +++ ext/zlib/tests/gzputs_basic.phpt | 31 +++ ext/zlib/tests/gzread_basic.phpt | 37 +++ ext/zlib/tests/gzread_error.phpt | 32 +++ ext/zlib/tests/gzread_error2.phpt | 32 +++ ext/zlib/tests/gzread_variation1.phpt | 34 +++ ext/zlib/tests/gzrewind_basic.phpt | 36 +++ ext/zlib/tests/gzrewind_basic2.phpt | 34 +++ ext/zlib/tests/gzrewind_error.phpt | 27 +++ ext/zlib/tests/gzrewind_variation1.phpt | 28 +++ ext/zlib/tests/gzseek_basic.phpt | 49 ++++ ext/zlib/tests/gzseek_basic2.phpt | 42 ++++ ext/zlib/tests/gzseek_error.phpt | 33 +++ ext/zlib/tests/gzseek_variation1.phpt | 33 +++ ext/zlib/tests/gzseek_variation2.phpt | 49 ++++ ext/zlib/tests/gzseek_variation3.phpt | 50 ++++ ext/zlib/tests/gzseek_variation4.phpt | 42 ++++ ext/zlib/tests/gzseek_variation5.phpt | 42 ++++ ext/zlib/tests/gztell_basic.phpt | 34 +++ ext/zlib/tests/gztell_basic2.phpt | 42 ++++ ext/zlib/tests/gztell_error.phpt | 26 ++ ext/zlib/tests/gzwrite_basic.phpt | 31 +++ ext/zlib/tests/gzwrite_error.phpt | 35 +++ ext/zlib/tests/gzwrite_error2.phpt | 30 +++ ext/zlib/tests/gzwrite_variation1.phpt | 27 +++ ext/zlib/tests/readgzfile_basic.phpt | 34 +++ ext/zlib/tests/readgzfile_basic2.phpt | 34 +++ ext/zlib/tests/readgzfile_error.phpt | 29 +++ ext/zlib/tests/readgzfile_variation1.phpt | 43 ++++ ext/zlib/tests/readgzfile_variation10.phpt | 67 ++++++ ext/zlib/tests/readgzfile_variation11.phpt | 64 +++++ ext/zlib/tests/readgzfile_variation12.phpt | 56 +++++ ext/zlib/tests/readgzfile_variation13.phpt | 51 ++++ ext/zlib/tests/readgzfile_variation14.phpt | 44 ++++ ext/zlib/tests/readgzfile_variation15.phpt | 94 ++++++++ ext/zlib/tests/readgzfile_variation2.phpt | 40 +++ ext/zlib/tests/readgzfile_variation3.phpt | 50 ++++ ext/zlib/tests/readgzfile_variation4.phpt | 43 ++++ ext/zlib/tests/readgzfile_variation5.phpt | 39 +++ ext/zlib/tests/readgzfile_variation6.phpt | 49 ++++ ext/zlib/tests/readgzfile_variation7.phpt | 43 ++++ ext/zlib/tests/readgzfile_variation8.phpt | 43 ++++ ext/zlib/tests/readgzfile_variation9.phpt | 55 +++++ ext/zlib/tests/reading_include_path.inc | 27 +++ ext/zlib/tests/zlib_wrapper_fflush_basic.phpt | 33 +++ ext/zlib/tests/zlib_wrapper_flock_basic.phpt | 19 ++ .../tests/zlib_wrapper_ftruncate_basic.phpt | 32 +++ .../tests/zlib_wrapper_meta_data_basic.phpt | 69 ++++++ 87 files changed, 4686 insertions(+) create mode 100644 ext/zlib/tests/gzclose_basic.phpt create mode 100644 ext/zlib/tests/gzclose_error.phpt create mode 100644 ext/zlib/tests/gzeof_basic.phpt create mode 100644 ext/zlib/tests/gzeof_error.phpt create mode 100644 ext/zlib/tests/gzeof_variation1.phpt create mode 100644 ext/zlib/tests/gzfile_basic.phpt create mode 100644 ext/zlib/tests/gzfile_basic2.phpt create mode 100644 ext/zlib/tests/gzfile_error.phpt create mode 100644 ext/zlib/tests/gzfile_variation1.phpt create mode 100644 ext/zlib/tests/gzfile_variation10.phpt create mode 100644 ext/zlib/tests/gzfile_variation11.phpt create mode 100644 ext/zlib/tests/gzfile_variation12.phpt create mode 100644 ext/zlib/tests/gzfile_variation13.phpt create mode 100644 ext/zlib/tests/gzfile_variation14.phpt create mode 100644 ext/zlib/tests/gzfile_variation15.phpt create mode 100644 ext/zlib/tests/gzfile_variation2.phpt create mode 100644 ext/zlib/tests/gzfile_variation3.phpt create mode 100644 ext/zlib/tests/gzfile_variation4.phpt create mode 100644 ext/zlib/tests/gzfile_variation5.phpt create mode 100644 ext/zlib/tests/gzfile_variation6.phpt create mode 100644 ext/zlib/tests/gzfile_variation7.phpt create mode 100644 ext/zlib/tests/gzfile_variation8.phpt create mode 100644 ext/zlib/tests/gzfile_variation9.phpt create mode 100644 ext/zlib/tests/gzgetc_basic.phpt create mode 100644 ext/zlib/tests/gzgetc_error.phpt create mode 100644 ext/zlib/tests/gzgets_basic.phpt create mode 100644 ext/zlib/tests/gzgets_error.phpt create mode 100644 ext/zlib/tests/gzopen_basic.phpt create mode 100644 ext/zlib/tests/gzopen_basic2.phpt create mode 100644 ext/zlib/tests/gzopen_error.phpt create mode 100644 ext/zlib/tests/gzopen_include_path.inc create mode 100644 ext/zlib/tests/gzopen_variation1.phpt create mode 100644 ext/zlib/tests/gzopen_variation2.phpt create mode 100644 ext/zlib/tests/gzopen_variation3.phpt create mode 100644 ext/zlib/tests/gzopen_variation4.phpt create mode 100644 ext/zlib/tests/gzopen_variation5.phpt create mode 100644 ext/zlib/tests/gzopen_variation6.phpt create mode 100644 ext/zlib/tests/gzopen_variation7.phpt create mode 100644 ext/zlib/tests/gzpassthru_basic.phpt create mode 100644 ext/zlib/tests/gzpassthru_error.phpt create mode 100644 ext/zlib/tests/gzputs_basic.phpt create mode 100644 ext/zlib/tests/gzread_basic.phpt create mode 100644 ext/zlib/tests/gzread_error.phpt create mode 100644 ext/zlib/tests/gzread_error2.phpt create mode 100644 ext/zlib/tests/gzread_variation1.phpt create mode 100644 ext/zlib/tests/gzrewind_basic.phpt create mode 100644 ext/zlib/tests/gzrewind_basic2.phpt create mode 100644 ext/zlib/tests/gzrewind_error.phpt create mode 100644 ext/zlib/tests/gzrewind_variation1.phpt create mode 100644 ext/zlib/tests/gzseek_basic.phpt create mode 100644 ext/zlib/tests/gzseek_basic2.phpt create mode 100644 ext/zlib/tests/gzseek_error.phpt create mode 100644 ext/zlib/tests/gzseek_variation1.phpt create mode 100644 ext/zlib/tests/gzseek_variation2.phpt create mode 100644 ext/zlib/tests/gzseek_variation3.phpt create mode 100644 ext/zlib/tests/gzseek_variation4.phpt create mode 100644 ext/zlib/tests/gzseek_variation5.phpt create mode 100644 ext/zlib/tests/gztell_basic.phpt create mode 100644 ext/zlib/tests/gztell_basic2.phpt create mode 100644 ext/zlib/tests/gztell_error.phpt create mode 100644 ext/zlib/tests/gzwrite_basic.phpt create mode 100644 ext/zlib/tests/gzwrite_error.phpt create mode 100644 ext/zlib/tests/gzwrite_error2.phpt create mode 100644 ext/zlib/tests/gzwrite_variation1.phpt create mode 100644 ext/zlib/tests/readgzfile_basic.phpt create mode 100644 ext/zlib/tests/readgzfile_basic2.phpt create mode 100644 ext/zlib/tests/readgzfile_error.phpt create mode 100644 ext/zlib/tests/readgzfile_variation1.phpt create mode 100644 ext/zlib/tests/readgzfile_variation10.phpt create mode 100644 ext/zlib/tests/readgzfile_variation11.phpt create mode 100644 ext/zlib/tests/readgzfile_variation12.phpt create mode 100644 ext/zlib/tests/readgzfile_variation13.phpt create mode 100644 ext/zlib/tests/readgzfile_variation14.phpt create mode 100644 ext/zlib/tests/readgzfile_variation15.phpt create mode 100644 ext/zlib/tests/readgzfile_variation2.phpt create mode 100644 ext/zlib/tests/readgzfile_variation3.phpt create mode 100644 ext/zlib/tests/readgzfile_variation4.phpt create mode 100644 ext/zlib/tests/readgzfile_variation5.phpt create mode 100644 ext/zlib/tests/readgzfile_variation6.phpt create mode 100644 ext/zlib/tests/readgzfile_variation7.phpt create mode 100644 ext/zlib/tests/readgzfile_variation8.phpt create mode 100644 ext/zlib/tests/readgzfile_variation9.phpt create mode 100644 ext/zlib/tests/reading_include_path.inc create mode 100644 ext/zlib/tests/zlib_wrapper_fflush_basic.phpt create mode 100644 ext/zlib/tests/zlib_wrapper_flock_basic.phpt create mode 100644 ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt create mode 100644 ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt diff --git a/ext/zlib/tests/gzclose_basic.phpt b/ext/zlib/tests/gzclose_basic.phpt new file mode 100644 index 0000000000..d61855bf9f --- /dev/null +++ b/ext/zlib/tests/gzclose_basic.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test function gzclose() by calling it with its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +bool(true) + +Warning: gzread(): %d is not a valid stream resource in %s on line %d +bool(true) + +Warning: gzread(): %d is not a valid stream resource in %s on line %d +===DONE=== diff --git a/ext/zlib/tests/gzclose_error.phpt b/ext/zlib/tests/gzclose_error.phpt new file mode 100644 index 0000000000..f027eef852 --- /dev/null +++ b/ext/zlib/tests/gzclose_error.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test function gzclose() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: gzclose() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: gzclose() expects exactly 1 parameter, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzeof_basic.phpt b/ext/zlib/tests/gzeof_basic.phpt new file mode 100644 index 0000000000..f5d2617a9f --- /dev/null +++ b/ext/zlib/tests/gzeof_basic.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test function feof() by calling it with its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +-- test 1 -- +bool(false) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +bool(true) + +-- test 2 -- +reading 50 characters. eof should be false +bool(false) +reading 250 characters. eof should be true +bool(true) +reading 20 characters. eof should be true still +bool(true) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzeof_error.phpt b/ext/zlib/tests/gzeof_error.phpt new file mode 100644 index 0000000000..43c07e7803 --- /dev/null +++ b/ext/zlib/tests/gzeof_error.phpt @@ -0,0 +1,28 @@ +--TEST-- +Test function gzeof() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: gzeof() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: gzeof() expects exactly 1 parameter, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzeof_variation1.phpt b/ext/zlib/tests/gzeof_variation1.phpt new file mode 100644 index 0000000000..39c5e83939 --- /dev/null +++ b/ext/zlib/tests/gzeof_variation1.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test function gzeof while writing. +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +bool(false) +bool(false) + +Warning: gzeof(): %d is not a valid stream resource in %s on line %d +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_basic.phpt b/ext/zlib/tests/gzfile_basic.phpt new file mode 100644 index 0000000000..1fceea5b90 --- /dev/null +++ b/ext/zlib/tests/gzfile_basic.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test function gzfile() reading a gzip relative file +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +array(3) { + [0]=> + string(12) "hello world +" + [1]=> + string(22) "is a very common test +" + [2]=> + string(17) "for all languages" +} +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_basic2.phpt b/ext/zlib/tests/gzfile_basic2.phpt new file mode 100644 index 0000000000..9f31eb0f87 --- /dev/null +++ b/ext/zlib/tests/gzfile_basic2.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test function gzfile() reading a plain relative file +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +array(3) { + [0]=> + string(12) "hello world +" + [1]=> + string(22) "is a very common test +" + [2]=> + string(17) "for all languages" +} +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_error.phpt b/ext/zlib/tests/gzfile_error.phpt new file mode 100644 index 0000000000..6089f3ebfa --- /dev/null +++ b/ext/zlib/tests/gzfile_error.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test function gzfile() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: gzfile() expects at most 2 parameters, 3 given in %s on line %d +NULL + +Warning: gzfile() expects at least 1 parameter, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation1.phpt b/ext/zlib/tests/gzfile_variation1.phpt new file mode 100644 index 0000000000..beaa02381e --- /dev/null +++ b/ext/zlib/tests/gzfile_variation1.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test function gzfile() by substituting agument 1 with array values. +--SKIPIF-- + +--FILE-- + 'one', 2 => 'two'); + +$variation = array( + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- + +Warning: gzfile() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL + +Warning: gzfile() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL + +Warning: gzfile() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL + +Warning: gzfile() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation10.phpt b/ext/zlib/tests/gzfile_variation10.phpt new file mode 100644 index 0000000000..ed85dfd6eb --- /dev/null +++ b/ext/zlib/tests/gzfile_variation10.phpt @@ -0,0 +1,119 @@ +--TEST-- +Test function gzfile() by substituting agument 2 with emptyUnsetUndefNull values. +--SKIPIF-- + +--FILE-- + @$unset_var, + 'undefined var' => @$undefined_var, + 'empty string DQ' => "", + 'empty string SQ' => '', + 'uppercase NULL' => NULL, + 'lowercase null' => null, + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECTF-- +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} + +Warning: gzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +Warning: gzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation11.phpt b/ext/zlib/tests/gzfile_variation11.phpt new file mode 100644 index 0000000000..02faa4501f --- /dev/null +++ b/ext/zlib/tests/gzfile_variation11.phpt @@ -0,0 +1,129 @@ +--TEST-- +Test function gzfile() by substituting agument 2 with float values. +--SKIPIF-- + +--FILE-- + 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECT-- +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation12.phpt b/ext/zlib/tests/gzfile_variation12.phpt new file mode 100644 index 0000000000..a8efc7616c --- /dev/null +++ b/ext/zlib/tests/gzfile_variation12.phpt @@ -0,0 +1,108 @@ +--TEST-- +Test function gzfile() by substituting agument 2 with int values. +--SKIPIF-- + +--FILE-- + 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECT-- +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation13.phpt b/ext/zlib/tests/gzfile_variation13.phpt new file mode 100644 index 0000000000..8014d7d9d9 --- /dev/null +++ b/ext/zlib/tests/gzfile_variation13.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test function gzfile() by substituting agument 2 with object values. +--SKIPIF-- + +--FILE-- + new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECTF-- +Error: 2 - gzfile() expects parameter 2 to be long, object given, %s(%d) +NULL +Error: 2 - gzfile() expects parameter 2 to be long, object given, %s(%d) +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation14.phpt b/ext/zlib/tests/gzfile_variation14.phpt new file mode 100644 index 0000000000..f7b4c1c168 --- /dev/null +++ b/ext/zlib/tests/gzfile_variation14.phpt @@ -0,0 +1,44 @@ +--TEST-- +Test function gzfile() by substituting agument 2 with string values. +--SKIPIF-- + +--FILE-- + "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc + ); + + +foreach ( $variation_array as $var ) { + var_dump(gzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECTF-- + +Warning: gzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +Warning: gzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +Warning: gzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +Warning: gzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation15.phpt b/ext/zlib/tests/gzfile_variation15.phpt new file mode 100644 index 0000000000..9b610f9891 --- /dev/null +++ b/ext/zlib/tests/gzfile_variation15.phpt @@ -0,0 +1,109 @@ +--TEST-- +Test gzfile() function : variation: use include path (relative directories in path) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +array(1) { + [0]=> + string(22) "This is a file in dir2" +} + +array(1) { + [0]=> + string(22) "This is a file in dir1" +} + +array(1) { + [0]=> + string(22) "This is a file in dir1" +} + +array(1) { + [0]=> + string(29) "This is a file in working dir" +} + +array(1) { + [0]=> + string(28) "This is a file in script dir" +} + +===DONE=== + diff --git a/ext/zlib/tests/gzfile_variation2.phpt b/ext/zlib/tests/gzfile_variation2.phpt new file mode 100644 index 0000000000..2f75c7f81a --- /dev/null +++ b/ext/zlib/tests/gzfile_variation2.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test function gzfile() by substituting agument 1 with boolean values. +--SKIPIF-- + +--FILE-- + true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- + +Warning: gzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: gzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: gzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: gzfile() expects parameter 2 to be long, array given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation3.phpt b/ext/zlib/tests/gzfile_variation3.phpt new file mode 100644 index 0000000000..8a6f2cec2c --- /dev/null +++ b/ext/zlib/tests/gzfile_variation3.phpt @@ -0,0 +1,50 @@ +--TEST-- +Test function gzfile() by substituting agument 1 with emptyUnsetUndefNull values. +--SKIPIF-- + +--FILE-- + @$unset_var, + 'undefined var' => @$undefined_var, + 'empty string DQ' => "", + 'empty string SQ' => '', + 'uppercase NULL' => NULL, + 'lowercase null' => null, + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- +Warning: gzfile(): Filename cannot be empty in %s on line %d +bool(false) + +Warning: gzfile(): Filename cannot be empty in %s on line %d +bool(false) + +Warning: gzfile(): Filename cannot be empty in %s on line %d +bool(false) + +Warning: gzfile(): Filename cannot be empty in %s on line %d +bool(false) + +Warning: gzfile(): Filename cannot be empty in %s on line %d +bool(false) + +Warning: gzfile(): Filename cannot be empty in %s on line %d +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation4.phpt b/ext/zlib/tests/gzfile_variation4.phpt new file mode 100644 index 0000000000..b3c8ac483c --- /dev/null +++ b/ext/zlib/tests/gzfile_variation4.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test function gzfile() by substituting agument 1 with float values. +--SKIPIF-- + +--FILE-- + 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- +Warning: gzfile(10.5): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile(-10.5): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile(123456789000): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile(-123456789000): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile(0.5): failed to open stream: No such file or directory in %s on line %d +bool(false) +===DONE=== diff --git a/ext/zlib/tests/gzfile_variation5.phpt b/ext/zlib/tests/gzfile_variation5.phpt new file mode 100644 index 0000000000..5e210b653f --- /dev/null +++ b/ext/zlib/tests/gzfile_variation5.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test function gzfile() by substituting agument 1 with int values. +--SKIPIF-- + +--FILE-- + 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- +Warning: gzfile(0): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile(1): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile(12345): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile(-2345): failed to open stream: No such file or directory in %s on line %d +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation6.phpt b/ext/zlib/tests/gzfile_variation6.phpt new file mode 100644 index 0000000000..cabaccf9d2 --- /dev/null +++ b/ext/zlib/tests/gzfile_variation6.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test function gzfile() by substituting agument 1 with object values. +--SKIPIF-- + +--FILE-- + new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $var , $use_include_path ) ); +} +?> +--EXPECTF-- +Error: 2 - gzfile(Class A object): failed to open stream: No such file or directory, %s(%d) +bool(false) +Error: 2 - gzfile() expects parameter 1 to be string (Unicode or binary), object given, %s(%d) +NULL \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation7.phpt b/ext/zlib/tests/gzfile_variation7.phpt new file mode 100644 index 0000000000..b441dd670e --- /dev/null +++ b/ext/zlib/tests/gzfile_variation7.phpt @@ -0,0 +1,44 @@ +--TEST-- +Test function gzfile() by substituting agument 1 with string values. +--SKIPIF-- + +--FILE-- + "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc + ); + + +foreach ( $variation_array as $var ) { + var_dump(gzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- + +Warning: gzfile(string): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile(string): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile(sTrInG): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: gzfile(hello world): failed to open stream: No such file or directory in %s on line %d +bool(false) +===DONE=== diff --git a/ext/zlib/tests/gzfile_variation8.phpt b/ext/zlib/tests/gzfile_variation8.phpt new file mode 100644 index 0000000000..32d969326c --- /dev/null +++ b/ext/zlib/tests/gzfile_variation8.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test function gzfile() by substituting agument 2 with array values. +--SKIPIF-- + +--FILE-- + 'one', 2 => 'two'); + +$variation = array( + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECTF-- + +Warning: gzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: gzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: gzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: gzfile() expects parameter 2 to be long, array given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzfile_variation9.phpt b/ext/zlib/tests/gzfile_variation9.phpt new file mode 100644 index 0000000000..c2c24ae26c --- /dev/null +++ b/ext/zlib/tests/gzfile_variation9.phpt @@ -0,0 +1,107 @@ +--TEST-- +Test function gzfile() by substituting agument 2 with boolean values. +--SKIPIF-- + +--FILE-- + true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + ); + + +foreach ( $variation as $var ) { + var_dump(gzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECT-- +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +array(6) { + [0]=> + string(36) "When you're taught through feelings +" + [1]=> + string(26) "Destiny flying high above +" + [2]=> + string(38) "all I know is that you can realize it +" + [3]=> + string(18) "Destiny who cares +" + [4]=> + string(19) "as it turns around +" + [5]=> + string(39) "and I know that it descends down on me +" +} +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzgetc_basic.phpt b/ext/zlib/tests/gzgetc_basic.phpt new file mode 100644 index 0000000000..ca2e38c0ec --- /dev/null +++ b/ext/zlib/tests/gzgetc_basic.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test function gzgetc() by calling it with its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me + +characters counted=176 +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzgetc_error.phpt b/ext/zlib/tests/gzgetc_error.phpt new file mode 100644 index 0000000000..67ba462153 --- /dev/null +++ b/ext/zlib/tests/gzgetc_error.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test function gzgetc() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: gzgetc() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: gzgetc() expects exactly 1 parameter, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzgets_basic.phpt b/ext/zlib/tests/gzgets_basic.phpt new file mode 100644 index 0000000000..3ebc759007 --- /dev/null +++ b/ext/zlib/tests/gzgets_basic.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test function gzgets() by calling it with its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +string(9) "When you'" +string(13) "re taught thr" +string(6) "ough f" +string(8) "eelings +" +string(26) "Destiny flying high above +" +string(38) "all I know is that you can realize it +" +string(18) "Destiny who cares +" +string(19) "as it turns around +" +string(39) "and I know that it descends down on me +" +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzgets_error.phpt b/ext/zlib/tests/gzgets_error.phpt new file mode 100644 index 0000000000..991e02fce3 --- /dev/null +++ b/ext/zlib/tests/gzgets_error.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test function gzgets() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: gzgets() expects at most 2 parameters, 3 given in %s on line %d +NULL + +Warning: gzgets() expects at least 1 parameter, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzopen_basic.phpt b/ext/zlib/tests/gzopen_basic.phpt new file mode 100644 index 0000000000..e3697731d8 --- /dev/null +++ b/ext/zlib/tests/gzopen_basic.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test gzopen() function : basic functionality +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing gzopen() : basic functionality *** +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +===DONE=== diff --git a/ext/zlib/tests/gzopen_basic2.phpt b/ext/zlib/tests/gzopen_basic2.phpt new file mode 100644 index 0000000000..f43bf76e59 --- /dev/null +++ b/ext/zlib/tests/gzopen_basic2.phpt @@ -0,0 +1,52 @@ +--TEST-- +Test gzopen() function : basic functionality for writing +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing gzopen() : basic functionality *** +testing mode -- w -- +This was the information that was written +testing mode -- w+ -- + +Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d +bool(false) +===DONE=== diff --git a/ext/zlib/tests/gzopen_error.phpt b/ext/zlib/tests/gzopen_error.phpt new file mode 100644 index 0000000000..a71791fb24 --- /dev/null +++ b/ext/zlib/tests/gzopen_error.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test gzopen() function : error conditions +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing gzopen() : error conditions *** + +-- Testing gzopen() function with more than expected no. of arguments -- + +Warning: gzopen() expects at most 3 parameters, 4 given in %s on line %d +NULL + +-- Testing gzopen() function with less than expected no. of arguments -- + +Warning: gzopen() expects at least 2 parameters, 1 given in %s on line %d +NULL +===DONE=== diff --git a/ext/zlib/tests/gzopen_include_path.inc b/ext/zlib/tests/gzopen_include_path.inc new file mode 100644 index 0000000000..7d6723a815 --- /dev/null +++ b/ext/zlib/tests/gzopen_include_path.inc @@ -0,0 +1,92 @@ + \ No newline at end of file diff --git a/ext/zlib/tests/gzopen_variation1.phpt b/ext/zlib/tests/gzopen_variation1.phpt new file mode 100644 index 0000000000..6720e6ed8c --- /dev/null +++ b/ext/zlib/tests/gzopen_variation1.phpt @@ -0,0 +1,227 @@ +--TEST-- +Test gzopen() function : usage variation +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // resource variable + 'resource' => $fp +); + +// loop through each element of the array for filename + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( gzopen($value, $mode, $use_include_path) ); +}; + +fclose($fp); + +?> +===DONE=== +--EXPECTF-- +*** Testing gzopen() : usage variation *** + +--int 0-- +Error: 2 - gzopen(0): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--int 1-- +Error: 2 - gzopen(1): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - gzopen(12345): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - gzopen(-2345): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - gzopen(10.5): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - gzopen(-10.5): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - gzopen(123456789000): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - gzopen(-123456789000): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--float .5-- +Error: 2 - gzopen(0.5): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--empty array-- +Error: 2 - gzopen() expects parameter 1 to be string (Unicode or binary), array given, %s(%d) +NULL + +--int indexed array-- +Error: 2 - gzopen() expects parameter 1 to be string (Unicode or binary), array given, %s(%d) +NULL + +--associative array-- +Error: 2 - gzopen() expects parameter 1 to be string (Unicode or binary), array given, %s(%d) +NULL + +--nested arrays-- +Error: 2 - gzopen() expects parameter 1 to be string (Unicode or binary), array given, %s(%d) +NULL + +--uppercase NULL-- +Error: 2 - gzopen(): Filename cannot be empty, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - gzopen(): Filename cannot be empty, %s(%d) +bool(false) + +--lowercase true-- +Error: 2 - gzopen(1): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - gzopen(): Filename cannot be empty, %s(%d) +bool(false) + +--uppercase TRUE-- +Error: 2 - gzopen(1): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - gzopen(): Filename cannot be empty, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - gzopen(): Filename cannot be empty, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - gzopen(): Filename cannot be empty, %s(%d) +bool(false) + +--instance of classWithToString-- +Error: 2 - gzopen(Class A object): failed to open stream: No such file or directory, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 2 - gzopen() expects parameter 1 to be string (Unicode or binary), object given, %s(%d) +NULL + +--undefined var-- +Error: 2 - gzopen(): Filename cannot be empty, %s(%d) +bool(false) + +--unset var-- +Error: 2 - gzopen(): Filename cannot be empty, %s(%d) +bool(false) + +--resource-- +Error: 2 - gzopen() expects parameter 1 to be string (Unicode or binary), resource given, %s(%d) +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzopen_variation2.phpt b/ext/zlib/tests/gzopen_variation2.phpt new file mode 100644 index 0000000000..865ab48443 --- /dev/null +++ b/ext/zlib/tests/gzopen_variation2.phpt @@ -0,0 +1,227 @@ +--TEST-- +Test gzopen() function : usage variation +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // int data + 'int 0' => 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // resource variable + 'resource' => $fp +); + +// loop through each element of the array for mode + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + var_dump( gzopen($filename, $value, $use_include_path) ); +}; + +fclose($fp); + +?> +===DONE=== +--EXPECTF-- +*** Testing gzopen() : usage variation *** + +--int 0-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--int 1-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--int 12345-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--int -12345-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--float 10.5-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--float -10.5-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--float 12.3456789000e10-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--float -12.3456789000e10-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--float .5-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--empty array-- +Error: 2 - gzopen() expects parameter 2 to be binary string, array given, %s(%d) +NULL + +--int indexed array-- +Error: 2 - gzopen() expects parameter 2 to be binary string, array given, %s(%d) +NULL + +--associative array-- +Error: 2 - gzopen() expects parameter 2 to be binary string, array given, %s(%d) +NULL + +--nested arrays-- +Error: 2 - gzopen() expects parameter 2 to be binary string, array given, %s(%d) +NULL + +--uppercase NULL-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--lowercase null-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--lowercase true-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--lowercase false-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--uppercase TRUE-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--uppercase FALSE-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--empty string DQ-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--empty string SQ-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--instance of classWithToString-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--instance of classWithoutToString-- +Error: 2 - gzopen() expects parameter 2 to be binary string, object given, %s(%d) +NULL + +--undefined var-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--unset var-- +Error: 2 - gzopen(%s/004.txt.gz): failed to open stream: %s, %s(%d) +bool(false) + +--resource-- +Error: 2 - gzopen() expects parameter 2 to be binary string, resource given, %s(%d) +NULL +===DONE=== diff --git a/ext/zlib/tests/gzopen_variation3.phpt b/ext/zlib/tests/gzopen_variation3.phpt new file mode 100644 index 0000000000..402a62f7fb --- /dev/null +++ b/ext/zlib/tests/gzopen_variation3.phpt @@ -0,0 +1,218 @@ +--TEST-- +Test gzopen() function : usage variation +--SKIPIF-- + +--FILE-- + 1, 'two' => 2); + +//array of values to iterate over +$inputs = array( + + // float data + 'float 10.5' => 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + + // array data + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + + // boolean data + 'lowercase true' => true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + + // empty data + 'empty string DQ' => "", + 'empty string SQ' => '', + + // string data + 'string DQ' => "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc, + + // object data + 'instance of classWithToString' => new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, + + // resource variable + 'resource' => $fp +); + +// loop through each element of the array for use_include_path + +foreach($inputs as $key =>$value) { + echo "\n--$key--\n"; + $res = gzopen($filename, $mode, $value); + var_dump($res); + if ($res === true) { + gzclose($res); + } +}; + +fclose($fp); + +?> +===DONE=== +--EXPECTF-- +*** Testing gzopen() : usage variation *** + +--float 10.5-- +resource(%d) of type (stream) + +--float -10.5-- +resource(%d) of type (stream) + +--float 12.3456789000e10-- +resource(%d) of type (stream) + +--float -12.3456789000e10-- +resource(%d) of type (stream) + +--float .5-- +resource(%d) of type (stream) + +--empty array-- +Error: 2 - gzopen() expects parameter 3 to be long, array given, %s(%d) +NULL + +--int indexed array-- +Error: 2 - gzopen() expects parameter 3 to be long, array given, %s(%d) +NULL + +--associative array-- +Error: 2 - gzopen() expects parameter 3 to be long, array given, %s(%d) +NULL + +--nested arrays-- +Error: 2 - gzopen() expects parameter 3 to be long, array given, %s(%d) +NULL + +--uppercase NULL-- +resource(%d) of type (stream) + +--lowercase null-- +resource(%d) of type (stream) + +--lowercase true-- +resource(%d) of type (stream) + +--lowercase false-- +resource(%d) of type (stream) + +--uppercase TRUE-- +resource(%d) of type (stream) + +--uppercase FALSE-- +resource(%d) of type (stream) + +--empty string DQ-- +Error: 2 - gzopen() expects parameter 3 to be long, Unicode string given, %s(%d) +NULL + +--empty string SQ-- +Error: 2 - gzopen() expects parameter 3 to be long, Unicode string given, %s(%d) +NULL + +--string DQ-- +Error: 2 - gzopen() expects parameter 3 to be long, Unicode string given, %s(%d) +NULL + +--string SQ-- +Error: 2 - gzopen() expects parameter 3 to be long, Unicode string given, %s(%d) +NULL + +--mixed case string-- +Error: 2 - gzopen() expects parameter 3 to be long, Unicode string given, %s(%d) +NULL + +--heredoc-- +Error: 2 - gzopen() expects parameter 3 to be long, Unicode string given, %s(%d) +NULL + +--instance of classWithToString-- +Error: 2 - gzopen() expects parameter 3 to be long, object given, %s(%d) +NULL + +--instance of classWithoutToString-- +Error: 2 - gzopen() expects parameter 3 to be long, object given, %s(%d) +NULL + +--undefined var-- +resource(%d) of type (stream) + +--unset var-- +resource(%d) of type (stream) + +--resource-- +Error: 2 - gzopen() expects parameter 3 to be long, resource given, %s(%d) +NULL +===DONE=== diff --git a/ext/zlib/tests/gzopen_variation4.phpt b/ext/zlib/tests/gzopen_variation4.phpt new file mode 100644 index 0000000000..dbd4ceb956 --- /dev/null +++ b/ext/zlib/tests/gzopen_variation4.phpt @@ -0,0 +1,191 @@ +--TEST-- +Test gzopen() function : variation: use include path (relative directories in path) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing gzopen() : usage variation *** + +--- testing include path --- + +** testing with mode=r ** +This is a file in dir2 +This is a file in dir1 +This is a file in dir1 +This is a file in working dir +This is a file in script dir + +** testing with mode=r+ ** + +Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d + +Warning: gzpassthru() expects parameter 1 to be resource, boolean given in %s on line %d + +Warning: gzclose() expects parameter 1 to be resource, boolean given in %s on line %d + + +Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d + +Warning: gzpassthru() expects parameter 1 to be resource, boolean given in %s on line %d + +Warning: gzclose() expects parameter 1 to be resource, boolean given in %s on line %d + + +Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d + +Warning: gzpassthru() expects parameter 1 to be resource, boolean given in %s on line %d + +Warning: gzclose() expects parameter 1 to be resource, boolean given in %s on line %d + + +Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d + +Warning: gzpassthru() expects parameter 1 to be resource, boolean given in %s on line %d + +Warning: gzclose() expects parameter 1 to be resource, boolean given in %s on line %d + + +Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d + +Warning: gzpassthru() expects parameter 1 to be resource, boolean given in %s on line %d + +Warning: gzclose() expects parameter 1 to be resource, boolean given in %s on line %d + + +** testing with mode=rt ** + +Warning: gzopen(): cannot cast a filtered stream on this system in %s on line %d + +Warning: gzpassthru() expects parameter 1 to be resource, boolean given in %s on line %d + +Warning: gzclose() expects parameter 1 to be resource, boolean given in %s on line %d + + +Warning: gzopen(): cannot cast a filtered stream on this system in %s on line %d + +Warning: gzpassthru() expects parameter 1 to be resource, boolean given in %s on line %d + +Warning: gzclose() expects parameter 1 to be resource, boolean given in %s on line %d + + +Warning: gzopen(): cannot cast a filtered stream on this system in %s on line %d + +Warning: gzpassthru() expects parameter 1 to be resource, boolean given in %s on line %d + +Warning: gzclose() expects parameter 1 to be resource, boolean given in %s on line %d + + +Warning: gzopen(): cannot cast a filtered stream on this system in %s on line %d + +Warning: gzpassthru() expects parameter 1 to be resource, boolean given in %s on line %d + +Warning: gzclose() expects parameter 1 to be resource, boolean given in %s on line %d + + +Warning: gzopen(): cannot cast a filtered stream on this system in %s on line %d + +Warning: gzpassthru() expects parameter 1 to be resource, boolean given in %s on line %d + +Warning: gzclose() expects parameter 1 to be resource, boolean given in %s on line %d + +===DONE=== + diff --git a/ext/zlib/tests/gzopen_variation5.phpt b/ext/zlib/tests/gzopen_variation5.phpt new file mode 100644 index 0000000000..e7562e044e --- /dev/null +++ b/ext/zlib/tests/gzopen_variation5.phpt @@ -0,0 +1,71 @@ +--TEST-- +Test gzopen() function : variation: use include path and stream context create a file, relative path +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing gzopen() : variation *** +created in working dir +Not created in dir1 +created in working dir +Not created in dir1 +===DONE=== diff --git a/ext/zlib/tests/gzopen_variation6.phpt b/ext/zlib/tests/gzopen_variation6.phpt new file mode 100644 index 0000000000..4c6163bf89 --- /dev/null +++ b/ext/zlib/tests/gzopen_variation6.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test gzopen() function : variation: relative/absolute file +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing gzopen() : variation *** +This is an absolute file +This is a relative file +===DONE=== diff --git a/ext/zlib/tests/gzopen_variation7.phpt b/ext/zlib/tests/gzopen_variation7.phpt new file mode 100644 index 0000000000..92642b0993 --- /dev/null +++ b/ext/zlib/tests/gzopen_variation7.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test function gzopen() by calling it twice on the same file and not closing one of them at the end of the script +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +string(30) "When you're taught through fee" +string(10) "When you'r" +string(15) "lings +Destiny f" +string(50) "e taught through feelings +Destiny flying high abov" +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzpassthru_basic.phpt b/ext/zlib/tests/gzpassthru_basic.phpt new file mode 100644 index 0000000000..931c2b22cd --- /dev/null +++ b/ext/zlib/tests/gzpassthru_basic.phpt @@ -0,0 +1,32 @@ +--TEST-- +Test function gzpassthru() by calling it with its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +int(0) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzpassthru_error.phpt b/ext/zlib/tests/gzpassthru_error.phpt new file mode 100644 index 0000000000..27eb229071 --- /dev/null +++ b/ext/zlib/tests/gzpassthru_error.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test function gzpassthru() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: gzpassthru() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: gzpassthru() expects exactly 1 parameter, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzputs_basic.phpt b/ext/zlib/tests/gzputs_basic.phpt new file mode 100644 index 0000000000..1df99b0624 --- /dev/null +++ b/ext/zlib/tests/gzputs_basic.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test function gzputs() by calling it with its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +int(34) +int(10) +Here is the string to be written. Here is th +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzread_basic.phpt b/ext/zlib/tests/gzread_basic.phpt new file mode 100644 index 0000000000..ecb62a8259 --- /dev/null +++ b/ext/zlib/tests/gzread_basic.phpt @@ -0,0 +1,37 @@ +--TEST-- +Test function gzread() by calling it with its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +string(10) "When you'r" +string(14) "e taught throu" +string(7) "gh feel" +string(99) "ings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns " +string(46) "around +and I know that it descends down on me +" +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzread_error.phpt b/ext/zlib/tests/gzread_error.phpt new file mode 100644 index 0000000000..5e868d4998 --- /dev/null +++ b/ext/zlib/tests/gzread_error.phpt @@ -0,0 +1,32 @@ +--TEST-- +Test function gzread() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: gzread() expects exactly 2 parameters, 3 given in %s on line %d +NULL + +Warning: gzread() expects exactly 2 parameters, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzread_error2.phpt b/ext/zlib/tests/gzread_error2.phpt new file mode 100644 index 0000000000..fae6356419 --- /dev/null +++ b/ext/zlib/tests/gzread_error2.phpt @@ -0,0 +1,32 @@ +--TEST-- +Test function gzread() by calling it invalid lengths +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +string(10) "When you'r" + +Warning: gzread(): Length parameter must be greater than 0 in %s on line %d +bool(false) +string(5) "e tau" + +Warning: gzread(): Length parameter must be greater than 0 in %s on line %d +bool(false) +string(8) "ght thro" +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzread_variation1.phpt b/ext/zlib/tests/gzread_variation1.phpt new file mode 100644 index 0000000000..dd0097f286 --- /dev/null +++ b/ext/zlib/tests/gzread_variation1.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test function gzread() by calling it while file open for writing +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +string(0) "" +string(0) "" +string(0) "" +Here is the string to be written. +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzrewind_basic.phpt b/ext/zlib/tests/gzrewind_basic.phpt new file mode 100644 index 0000000000..959f0fcdec --- /dev/null +++ b/ext/zlib/tests/gzrewind_basic.phpt @@ -0,0 +1,36 @@ +--TEST-- +Test function gzrewind() by calling it with its expected arguments when reading +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +test rewind before doing anything +bool(true) +int(0) + +first 30 characters=When you're taught through fee +int(30) +int(0) +first 10 characters=When you'r +first 20 characters=When you're taught t +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzrewind_basic2.phpt b/ext/zlib/tests/gzrewind_basic2.phpt new file mode 100644 index 0000000000..f51751c614 --- /dev/null +++ b/ext/zlib/tests/gzrewind_basic2.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test function gzrewind() by calling it with its expected arguments when reading +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +read to the end of the file, then rewind +bool(true) +int(176) +bool(false) +int(0) +first 20 characters=When you're taught t +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzrewind_error.phpt b/ext/zlib/tests/gzrewind_error.phpt new file mode 100644 index 0000000000..64762d8b66 --- /dev/null +++ b/ext/zlib/tests/gzrewind_error.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test function gzrewind() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +Warning: gzrewind() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: gzrewind() expects exactly 1 parameter, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzrewind_variation1.phpt b/ext/zlib/tests/gzrewind_variation1.phpt new file mode 100644 index 0000000000..82018627f4 --- /dev/null +++ b/ext/zlib/tests/gzrewind_variation1.phpt @@ -0,0 +1,28 @@ +--TEST-- +Test function gzrewind() by calling it with its expected arguments when writing +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +bool(false) +The first string.The second string. +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzseek_basic.phpt b/ext/zlib/tests/gzseek_basic.phpt new file mode 100644 index 0000000000..d641bad429 --- /dev/null +++ b/ext/zlib/tests/gzseek_basic.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test function gzseek() by calling it with its expected arguments when reading +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +move to the 50th byte +int(0) +tell=50 +string(10) " high abov" + +move forward to the 100th byte +int(0) +tell=100 +string(10) "Destiny wh" + +move backward to the 20th byte +int(0) +tell=20 +string(10) "hrough fee" +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzseek_basic2.phpt b/ext/zlib/tests/gzseek_basic2.phpt new file mode 100644 index 0000000000..ade5b8a83c --- /dev/null +++ b/ext/zlib/tests/gzseek_basic2.phpt @@ -0,0 +1,42 @@ +--TEST-- +Test function gzseek() by calling it with its expected arguments when writing +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +tell=23 +tell=43 +tell=67 + +reading the output file +This is the first line. +unicode(40) "0000000000000000000000000000000000000000" +This is the second line. +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzseek_error.phpt b/ext/zlib/tests/gzseek_error.phpt new file mode 100644 index 0000000000..b515ef7be0 --- /dev/null +++ b/ext/zlib/tests/gzseek_error.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test function gzseek() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: gzseek() expects at most 3 parameters, 4 given in %s on line %d +NULL + +Warning: gzseek() expects at least 2 parameters, 1 given in %s on line %d +NULL + +Warning: gzseek() expects at least 2 parameters, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzseek_variation1.phpt b/ext/zlib/tests/gzseek_variation1.phpt new file mode 100644 index 0000000000..59adabc854 --- /dev/null +++ b/ext/zlib/tests/gzseek_variation1.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test function gzseek() by seeking forward in write mode +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +This is the first line. +unicode(40) "0000000000000000000000000000000000000000" +This is the second line. +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzseek_variation2.phpt b/ext/zlib/tests/gzseek_variation2.phpt new file mode 100644 index 0000000000..e70d6dd845 --- /dev/null +++ b/ext/zlib/tests/gzseek_variation2.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test function gzseek() by calling it with SEEK_SET when reading +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +move to the 50th byte +int(0) +tell=50 +string(10) " high abov" + +move forward to the 100th byte +int(0) +tell=100 +string(10) "Destiny wh" + +move backward to the 20th byte +int(0) +tell=20 +string(10) "hrough fee" +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzseek_variation3.phpt b/ext/zlib/tests/gzseek_variation3.phpt new file mode 100644 index 0000000000..dee7c1302a --- /dev/null +++ b/ext/zlib/tests/gzseek_variation3.phpt @@ -0,0 +1,50 @@ +--TEST-- +Test function gzseek() by calling it with SEEK_CUR when reading +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +move to the 50th byte +int(0) +tell=50 +string(10) " high abov" + +move forward to the 94th byte +int(0) +tell=94 +string(10) "ze it +Dest" + +move backward to the 77th byte +int(0) +tell=77 +string(10) "hat you ca" +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzseek_variation4.phpt b/ext/zlib/tests/gzseek_variation4.phpt new file mode 100644 index 0000000000..b5213849f1 --- /dev/null +++ b/ext/zlib/tests/gzseek_variation4.phpt @@ -0,0 +1,42 @@ +--TEST-- +Test function gzseek() by calling it with SEEK_SET when writing +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +tell=23 +tell=43 +tell=67 + +reading the output file +This is the first line. +unicode(40) "0000000000000000000000000000000000000000" +This is the second line. +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzseek_variation5.phpt b/ext/zlib/tests/gzseek_variation5.phpt new file mode 100644 index 0000000000..055659eae4 --- /dev/null +++ b/ext/zlib/tests/gzseek_variation5.phpt @@ -0,0 +1,42 @@ +--TEST-- +Test function gzseek() by calling it with SEEK_CUR when writing +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +tell=23 +tell=43 +tell=67 + +reading the output file +This is the first line. +unicode(40) "0000000000000000000000000000000000000000" +This is the second line. +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gztell_basic.phpt b/ext/zlib/tests/gztell_basic.phpt new file mode 100644 index 0000000000..b6baf427db --- /dev/null +++ b/ext/zlib/tests/gztell_basic.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test function gztell() by calling it with its expected arguments when reading +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +int(0) +int(7) +int(29) +int(83) +int(100) +int(127) +int(142) +int(176) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gztell_basic2.phpt b/ext/zlib/tests/gztell_basic2.phpt new file mode 100644 index 0000000000..a8574eeaa6 --- /dev/null +++ b/ext/zlib/tests/gztell_basic2.phpt @@ -0,0 +1,42 @@ +--TEST-- +Test function gztell() by calling it with its expected arguments when writing +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +int(0) +bytes written=7 +tell=7 +bytes written=22 +tell=29 +bytes written=54 +tell=83 +bytes written=17 +tell=100 +bytes written=27 +tell=127 +bytes written=15 +tell=142 +bytes written=1000 +tell=1142 +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gztell_error.phpt b/ext/zlib/tests/gztell_error.phpt new file mode 100644 index 0000000000..c8915041c9 --- /dev/null +++ b/ext/zlib/tests/gztell_error.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test function gztell() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: gztell() expects exactly 1 parameter, 2 given in %s on line %d +NULL + +Warning: gztell() expects exactly 1 parameter, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzwrite_basic.phpt b/ext/zlib/tests/gzwrite_basic.phpt new file mode 100644 index 0000000000..4f76f32cd0 --- /dev/null +++ b/ext/zlib/tests/gzwrite_basic.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test function gzwrite() by calling it with its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +int(34) +int(10) +Here is the string to be written. Here is th +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzwrite_error.phpt b/ext/zlib/tests/gzwrite_error.phpt new file mode 100644 index 0000000000..0be4d5f0f3 --- /dev/null +++ b/ext/zlib/tests/gzwrite_error.phpt @@ -0,0 +1,35 @@ +--TEST-- +Test function gzwrite() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: gzwrite() expects at most 3 parameters, 4 given in %s on line %d +NULL + +Warning: gzwrite() expects at least 2 parameters, 1 given in %s on line %d +NULL + +Warning: gzwrite() expects at least 2 parameters, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzwrite_error2.phpt b/ext/zlib/tests/gzwrite_error2.phpt new file mode 100644 index 0000000000..ce7a8a3c2a --- /dev/null +++ b/ext/zlib/tests/gzwrite_error2.phpt @@ -0,0 +1,30 @@ +--TEST-- +Test function gzwrite() by calling it invalid lengths +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +int(0) +int(0) + +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzwrite_variation1.phpt b/ext/zlib/tests/gzwrite_variation1.phpt new file mode 100644 index 0000000000..ab6c2606b4 --- /dev/null +++ b/ext/zlib/tests/gzwrite_variation1.phpt @@ -0,0 +1,27 @@ +--TEST-- +Test function gzwrite() by calling it when file is opened for reading +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +int(0) +string(10) "When you'r" +int(0) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_basic.phpt b/ext/zlib/tests/readgzfile_basic.phpt new file mode 100644 index 0000000000..2d180c1a56 --- /dev/null +++ b/ext/zlib/tests/readgzfile_basic.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test function readgzfile() reading a gzip relative file +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +hello world +is a very common test +for all languages +int(52) +===DONE=== diff --git a/ext/zlib/tests/readgzfile_basic2.phpt b/ext/zlib/tests/readgzfile_basic2.phpt new file mode 100644 index 0000000000..99d216a55e --- /dev/null +++ b/ext/zlib/tests/readgzfile_basic2.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test function readgzfile() reading a plain relative file +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +hello world +is a very common test +for all languages +int(52) +===DONE=== diff --git a/ext/zlib/tests/readgzfile_error.phpt b/ext/zlib/tests/readgzfile_error.phpt new file mode 100644 index 0000000000..4ec76d0172 --- /dev/null +++ b/ext/zlib/tests/readgzfile_error.phpt @@ -0,0 +1,29 @@ +--TEST-- +Test function readgzfile() by calling it more than or less than its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: readgzfile() expects at most 2 parameters, 3 given in %s on line %d +NULL + +Warning: readgzfile() expects at least 1 parameter, 0 given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation1.phpt b/ext/zlib/tests/readgzfile_variation1.phpt new file mode 100644 index 0000000000..83f033ff62 --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation1.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test function readgzfile() by substituting agument 1 with array values. +--SKIPIF-- + +--FILE-- + 'one', 2 => 'two'); + +$variation = array( + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- + +Warning: readgzfile() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 1 to be string (Unicode or binary), array given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation10.phpt b/ext/zlib/tests/readgzfile_variation10.phpt new file mode 100644 index 0000000000..d291066334 --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation10.phpt @@ -0,0 +1,67 @@ +--TEST-- +Test function readgzfile() by substituting agument 2 with emptyUnsetUndefNull values. +--SKIPIF-- + +--FILE-- + @$unset_var, + 'undefined var' => @$undefined_var, + 'empty string DQ' => "", + 'empty string SQ' => '', + 'uppercase NULL' => NULL, + 'lowercase null' => null, + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECTF-- +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) + +Warning: readgzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation11.phpt b/ext/zlib/tests/readgzfile_variation11.phpt new file mode 100644 index 0000000000..4023211ff1 --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation11.phpt @@ -0,0 +1,64 @@ +--TEST-- +Test function readgzfile() by substituting agument 2 with float values. +--SKIPIF-- + +--FILE-- + 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECT-- +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation12.phpt b/ext/zlib/tests/readgzfile_variation12.phpt new file mode 100644 index 0000000000..8c291a4f46 --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation12.phpt @@ -0,0 +1,56 @@ +--TEST-- +Test function readgzfile() by substituting agument 2 with int values. +--SKIPIF-- + +--FILE-- + 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECT-- +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation13.phpt b/ext/zlib/tests/readgzfile_variation13.phpt new file mode 100644 index 0000000000..117860eb40 --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation13.phpt @@ -0,0 +1,51 @@ +--TEST-- +Test function readgzfile() by substituting agument 2 with object values. +--SKIPIF-- + +--FILE-- + new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECTF-- +Error: 2 - readgzfile() expects parameter 2 to be long, object given, %s(%d) +NULL +Error: 2 - readgzfile() expects parameter 2 to be long, object given, %s(%d) +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation14.phpt b/ext/zlib/tests/readgzfile_variation14.phpt new file mode 100644 index 0000000000..b1000452fd --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation14.phpt @@ -0,0 +1,44 @@ +--TEST-- +Test function readgzfile() by substituting agument 2 with string values. +--SKIPIF-- + +--FILE-- + "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc + ); + + +foreach ( $variation_array as $var ) { + var_dump(readgzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECTF-- + +Warning: readgzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 2 to be long, Unicode string given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation15.phpt b/ext/zlib/tests/readgzfile_variation15.phpt new file mode 100644 index 0000000000..3c205647ad --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation15.phpt @@ -0,0 +1,94 @@ +--TEST-- +Test readgzfile() function : variation: use include path (relative directories in path) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +file content:This is a file in dir2 +file content:This is a file in dir1 +file content:This is a file in dir1 +file content:This is a file in working dir +file content:This is a file in script dir +===DONE=== + diff --git a/ext/zlib/tests/readgzfile_variation2.phpt b/ext/zlib/tests/readgzfile_variation2.phpt new file mode 100644 index 0000000000..367cc401b3 --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation2.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test function readgzfile() by substituting agument 1 with boolean values. +--SKIPIF-- + +--FILE-- + true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- + +Warning: readgzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 2 to be long, array given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation3.phpt b/ext/zlib/tests/readgzfile_variation3.phpt new file mode 100644 index 0000000000..6645d67b7a --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation3.phpt @@ -0,0 +1,50 @@ +--TEST-- +Test function readgzfile() by substituting agument 1 with emptyUnsetUndefNull values. +--SKIPIF-- + +--FILE-- + @$unset_var, + 'undefined var' => @$undefined_var, + 'empty string DQ' => "", + 'empty string SQ' => '', + 'uppercase NULL' => NULL, + 'lowercase null' => null, + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- +Warning: readgzfile(): Filename cannot be empty in %s on line %d +bool(false) + +Warning: readgzfile(): Filename cannot be empty in %s on line %d +bool(false) + +Warning: readgzfile(): Filename cannot be empty in %s on line %d +bool(false) + +Warning: readgzfile(): Filename cannot be empty in %s on line %d +bool(false) + +Warning: readgzfile(): Filename cannot be empty in %s on line %d +bool(false) + +Warning: readgzfile(): Filename cannot be empty in %s on line %d +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation4.phpt b/ext/zlib/tests/readgzfile_variation4.phpt new file mode 100644 index 0000000000..ece84a990e --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation4.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test function readgzfile() by substituting agument 1 with float values. +--SKIPIF-- + +--FILE-- + 10.5, + 'float -10.5' => -10.5, + 'float 12.3456789000e10' => 12.3456789000e10, + 'float -12.3456789000e10' => -12.3456789000e10, + 'float .5' => .5, + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- +Warning: readgzfile(10.5): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: readgzfile(-10.5): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: readgzfile(123456789000): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: readgzfile(-123456789000): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: readgzfile(0.5): failed to open stream: No such file or directory in %s on line %d +bool(false) +===DONE=== diff --git a/ext/zlib/tests/readgzfile_variation5.phpt b/ext/zlib/tests/readgzfile_variation5.phpt new file mode 100644 index 0000000000..1a3fe14029 --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation5.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test function readgzfile() by substituting agument 1 with int values. +--SKIPIF-- + +--FILE-- + 0, + 'int 1' => 1, + 'int 12345' => 12345, + 'int -12345' => -2345, + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- +Warning: readgzfile(0): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: readgzfile(1): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: readgzfile(12345): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: readgzfile(-2345): failed to open stream: No such file or directory in %s on line %d +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation6.phpt b/ext/zlib/tests/readgzfile_variation6.phpt new file mode 100644 index 0000000000..270604fefd --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation6.phpt @@ -0,0 +1,49 @@ +--TEST-- +Test function readgzfile() by substituting agument 1 with object values. +--SKIPIF-- + +--FILE-- + new classWithToString(), + 'instance of classWithoutToString' => new classWithoutToString(), + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $var , $use_include_path ) ); +} +?> +--EXPECTF-- +Error: 2 - readgzfile(Class A object): failed to open stream: No such file or directory, %s(%d) +bool(false) +Error: 2 - readgzfile() expects parameter 1 to be string (Unicode or binary), object given, %s(%d) +NULL \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation7.phpt b/ext/zlib/tests/readgzfile_variation7.phpt new file mode 100644 index 0000000000..20162b5cb5 --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation7.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test function readgzfile() by substituting agument 1 with string values. +--SKIPIF-- + +--FILE-- + "string", + 'string SQ' => 'string', + 'mixed case string' => "sTrInG", + 'heredoc' => $heredoc + ); + + +foreach ( $variation_array as $var ) { + var_dump(readgzfile( $var , $use_include_path ) ); +} +?> +===DONE=== +--EXPECTF-- +Warning: readgzfile(string): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: readgzfile(string): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: readgzfile(sTrInG): failed to open stream: No such file or directory in %s on line %d +bool(false) + +Warning: readgzfile(hello world): failed to open stream: No such file or directory in %s on line %d +bool(false) +===DONE=== diff --git a/ext/zlib/tests/readgzfile_variation8.phpt b/ext/zlib/tests/readgzfile_variation8.phpt new file mode 100644 index 0000000000..2e155288fa --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation8.phpt @@ -0,0 +1,43 @@ +--TEST-- +Test function readgzfile() by substituting agument 2 with array values. +--SKIPIF-- + +--FILE-- + 'one', 2 => 'two'); + +$variation = array( + 'empty array' => array(), + 'int indexed array' => $index_array, + 'associative array' => $assoc_array, + 'nested arrays' => array('foo', $index_array, $assoc_array), + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECTF-- + +Warning: readgzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 2 to be long, array given in %s on line %d +NULL + +Warning: readgzfile() expects parameter 2 to be long, array given in %s on line %d +NULL +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/readgzfile_variation9.phpt b/ext/zlib/tests/readgzfile_variation9.phpt new file mode 100644 index 0000000000..5cdb5b5da5 --- /dev/null +++ b/ext/zlib/tests/readgzfile_variation9.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test function readgzfile() by substituting agument 2 with boolean values. +--SKIPIF-- + +--FILE-- + true, + 'lowercase false' =>false, + 'uppercase TRUE' =>TRUE, + 'uppercase FALSE' =>FALSE, + ); + + +foreach ( $variation as $var ) { + var_dump(readgzfile( $filename, $var ) ); +} +?> +===DONE=== +--EXPECT-- +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +When you're taught through feelings +Destiny flying high above +all I know is that you can realize it +Destiny who cares +as it turns around +and I know that it descends down on me +int(176) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/reading_include_path.inc b/ext/zlib/tests/reading_include_path.inc new file mode 100644 index 0000000000..ee71bb9c42 --- /dev/null +++ b/ext/zlib/tests/reading_include_path.inc @@ -0,0 +1,27 @@ + \ No newline at end of file diff --git a/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt b/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt new file mode 100644 index 0000000000..93f8cbdb47 --- /dev/null +++ b/ext/zlib/tests/zlib_wrapper_fflush_basic.phpt @@ -0,0 +1,33 @@ +--TEST-- +Test function fflush() on a zlib stream wrapper +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +bool(true) +bool(true) +Here is the string to be written.Here is the string to be written. +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_wrapper_flock_basic.phpt b/ext/zlib/tests/zlib_wrapper_flock_basic.phpt new file mode 100644 index 0000000000..9cefce4cbe --- /dev/null +++ b/ext/zlib/tests/zlib_wrapper_flock_basic.phpt @@ -0,0 +1,19 @@ +--TEST-- +Test function stream_get_meta_data on a zlib stream +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt b/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt new file mode 100644 index 0000000000..53b140ac56 --- /dev/null +++ b/ext/zlib/tests/zlib_wrapper_ftruncate_basic.phpt @@ -0,0 +1,32 @@ +--TEST-- +Test function ftruncate() on zlib wrapper by calling it with its expected arguments +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: ftruncate(): Can't truncate this stream! in %s on line %d + +Warning: ftruncate(): Can't truncate this stream! in %s on line %d +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt b/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt new file mode 100644 index 0000000000..ef47f713f8 --- /dev/null +++ b/ext/zlib/tests/zlib_wrapper_meta_data_basic.phpt @@ -0,0 +1,69 @@ +--TEST-- +Test function stream_get_meta_data on a zlib stream +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +no wrapper +array(8) { + [u"stream_type"]=> + unicode(4) "ZLIB" + [u"mode"]=> + unicode(1) "r" + [u"unread_bytes"]=> + int(0) + [u"unread_chars"]=> + int(0) + [u"seekable"]=> + bool(true) + [u"timed_out"]=> + bool(false) + [u"blocked"]=> + bool(true) + [u"eof"]=> + bool(false) +} + +with wrapper +array(10) { + [u"wrapper_type"]=> + unicode(4) "ZLIB" + [u"stream_type"]=> + unicode(4) "ZLIB" + [u"mode"]=> + unicode(1) "r" + [u"unread_bytes"]=> + int(0) + [u"unread_chars"]=> + int(0) + [u"seekable"]=> + bool(true) + [u"uri"]=> + unicode(%d) "compress.zlib://%s/004.txt.gz" + [u"timed_out"]=> + bool(false) + [u"blocked"]=> + bool(true) + [u"eof"]=> + bool(false) +} +===DONE=== \ No newline at end of file -- 2.50.1