]> granicus.if.org Git - php/commitdiff
new test to verify signature algo parsing works
authorGreg Beaver <cellog@php.net>
Sun, 25 Nov 2007 05:24:50 +0000 (05:24 +0000)
committerGreg Beaver <cellog@php.net>
Sun, 25 Nov 2007 05:24:50 +0000 (05:24 +0000)
ext/phar/tests/test_signaturealgos.phpt [new file with mode: 0644]

diff --git a/ext/phar/tests/test_signaturealgos.phpt b/ext/phar/tests/test_signaturealgos.phpt
new file mode 100644 (file)
index 0000000..645cc7e
--- /dev/null
@@ -0,0 +1,30 @@
+--TEST--
+verify signature parsing works
+--SKIPIF--
+<?php if (!extension_loaded("phar")) print "skip"; ?>
+<?php if ( extension_loaded("hash")) print "skip extension hash conflicts"; ?>
+--INI--
+phar.require_hash=0
+phar.readonly=0
+--FILE--
+<?php
+$a = new Phar('sha1.phar');
+$r = $a->getSignature();
+var_dump($r['hash_type']);
+$a = new Phar('sha512.phar');
+$r = $a->getSignature();
+var_dump($r['hash_type']);
+$a = new Phar('sha256.phar');
+$r = $a->getSignature();
+var_dump($r['hash_type']);
+$a = new Phar('md5.phar');
+$r = $a->getSignature();
+var_dump($r['hash_type']);
+?>
+===DONE===
+--EXPECT--
+string(5) "SHA-1"
+string(7) "SHA-512"
+string(7) "SHA-256"
+string(3) "MD5"
+===DONE===