summaryrefslogtreecommitdiff
path: root/ext/zlib/tests/gzdeflate_error1.phpt
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2010-03-11 10:24:29 +0000
committerJani Taskinen <jani@php.net>2010-03-11 10:24:29 +0000
commit06f072cb5e4e3582e20b8762141eccbc4dce85fa (patch)
tree511382440db96edad3a2627ce361113e29d672ab /ext/zlib/tests/gzdeflate_error1.phpt
parentf60946eb5430cd11daa9f88503dc9b1a9b7bd634 (diff)
downloadphp-git-06f072cb5e4e3582e20b8762141eccbc4dce85fa.tar.gz
MFH: Improved / fixed output buffering (Michael Wallner)
Diffstat (limited to 'ext/zlib/tests/gzdeflate_error1.phpt')
-rw-r--r--ext/zlib/tests/gzdeflate_error1.phpt18
1 files changed, 14 insertions, 4 deletions
diff --git a/ext/zlib/tests/gzdeflate_error1.phpt b/ext/zlib/tests/gzdeflate_error1.phpt
index 78491af9f1..8abd5bec25 100644
--- a/ext/zlib/tests/gzdeflate_error1.phpt
+++ b/ext/zlib/tests/gzdeflate_error1.phpt
@@ -8,7 +8,7 @@ if (!extension_loaded("zlib")) {
?>
--FILE--
<?php
-/* Prototype : string gzdeflate(string data [, int level])
+/* Prototype : string gzdeflate(string data [, int level, [int encoding]])
* Description: Gzip-compress a string
* Source code: ext/zlib/zlib.c
* Alias to functions:
@@ -28,13 +28,18 @@ var_dump( gzdeflate() );
echo "\n-- Testing gzdeflate() function with more than expected no. of arguments --\n";
$data = 'string_val';
$level = 2;
+$encoding = ZLIB_ENCODING_RAW;
$extra_arg = 10;
-var_dump( gzdeflate($data, $level, $extra_arg) );
+var_dump( gzdeflate($data, $level, $encoding, $extra_arg) );
echo "\n-- Testing with incorrect compression level --\n";
$bad_level = 99;
var_dump(gzdeflate($data, $bad_level));
+echo "\n-- Testing with incorrect encoding --\n";
+$bad_encoding = 99;
+var_dump(gzdeflate($data, $level, $bad_encoding));
+
class Tester {
function Hello() {
echo "Hello\n";
@@ -58,7 +63,7 @@ NULL
-- Testing gzdeflate() function with more than expected no. of arguments --
-Warning: gzdeflate() expects at most 2 parameters, 3 given in %s on line %d
+Warning: gzdeflate() expects at most 3 parameters, 4 given in %s on line %d
NULL
-- Testing with incorrect compression level --
@@ -66,6 +71,11 @@ NULL
Warning: gzdeflate(): compression level (99) must be within -1..9 in %s on line %d
bool(false)
+-- Testing with incorrect encoding --
+
+Warning: gzdeflate(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d
+bool(false)
+
-- Testing with incorrect parameters --
Warning: gzdeflate() expects parameter 1 to be string, object given in %s on line %d
@@ -73,4 +83,4 @@ NULL
Warning: gzdeflate() expects parameter 2 to be long, object given in %s on line %d
NULL
-===Done=== \ No newline at end of file
+===Done===