make test more flexible to match different compressed strings

particurarly needed with zlib 1.2.11
This commit is contained in:
Anatol Belski 2017-03-22 02:33:38 +01:00
parent 5096a429a1
commit f258e9b803
7 changed files with 15 additions and 10 deletions

View file

@ -41,11 +41,11 @@ bool(false)
Warning: gzencode(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d
bool(false)
string(%d) "%s"
string(%d) "%s"
string(%d) "%a"
string(%d) "%a"
Warning: gzencode(): encoding mode must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP or ZLIB_ENCODING_DEFLATE in %s on line %d
bool(false)
string(%d) "%s"
string(%d) "%s"
string(%d) "%a"
string(%d) "%a"
Done

View file

@ -14,7 +14,7 @@ header('Vary: Cookie');
echo 'foo';
?>
--EXPECTF--
%s
%a
--EXPECTHEADERS--
Vary: Cookie
Content-Encoding: gzip

Binary file not shown.

View file

@ -10,6 +10,11 @@ if( substr(PHP_OS, 0, 3) != "WIN" ) {
if (!extension_loaded("zlib")) {
print "skip - ZLIB extension not loaded";
}
include 'func.inc';
if (version_compare(get_zlib_version(), "1.2.11") < 0) {
die("skip - at least zlib 1.2.11 required, got " . get_zlib_version());
}
?>
--FILE--
<?php
@ -34,7 +39,7 @@ var_dump(bin2hex(gzencode($data, -1, FORCE_DEFLATE)));
*** Testing gzencode() : variation ***
-- Testing with each encoding_mode --
string(90) "1f8b080000000000000b735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
string(90) "1f8b080000000000000b735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
string(90) "1f8b080000000000000a735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
string(90) "1f8b080000000000000a735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
string(66) "789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd"
===DONE===

View file

@ -16,5 +16,5 @@ HTTP_ACCEPT_ENCODING=gzip
echo "hi\n";
?>
--EXPECTF--
<EFBFBD>%s
%a

View file

@ -17,7 +17,7 @@ ini_set("zlib.output_compression", 1);
echo "hi\n";
?>
--EXPECTF--
<EFBFBD>%s
%a
--EXPECTHEADERS--
Content-Encoding: gzip
Vary: Accept-Encoding

View file

@ -17,7 +17,7 @@ ob_start("ob_gzhandler");
echo "hi\n";
?>
--EXPECTF--
<EFBFBD>%s
%a
--EXPECTHEADERS--
Content-Encoding: gzip
Vary: Accept-Encoding