summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/007.phpt
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-06-26 23:35:22 (GMT)
committerAntony Dovgal <tony2001@php.net>2006-06-26 23:35:22 (GMT)
commit8058f9fd111e07fe6c8ef8ae91b6da5a4d0d6f90 (patch)
treef1039d3557287273c87218277e239d7345082ecc /ext/zlib/tests/007.phpt
parente24fe395a2118efbb5456e5cce75988e4739d3bb (diff)
downloadphp-8058f9fd111e07fe6c8ef8ae91b6da5a4d0d6f90.tar.gz
add new tests
Diffstat (limited to 'ext/zlib/tests/007.phpt')
-rw-r--r--ext/zlib/tests/007.phpt51
1 files changed, 51 insertions, 0 deletions
diff --git a/ext/zlib/tests/007.phpt b/ext/zlib/tests/007.phpt
new file mode 100644
index 0000000..ec37b99
--- /dev/null
+++ b/ext/zlib/tests/007.phpt
@@ -0,0 +1,51 @@
+--TEST--
+gzencode() and invalid params
+--SKIPIF--
+<?php if (!extension_loaded("zlib")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gzencode());
+var_dump(gzencode(1,1,1,1));
+var_dump(gzencode("", -10));
+var_dump(gzencode("", 100));
+var_dump(gzencode("", 1, 100));
+
+var_dump(gzencode("", -1, 1));
+var_dump(gzencode("", 9, 2));
+
+$string = "Light of my sun
+Light in this temple
+Light in my truth
+Lies in the darkness";
+
+var_dump(gzencode($string, 9, 3));
+
+var_dump(gzencode($string, -1, 1));
+var_dump(gzencode($string, 9, 2));
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: gzencode() expects at least 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: gzencode() expects at most 3 parameters, 4 given in %s on line %d
+NULL
+
+Warning: gzencode(): compression level(-10) must be within -1..9 in %s on line %d
+bool(false)
+
+Warning: gzencode(): compression level(100) must be within -1..9 in %s on line %d
+bool(false)
+
+Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d
+bool(false)
+string(%d) "%s"
+string(%d) "%s"
+
+Warning: gzencode(): encoding mode must be FORCE_GZIP or FORCE_DEFLATE in %s on line %d
+bool(false)
+string(%d) "%s"
+string(%d) "%s"
+Done