tony2001                Sat Jul 29 22:41:19 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/openssl/tests  bug38255.phpt 
  Log:
  improve test
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/openssl/tests/bug38255.phpt?r1=1.1.2.2&r2=1.1.2.3&diff_format=u
Index: php-src/ext/openssl/tests/bug38255.phpt
diff -u php-src/ext/openssl/tests/bug38255.phpt:1.1.2.2 
php-src/ext/openssl/tests/bug38255.phpt:1.1.2.3
--- php-src/ext/openssl/tests/bug38255.phpt:1.1.2.2     Sat Jul 29 22:27:54 2006
+++ php-src/ext/openssl/tests/bug38255.phpt     Sat Jul 29 22:41:19 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

Reply via email to