mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
fix tests, add missing break to setSignatureAlgorithm()
This commit is contained in:
parent
4af9e7192b
commit
0deb79b705
3 changed files with 51 additions and 24 deletions
|
@ -389,6 +389,7 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
|
|||
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, error);
|
||||
efree(error);
|
||||
}
|
||||
break;
|
||||
default :
|
||||
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
|
||||
"Unknown signature algorithm specified");
|
||||
|
|
|
@ -39,20 +39,31 @@ echo $e->getMessage();
|
|||
<?php
|
||||
unlink(dirname(__FILE__) . '/brandnewphar.phar');
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
array(1) {
|
||||
[hash_type]=>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
["hash"]=>
|
||||
string(%d) "%s"
|
||||
["hash_type"]=>
|
||||
string(5) "SHA-1"
|
||||
}
|
||||
array(2) {
|
||||
["hash"]=>
|
||||
string(%d) "%s"
|
||||
["hash_type"]=>
|
||||
string(3) "MD5"
|
||||
}
|
||||
array(1) {
|
||||
[hash_type]=>
|
||||
array(2) {
|
||||
["hash"]=>
|
||||
string(%d) "%s"
|
||||
["hash_type"]=>
|
||||
string(5) "SHA-1"
|
||||
}
|
||||
string (82) "SHA-256 and SHA-512 signatures are only supported if the hash extension is enabled"
|
||||
string (82) "SHA-256 and SHA-512 signatures are only supported if the hash extension is enabled"
|
||||
array(1) {
|
||||
[hash_type]=>
|
||||
array(2) {
|
||||
["hash"]=>
|
||||
string(%d) "%s"
|
||||
["hash_type"]=>
|
||||
string(5) "SHA-1"
|
||||
}
|
||||
===DONE===
|
||||
|
|
|
@ -39,26 +39,41 @@ echo $e->getMessage();
|
|||
<?php
|
||||
unlink(dirname(__FILE__) . '/brandnewphar.phar');
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(false)
|
||||
array(1) {
|
||||
[hash_type]=>
|
||||
string(3) "MD5"
|
||||
}
|
||||
array(1) {
|
||||
[hash_type]=>
|
||||
--EXPECTF--
|
||||
array(2) {
|
||||
["hash"]=>
|
||||
string(%d) "%s"
|
||||
["hash_type"]=>
|
||||
string(5) "SHA-1"
|
||||
}
|
||||
array(1) {
|
||||
[hash_type]=>
|
||||
string(5) "SHA-256"
|
||||
array(2) {
|
||||
["hash"]=>
|
||||
string(%d) "%s"
|
||||
["hash_type"]=>
|
||||
string(3) "MD5"
|
||||
}
|
||||
array(1) {
|
||||
[hash_type]=>
|
||||
string(5) "SHA-512"
|
||||
array(2) {
|
||||
["hash"]=>
|
||||
string(%d) "%s"
|
||||
["hash_type"]=>
|
||||
string(5) "SHA-1"
|
||||
}
|
||||
array(1) {
|
||||
[hash_type]=>
|
||||
array(2) {
|
||||
["hash"]=>
|
||||
string(%d) "%s"
|
||||
["hash_type"]=>
|
||||
string(7) "SHA-256"
|
||||
}
|
||||
array(2) {
|
||||
["hash"]=>
|
||||
string(%d) "%s"
|
||||
["hash_type"]=>
|
||||
string(7) "SHA-512"
|
||||
}
|
||||
array(2) {
|
||||
["hash"]=>
|
||||
string(%d) "%s"
|
||||
["hash_type"]=>
|
||||
string(5) "SHA-1"
|
||||
}
|
||||
===DONE===
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue