Annotation of embedaddon/php/ext/imap/tests/imap_body.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: imap_body() incorrect parameter count
3: --CREDITS--
4: Paul Sohier
5: #phptestfest utrecht
6: --SKIPIF--
7: <?php
8: require_once(dirname(__FILE__).'/skipif.inc');
9: ?>
10: --FILE--
11: <?php
12: echo "Checking with no parameters\n";
13: imap_body();
14:
15: echo "Checking with incorrect parameter type\n";
16: imap_body('');
17: imap_body(false);
18: require_once(dirname(__FILE__).'/imap_include.inc');
19: $stream_id = imap_open($default_mailbox, $username, $password) or
20: die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
21: imap_body($stream_id);
22: imap_body($stream_id,-1);
23: imap_body($stream_id,1,-1);
24:
25: //Access not existing
26: var_dump(imap_body($stream_id, 999, FT_UID));
27:
28: imap_close($stream_id);
29:
30: ?>
31: --EXPECTF--
32: Checking with no parameters
33:
34: Warning: imap_body() expects at least 2 parameters, 0 given in %s on line %d
35: Checking with incorrect parameter type
36:
37: Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d
38:
39: Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d
40:
41: Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d
42:
43: Warning: imap_body(): Bad message number in %s on line %d
44:
45: Warning: imap_body(): invalid value for the options parameter in %s on line %d
46:
47: Warning: imap_body(): Bad message number in %s on line %d
48: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>