File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
openssl /
tests /
openssl_encrypt_error.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:47:59 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
openssl_encrypt() error tests
--SKIPIF--
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
$data = "openssl_encrypt() tests";
$method = "AES-128-CBC";
$password = "openssl";
$wrong = "wrong";
$object = new stdclass;
$arr = array(1);
var_dump(openssl_encrypt($data, $wrong, $password));
var_dump(openssl_encrypt($object, $method, $password));
var_dump(openssl_encrypt($data, $object, $password));
var_dump(openssl_encrypt($data, $method, $object));
var_dump(openssl_encrypt($arr, $method, $object));
var_dump(openssl_encrypt($data, $arr, $object));
var_dump(openssl_encrypt($data, $method, $arr));
?>
--EXPECTF--
Warning: openssl_encrypt(): Unknown cipher algorithm in %s on line %d
bool(false)
Warning: openssl_encrypt() expects parameter 1 to be string, object given in %s on line %d
NULL
Warning: openssl_encrypt() expects parameter 2 to be string, object given in %s on line %d
NULL
Warning: openssl_encrypt() expects parameter 3 to be string, object given in %s on line %d
NULL
Warning: openssl_encrypt() expects parameter 1 to be string, array given in %s on line %d
NULL
Warning: openssl_encrypt() expects parameter 2 to be string, array given in %s on line %d
NULL
Warning: openssl_encrypt() expects parameter 3 to be string, array given in %s on line %d
NULL
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>