gzencode_variation2.phpt 1004 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Test gzencode() function : variation - verify header contents with all encoding modes
  3. --EXTENSIONS--
  4. zlib
  5. --SKIPIF--
  6. <?php
  7. if( substr(PHP_OS, 0, 3) == "WIN" ) {
  8. die("skip.. Do not run on Windows");
  9. }
  10. if (PHP_OS == "Darwin") {
  11. print "skip - OS is encoded in headers, tested header is non Darwin";
  12. }
  13. ?>
  14. --FILE--
  15. <?php
  16. echo "*** Testing gzencode() : variation ***\n";
  17. $data = "A small string to encode\n";
  18. echo "\n-- Testing with each encoding_mode --\n";
  19. var_dump(bin2hex(gzencode($data, -1)));
  20. var_dump(bin2hex(gzencode($data, -1, FORCE_GZIP)));
  21. var_dump(bin2hex(gzencode($data, -1, FORCE_DEFLATE)));
  22. ?>
  23. --EXPECT--
  24. *** Testing gzencode() : variation ***
  25. -- Testing with each encoding_mode --
  26. string(90) "1f8b0800000000000003735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
  27. string(90) "1f8b0800000000000003735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200d7739de519000000"
  28. string(66) "789c735428ce4dccc951282e29cacc4b5728c95748cd4bce4f49e50200735808cd"