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

1.1       misho       1: --TEST--
                      2: Test gzencode() function : variation - verify header contents with all encoding modes
                      3: --SKIPIF--
                      4: <?php 
                      5: 
1.1.1.2 ! misho       6: if( substr(PHP_OS, 0, 3) == "WIN" ) {
        !             7:   die("skip.. Do not run on Windows");
        !             8: }
        !             9: 
1.1       misho      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: 
                     22: echo "*** Testing gzencode() : variation ***\n";
                     23: 
                     24: $data = "A small string to encode\n";
                     25: 
                     26: echo "\n-- Testing with each encoding_mode  --\n";
                     27: var_dump(bin2hex(gzencode($data, -1)));
                     28: var_dump(bin2hex(gzencode($data, -1, FORCE_GZIP)));  
                     29: var_dump(bin2hex(gzencode($data, -1, FORCE_DEFLATE)));
                     30: 
                     31: ?>
                     32: ===DONE===
                     33: --EXPECTF--
                     34: *** Testing gzencode() : variation ***
                     35: 
                     36: -- Testing with each encoding_mode  --
                     37: string(90) "1f8b0800000000000003735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
                     38: string(90) "1f8b0800000000000003735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
1.1.1.2 ! misho      39: string(66) "789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd"
        !            40: ===DONE===

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