]> granicus.if.org Git - php/commitdiff
add new tests for Phar::getSupportedCompression
authorGreg Beaver <cellog@php.net>
Sun, 25 Nov 2007 04:43:01 +0000 (04:43 +0000)
committerGreg Beaver <cellog@php.net>
Sun, 25 Nov 2007 04:43:01 +0000 (04:43 +0000)
ext/phar/tests/phar_get_supportedcomp1.phpt [new file with mode: 0644]
ext/phar/tests/phar_get_supportedcomp2.phpt [new file with mode: 0644]
ext/phar/tests/phar_get_supportedcomp3.phpt [new file with mode: 0644]
ext/phar/tests/phar_get_supportedcomp4.phpt [new file with mode: 0644]

diff --git a/ext/phar/tests/phar_get_supportedcomp1.phpt b/ext/phar/tests/phar_get_supportedcomp1.phpt
new file mode 100644 (file)
index 0000000..e80e038
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+Phar::getSupportedCompression() (bz2 and zlib)
+--SKIPIF--
+<?php if (!extension_loaded("phar")) print "skip"; ?>
+<?php if (!extension_loaded("spl")) print "skip SPL not available"; ?>
+<?php if (!extension_loaded("bz2")) print "skip bz2 not available"; ?>
+<?php if (!extension_loaded("zlib")) print "skip zlib not available"; ?>
+--INI--
+phar.require_hash=0
+--FILE--
+<?php
+var_dump(Phar::getSupportedCompression());
+?>
+===DONE===
+--EXPECT--
+array(2) {
+  [0]=>
+  string(2) "GZ"
+  [1]=>
+  string(5) "BZIP2"
+}
+===DONE===
\ No newline at end of file
diff --git a/ext/phar/tests/phar_get_supportedcomp2.phpt b/ext/phar/tests/phar_get_supportedcomp2.phpt
new file mode 100644 (file)
index 0000000..9148c13
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+Phar::getSupportedCompression() (bz2)
+--SKIPIF--
+<?php if (!extension_loaded("phar")) print "skip"; ?>
+<?php if (!extension_loaded("spl")) print "skip SPL not available"; ?>
+<?php if (!extension_loaded("bz2")) print "skip bz2 not available"; ?>
+<?php if (extension_loaded("zlib")) print "skip zlib is available"; ?>
+--INI--
+phar.require_hash=0
+--FILE--
+<?php
+var_dump(Phar::getSupportedCompression());
+?>
+===DONE===
+--EXPECT--
+array(2) {
+  [0]=>
+  string(5) "BZIP2"
+}
+===DONE===
\ No newline at end of file
diff --git a/ext/phar/tests/phar_get_supportedcomp3.phpt b/ext/phar/tests/phar_get_supportedcomp3.phpt
new file mode 100644 (file)
index 0000000..53f0693
--- /dev/null
@@ -0,0 +1,20 @@
+--TEST--
+Phar::getSupportedCompression() (zlib)
+--SKIPIF--
+<?php if (!extension_loaded("phar")) print "skip"; ?>
+<?php if (!extension_loaded("spl")) print "skip SPL not available"; ?>
+<?php if (extension_loaded("bz2")) print "skip bz2 is available"; ?>
+<?php if (!extension_loaded("zlib")) print "skip zlib not available"; ?>
+--INI--
+phar.require_hash=0
+--FILE--
+<?php
+var_dump(Phar::getSupportedCompression());
+?>
+===DONE===
+--EXPECT--
+array(2) {
+  [0]=>
+  string(5) "GZ"
+}
+===DONE===
\ No newline at end of file
diff --git a/ext/phar/tests/phar_get_supportedcomp4.phpt b/ext/phar/tests/phar_get_supportedcomp4.phpt
new file mode 100644 (file)
index 0000000..adaa95d
--- /dev/null
@@ -0,0 +1,16 @@
+--TEST--
+Phar::getSupportedCompression() (none)
+--SKIPIF--
+<?php if (!extension_loaded("phar")) print "skip"; ?>
+<?php if (!extension_loaded("spl")) print "skip SPL not available"; ?>
+<?php if (extension_loaded("bz2")) print "skip bz2 is available"; ?>
+<?php if (extension_loaded("zlib")) print "skip zlib is available"; ?>
+--FILE--
+<?php
+var_dump(Phar::getSupportedCompression());
+?>
+===DONE===
+--EXPECT--
+array(0) {
+}
+===DONE===
\ No newline at end of file