php-src/ext/openssl/tests/openssl_sign_basic.phpt
Peter Kokot 6426420f61 Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace dirname(__FILE__) by __DIR__ in tests
2019-03-15 23:36:47 +01:00

18 lines
484 B
PHP

--TEST--
openssl_sign() tests
--SKIPIF--
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
$data = "Testing openssl_sign()";
$privkey = "file://" . __DIR__ . "/private_rsa_1024.key";
$wrong = "wrong";
var_dump(openssl_sign($data, $sign, $privkey)); // no output
var_dump(openssl_sign($data, $sign, $wrong));
?>
--EXPECTF--
bool(true)
Warning: openssl_sign(): supplied key param cannot be coerced into a private key in %s on line %d
bool(false)