xref: /PHP-5.3/ext/openssl/tests/012.phpt (revision 0890b92f)
1--TEST--
2openssl_seal() error tests
3--SKIPIF--
4<?php if (!extension_loaded("openssl")) print "skip"; ?>
5--FILE--
6<?php
7$data = "openssl_open() test";
8$pub_key = "file://" . dirname(__FILE__) . "/public.key";
9$wrong = "wrong";
10
11openssl_seal($data, $sealed, $ekeys, array($pub_key));                  // no output
12openssl_seal($data, $sealed, $ekeys, array($pub_key, $pub_key));        // no output
13openssl_seal($data, $sealed, $ekeys, array($pub_key, $wrong));
14openssl_seal($data, $sealed, $ekeys, $pub_key);
15openssl_seal($data, $sealed, $ekeys, array());
16openssl_seal($data, $sealed, $ekeys, array($wrong));
17?>
18--EXPECTF--
19
20Warning: openssl_seal(): not a public key (2th member of pubkeys) in %s on line %d
21
22Warning: openssl_seal() expects parameter 4 to be array, string given in %s on line %d
23
24Warning: openssl_seal(): Fourth argument to openssl_seal() must be a non-empty array in %s on line %d
25
26Warning: openssl_seal(): not a public key (1th member of pubkeys) in %s on line %d
27
28