1--TEST--
2Phar: verify signature parsing works
3--SKIPIF--
4<?php
5if (!extension_loaded("phar")) die("skip");
6if (!extension_loaded("hash")) die("skip extension hash conflicts");
7$arr = Phar::getSupportedSignatures();
8if (!in_array("OpenSSL", $arr)) die("skip openssl support required");
9if (!in_array('SHA-256', $arr)) die("skip hash extension loaded shared");
10?>
11--INI--
12phar.require_hash=0
13phar.readonly=0
14--FILE--
15<?php
16$a = new Phar(dirname(__FILE__) . '/files/sha1.phar');
17$r = $a->getSignature();
18var_dump($r['hash_type']);
19$a = new Phar(dirname(__FILE__) . '/files/sha512.phar');
20$r = $a->getSignature();
21var_dump($r['hash_type']);
22$a = new Phar(dirname(__FILE__) . '/files/sha256.phar');
23$r = $a->getSignature();
24var_dump($r['hash_type']);
25$a = new Phar(dirname(__FILE__) . '/files/md5.phar');
26$r = $a->getSignature();
27var_dump($r['hash_type']);
28$a = new Phar(dirname(__FILE__) . '/files/openssl.phar');
29$r = $a->getSignature();
30var_dump($r['hash_type']);
31?>
32===DONE===
33--EXPECT--
34string(5) "SHA-1"
35string(7) "SHA-512"
36string(7) "SHA-256"
37string(3) "MD5"
38string(7) "OpenSSL"
39===DONE===
40