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