tony2001 Sat Jul 29 22:41:34 2006 UTC Modified files: /php-src/ext/openssl/tests bug38255.phpt Log: MFB: improve test http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/bug38255.phpt?r1=1.1&r2=1.2&diff_format=u Index: php-src/ext/openssl/tests/bug38255.phpt diff -u php-src/ext/openssl/tests/bug38255.phpt:1.1 php-src/ext/openssl/tests/bug38255.phpt:1.2 --- php-src/ext/openssl/tests/bug38255.phpt:1.1 Sat Jul 29 22:24:48 2006 +++ php-src/ext/openssl/tests/bug38255.phpt Sat Jul 29 22:41:34 2006 @@ -9,6 +9,47 @@ $pub_key_id = false; $signature = ''; $ok = openssl_verify("foo", $signature, $pub_key_id, OPENSSL_ALGO_MD5); + +class test { + function __toString() { + return "test object"; + } +} +$t = new test; + + +var_dump(openssl_verify("foo", $signature, $pub_key_id, OPENSSL_ALGO_MD5)); +var_dump(openssl_verify("foo", $t, $pub_key_id, OPENSSL_ALGO_MD5)); +var_dump(openssl_verify("foo", new stdClass, $pub_key_id, OPENSSL_ALGO_MD5)); +var_dump(openssl_verify("foo", new stdClass, array(), OPENSSL_ALGO_MD5)); +var_dump(openssl_verify("foo", array(), array(), OPENSSL_ALGO_MD5)); +var_dump(openssl_verify()); +var_dump(openssl_verify(new stdClass, new stdClass, array(), 10000)); + +echo "Done\n"; + ?> --EXPECTF-- -Warning: openssl_verify(): supplied key param cannot be coerced into a public key in %s/bug38255.php on line %d +Warning: openssl_verify(): supplied key param cannot be coerced into a public key in %s on line %d + +Warning: openssl_verify(): supplied key param cannot be coerced into a public key in %s on line %d +bool(false) + +Warning: openssl_verify(): supplied key param cannot be coerced into a public key in %s on line %d +bool(false) + +Warning: openssl_verify() expects parameter 2 to be string, object given in %s on line %d +NULL + +Warning: openssl_verify() expects parameter 2 to be string, object given in %s on line %d +NULL + +Warning: openssl_verify() expects parameter 2 to be string, array given in %s on line %d +NULL + +Warning: openssl_verify() expects at least 3 parameters, 0 given in %s on line %d +NULL + +Warning: openssl_verify() expects parameter 1 to be string, object given in %s on line %d +NULL +Done
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php