From: Greg Beaver Date: Mon, 26 Mar 2007 00:29:22 +0000 (+0000) Subject: fix tests, add missing break to setSignatureAlgorithm() X-Git-Tag: RELEASE_1_1_0~113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0deb79b705c40e57720a080b99ab1cacb640a8b9;p=php fix tests, add missing break to setSignatureAlgorithm() --- diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 5d8db91181..792f2e5699 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -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"); diff --git a/ext/phar/tests/phar_setsignaturealgo1.phpt b/ext/phar/tests/phar_setsignaturealgo1.phpt index 1b206f2668..7aaae500d9 100644 --- a/ext/phar/tests/phar_setsignaturealgo1.phpt +++ b/ext/phar/tests/phar_setsignaturealgo1.phpt @@ -39,20 +39,31 @@ echo $e->getMessage(); ---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=== diff --git a/ext/phar/tests/phar_setsignaturealgo2.phpt b/ext/phar/tests/phar_setsignaturealgo2.phpt index 83168430e7..47ec0e4ca3 100644 --- a/ext/phar/tests/phar_setsignaturealgo2.phpt +++ b/ext/phar/tests/phar_setsignaturealgo2.phpt @@ -39,26 +39,41 @@ echo $e->getMessage(); ---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" } -array(1) { - [hash_type]=> - string(5) "SHA-256" +array(2) { + ["hash"]=> + string(%d) "%s" + ["hash_type"]=> + string(7) "SHA-256" } -array(1) { - [hash_type]=> - string(5) "SHA-512" +array(2) { + ["hash"]=> + string(%d) "%s" + ["hash_type"]=> + string(7) "SHA-512" } -array(1) { - [hash_type]=> +array(2) { + ["hash"]=> + string(%d) "%s" + ["hash_type"]=> string(5) "SHA-1" } ===DONE===