fix tests, add missing break to setSignatureAlgorithm()

This commit is contained in:
Greg Beaver 2007-03-26 00:29:22 +00:00
parent 4af9e7192b
commit 0deb79b705
3 changed files with 51 additions and 24 deletions

View file

@ -389,6 +389,7 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, error); zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, error);
efree(error); efree(error);
} }
break;
default : default :
zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC, zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
"Unknown signature algorithm specified"); "Unknown signature algorithm specified");

View file

@ -39,20 +39,31 @@ echo $e->getMessage();
<?php <?php
unlink(dirname(__FILE__) . '/brandnewphar.phar'); unlink(dirname(__FILE__) . '/brandnewphar.phar');
?> ?>
--EXPECT-- --EXPECTF--
bool(false) array(2) {
array(1) { ["hash"]=>
[hash_type]=> string(%d) "%s"
["hash_type"]=>
string(5) "SHA-1"
}
array(2) {
["hash"]=>
string(%d) "%s"
["hash_type"]=>
string(3) "MD5" string(3) "MD5"
} }
array(1) { array(2) {
[hash_type]=> ["hash"]=>
string(%d) "%s"
["hash_type"]=>
string(5) "SHA-1" 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"
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) { array(2) {
[hash_type]=> ["hash"]=>
string(%d) "%s"
["hash_type"]=>
string(5) "SHA-1" string(5) "SHA-1"
} }
===DONE=== ===DONE===

View file

@ -39,26 +39,41 @@ echo $e->getMessage();
<?php <?php
unlink(dirname(__FILE__) . '/brandnewphar.phar'); unlink(dirname(__FILE__) . '/brandnewphar.phar');
?> ?>
--EXPECT-- --EXPECTF--
bool(false) array(2) {
array(1) { ["hash"]=>
[hash_type]=> string(%d) "%s"
string(3) "MD5" ["hash_type"]=>
}
array(1) {
[hash_type]=>
string(5) "SHA-1" string(5) "SHA-1"
} }
array(1) { array(2) {
[hash_type]=> ["hash"]=>
string(5) "SHA-256" string(%d) "%s"
["hash_type"]=>
string(3) "MD5"
} }
array(1) { array(2) {
[hash_type]=> ["hash"]=>
string(5) "SHA-512" string(%d) "%s"
["hash_type"]=>
string(5) "SHA-1"
} }
array(1) { array(2) {
[hash_type]=> ["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" string(5) "SHA-1"
} }
===DONE=== ===DONE===