From: Dave Kelsey Date: Wed, 21 Jan 2009 15:24:16 +0000 (+0000) Subject: new tests for zlib extension, tested on windows, linux and linux64 X-Git-Tag: php-5.2.9RC1~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fc347d2518ef6ebe016edd22d31e3a75ce7687a;p=php new tests for zlib extension, tested on windows, linux and linux64 --- diff --git a/ext/zlib/tests/gzopen_variation8.phpt b/ext/zlib/tests/gzopen_variation8.phpt new file mode 100644 index 0000000000..bb0126227f --- /dev/null +++ b/ext/zlib/tests/gzopen_variation8.phpt @@ -0,0 +1,42 @@ +--TEST-- +Test gzopen() function : variation: opening a plain file +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +*** Testing gzopen() : variation *** +Here is some plain +text to be read +and displayed. +===DONE=== diff --git a/ext/zlib/tests/gzopen_variation9.phpt b/ext/zlib/tests/gzopen_variation9.phpt new file mode 100644 index 0000000000..7a44b6eb09 --- /dev/null +++ b/ext/zlib/tests/gzopen_variation9.phpt @@ -0,0 +1,55 @@ +--TEST-- +Test gzopen() function : variation: try opening with possibly invalid modes +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +*** Testing gzopen() : variation *** +mode=r+ + +Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d +gzopen=bool(false) + +mode=rf +gzopen=resource(%d) of type (stream) + +mode=w+ + +Warning: gzopen(): cannot open a zlib stream for reading and writing at the same time! in %s on line %d +gzopen=bool(false) + +mode=e + +Warning: gzopen(%s/004.txt.gz): failed to open stream: %s in %s on line %d +gzopen=bool(false) + +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzseek_variation6.phpt b/ext/zlib/tests/gzseek_variation6.phpt new file mode 100644 index 0000000000..0c4630953c --- /dev/null +++ b/ext/zlib/tests/gzseek_variation6.phpt @@ -0,0 +1,39 @@ +--TEST-- +Test function gzseek() by calling it with SEEK_END when reading +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +move 40 bytes +tell=int(40) +move to the end + +Warning: gzseek(): SEEK_END is not supported in %s on line %d +int(-1) +tell=int(40) +eof=bool(false) +string(10) "iny flying" +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/gzseek_variation7.phpt b/ext/zlib/tests/gzseek_variation7.phpt new file mode 100644 index 0000000000..aab0834652 --- /dev/null +++ b/ext/zlib/tests/gzseek_variation7.phpt @@ -0,0 +1,47 @@ +--TEST-- +Test function gzseek() by calling it with SEEK_END when writing +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +tell=int(23) +move to the end of the file + +Warning: gzseek(): SEEK_END is not supported in %s on line %d +int(-1) +tell=int(23) +tell=int(47) + +reading the output file +This is the first line.This is the second line. +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_copy_basic.phpt b/ext/zlib/tests/zlib_scheme_copy_basic.phpt new file mode 100644 index 0000000000..028c029e62 --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_copy_basic.phpt @@ -0,0 +1,37 @@ +--TEST-- +Test compress.zlib:// scheme with the copy function: compressed to compressed +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +OK: Copy identical +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_copy_variation1.phpt b/ext/zlib/tests/zlib_scheme_copy_variation1.phpt new file mode 100644 index 0000000000..3c997ef7e9 --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_copy_variation1.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test compress.zlib:// scheme with the copy function: compressed to uncompressed +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +OK: Copy identical +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_copy_variation2.phpt b/ext/zlib/tests/zlib_scheme_copy_variation2.phpt new file mode 100644 index 0000000000..0b56ec430a --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_copy_variation2.phpt @@ -0,0 +1,53 @@ +--TEST-- +Test compress.zlib:// scheme with the copy function: uncompressed to compressed +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +OK: Copy identical +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_dir_basic.phpt b/ext/zlib/tests/zlib_scheme_dir_basic.phpt new file mode 100644 index 0000000000..02fe4fd354 --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_dir_basic.phpt @@ -0,0 +1,26 @@ +--TEST-- +Test compress.zlib:// scheme with the directory functions +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +bool(false) +bool(false) + +Warning: opendir(compress.zlib://%s/dir.gz): failed to open dir: not implemented in %s on line %d +bool(false) +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_file_basic.phpt b/ext/zlib/tests/zlib_scheme_file_basic.phpt new file mode 100644 index 0000000000..b8b60e40e7 --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_file_basic.phpt @@ -0,0 +1,38 @@ +--TEST-- +Test compress.zlib:// scheme with the file +--SKIPIF-- + +--FILE-- + +===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 +" +} +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt b/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt new file mode 100644 index 0000000000..c679c46be9 --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_file_get_contents_basic.phpt @@ -0,0 +1,24 @@ +--TEST-- +Test compress.zlib:// scheme with the file_get_contents +--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 +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_file_put_contents_basic.phpt b/ext/zlib/tests/zlib_scheme_file_put_contents_basic.phpt new file mode 100644 index 0000000000..8ea41df5a8 --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_file_put_contents_basic.phpt @@ -0,0 +1,31 @@ +--TEST-- +Test compress.zlib:// scheme with the file_get_contents +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECT-- +Here is some plain +text to be read +and displayed. +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt b/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt new file mode 100644 index 0000000000..ef44292c3f --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_file_read_file_basic.phpt @@ -0,0 +1,23 @@ +--TEST-- +Test compress.zlib:// scheme with the file_get_contents +--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 +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_fopen_basic.phpt b/ext/zlib/tests/zlib_scheme_fopen_basic.phpt new file mode 100644 index 0000000000..d6d4514f7a --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_fopen_basic.phpt @@ -0,0 +1,25 @@ +--TEST-- +Test compress.zlib:// scheme with the fopen +--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 +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_rename_basic.phpt b/ext/zlib/tests/zlib_scheme_rename_basic.phpt new file mode 100644 index 0000000000..9de55aa3e2 --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_rename_basic.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test compress.zlib:// scheme with the unlink function +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: rename(): ZLIB wrapper does not support renaming in %s on line %d +bool(true) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_stat_basic.phpt b/ext/zlib/tests/zlib_scheme_stat_basic.phpt new file mode 100644 index 0000000000..10cd9a4b03 --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_stat_basic.phpt @@ -0,0 +1,22 @@ +--TEST-- +Test compress.zlib:// scheme with the unlink function +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: stat(): stat failed for compress.zlib://%s/004.txt.gz in %s on line %d + +Warning: lstat(): Lstat failed for compress.zlib://%s/004.txt.gz in %s on line %d +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_stat_basic2.phpt b/ext/zlib/tests/zlib_scheme_stat_basic2.phpt new file mode 100644 index 0000000000..e78bcd76c1 --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_stat_basic2.phpt @@ -0,0 +1,46 @@ +--TEST-- +Test compress.zlib:// scheme with the unlink function +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- +file_exists=bool(false) +is_file=bool(false) +is_dir=bool(false) +is_readable=bool(false) + +filesize= +Warning: filesize(): stat failed for compress.zlib://%s004.txt.gz in %s on line %d +bool(false) +filetype= +Warning: filetype(): Lstat failed for compress.zlib://%s004.txt.gz in %s on line %d +bool(false) +fileatime= +Warning: fileatime(): stat failed for compress.zlib://%s004.txt.gz in %s on line %d +bool(false) +===DONE=== \ No newline at end of file diff --git a/ext/zlib/tests/zlib_scheme_unlink_basic.phpt b/ext/zlib/tests/zlib_scheme_unlink_basic.phpt new file mode 100644 index 0000000000..b05e45bc6a --- /dev/null +++ b/ext/zlib/tests/zlib_scheme_unlink_basic.phpt @@ -0,0 +1,21 @@ +--TEST-- +Test compress.zlib:// scheme with the unlink function +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: unlink(): ZLIB does not allow unlinking in %s on line %d +bool(true) +===DONE=== \ No newline at end of file