Annotation of embedaddon/php/ext/zlib/tests/gzencode_variation2.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test gzencode() function : variation - verify header contents with all encoding modes
                      3: --SKIPIF--
                      4: <?php 
                      5: 
                      6: if (!extension_loaded("zlib")) {
                      7:        print "skip - ZLIB extension not loaded"; 
                      8: }       
                      9: ?> 
                     10: --FILE--
                     11: <?php
                     12: /* Prototype  : string gzencode  ( string $data  [, int $level  [, int $encoding_mode  ]] )
                     13:  * Description: Gzip-compress a string 
                     14:  * Source code: ext/zlib/zlib.c
                     15:  * Alias to functions: 
                     16:  */
                     17: 
                     18: echo "*** Testing gzencode() : variation ***\n";
                     19: 
                     20: $data = "A small string to encode\n";
                     21: 
                     22: echo "\n-- Testing with each encoding_mode  --\n";
                     23: var_dump(bin2hex(gzencode($data, -1)));
                     24: var_dump(bin2hex(gzencode($data, -1, FORCE_GZIP)));  
                     25: var_dump(bin2hex(gzencode($data, -1, FORCE_DEFLATE)));
                     26: 
                     27: ?>
                     28: ===DONE===
                     29: --EXPECTF--
                     30: *** Testing gzencode() : variation ***
                     31: 
                     32: -- Testing with each encoding_mode  --
                     33: string(90) "1f8b0800000000000003735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
                     34: string(90) "1f8b0800000000000003735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
                     35: string(86) "1f8b0800000000000003789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd"
                     36: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>