diff options
Diffstat (limited to 'ext/openssl/tests/openssl_x509_export_basic.phpt')
| -rw-r--r-- | ext/openssl/tests/openssl_x509_export_basic.phpt | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/openssl/tests/openssl_x509_export_basic.phpt b/ext/openssl/tests/openssl_x509_export_basic.phpt index 03baae9266..43dc843b70 100644 --- a/ext/openssl/tests/openssl_x509_export_basic.phpt +++ b/ext/openssl/tests/openssl_x509_export_basic.phpt @@ -16,7 +16,12 @@ var_dump(openssl_x509_export($a, $output)); // read cert as a binary string var_dump(openssl_x509_export($b, $output2)); // read cert from a filename string var_dump(openssl_x509_export($c, $output3)); // read an invalid cert, fails var_dump(openssl_x509_export($d, $output4)); // read cert from a resource -var_dump(openssl_x509_export($e, $output5)); // read an array, fails + +try { + openssl_x509_export($e, $output5); // read an array, fails +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} if (PHP_EOL !== "\n") { $a = str_replace(PHP_EOL, "\n", $a); @@ -32,12 +37,10 @@ var_dump(strcmp($output, $output5)); // different bool(true) bool(true) -Warning: openssl_x509_export(): Cannot get cert from parameter 1 in %s on line %d +Warning: openssl_x509_export(): X.509 Certificate cannot be retrieved in %s on line %d bool(false) bool(true) - -Warning: openssl_x509_export(): Cannot get cert from parameter 1 in %s on line %d -bool(false) +openssl_x509_export(): Argument #1 ($x509) must be of type OpenSSLCertificate|string, array given int(0) int(0) int(%d) |
