- fix test if ext/zlib is not loaded
authorMichael Wallner <mike@php.net>
Mon, 10 Oct 2005 19:51:38 +0000 (19:51 +0000)
committerMichael Wallner <mike@php.net>
Mon, 10 Oct 2005 19:51:38 +0000 (19:51 +0000)
tests/encodings.phpt

index e66eabd8f9298752414a3a34e5caaafd80c92605..f14867fc32d21759d8796e8e9ecc7923dd8e4e13 100644 (file)
@@ -25,19 +25,19 @@ var_dump($s == http_gzdecode(http_gzencode($s)));
 var_dump($s == http_inflate(http_deflate($s)));
 var_dump($s == http_uncompress(http_compress($s)));
 
-
-$s = "A simple test string, which won't blow up ext/zlib.\n";
-
-var_dump($s == http_gzdecode(gzencode($s)));
-var_dump($s == http_inflate(gzdeflate($s)));
-var_dump($s == http_uncompress(gzcompress($s)));
-
-/* no gzdecode in ext/zlib
-var_dump($s == gzdecode(http_gzencode($s))); */
-var_dump($s == gzinflate(http_deflate($s)));
-var_dump($s == gzuncompress(http_compress($s)));
-
 if (extension_loaded('zlib')) {
+       
+       $s = "A simple test string, which won't blow up ext/zlib.\n";
+       
+       ($s == http_gzdecode(gzencode($s))) or print "GZIP Failed\n";
+       ($s == http_inflate(gzdeflate($s))) or print "DEFLATE Failed\n";
+       ($s == http_uncompress(gzcompress($s))) or print "COMPRESS Failed\n";
+       
+       /* no gzdecode in ext/zlib
+       ($s == gzdecode(http_gzencode($s))) or print "GZIP Failed\n"; */
+       ($s == gzinflate(http_deflate($s))) or print "DEFLATE Failed\n";
+       ($s == gzuncompress(http_compress($s))) or print "COMPRESS Failed\n";
+       
        (gzencode($s) == http_gzencode($s)) or print "GZIP Failed\n";
        (gzdeflate($s) == http_deflate($s)) or print "DEFLATE Failed\n";
        (gzcompress($s) == http_compress($s)) or print "COMPRESS Failed\n";
@@ -50,9 +50,4 @@ echo "Done\n";
 bool(true)
 bool(true)
 bool(true)
-bool(true)
-bool(true)
-bool(true)
-bool(true)
-bool(true)
 Done