Annotation of embedaddon/php/ext/zlib/tests/gzencode_variation1-win32.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test gzencode() function : variation
3: --SKIPIF--
4: <?php
5:
6: if( substr(PHP_OS, 0, 3) != "WIN" ) {
7: die("skip only for Windows");
8: }
9:
10: if (!extension_loaded("zlib")) {
11: print "skip - ZLIB extension not loaded";
12: }
13: ?>
14: --FILE--
15: <?php
16: /* Prototype : string gzencode ( string $data [, int $level [, int $encoding_mode ]] )
17: * Description: Gzip-compress a string
18: * Source code: ext/zlib/zlib.c
19: * Alias to functions:
20: */
21:
1.1.1.2 ! misho 22: if(!function_exists("gzdecode")) {
! 23: function gzdecode($data)
! 24: {
! 25: return gzinflate(substr($data,10,-8));
! 26: }
! 27: }
! 28:
! 29:
1.1 misho 30: include(dirname(__FILE__) . '/data.inc');
31:
32: echo "*** Testing gzencode() : variation ***\n";
33:
34: echo "\n-- Testing multiple compression --\n";
1.1.1.2 ! misho 35: $output = gzencode(gzencode($data));
1.1 misho 36:
1.1.1.2 ! misho 37: $back = gzdecode(gzdecode($output));
! 38: var_dump($data === $back);
1.1 misho 39: ?>
40: ===Done===
41: --EXPECT--
42: *** Testing gzencode() : variation ***
43:
44: -- Testing multiple compression --
1.1.1.2 ! misho 45: bool(true)
1.1 misho 46: ===Done===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>