Annotation of embedaddon/php/ext/imap/tests/imap_fetch_overview_error.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test imap_fetch_overview() function : error conditions - incorrect number of args
3: --SKIPIF--
4: <?php
5: require_once(dirname(__FILE__).'/skipif.inc');
6: ?>
7: --FILE--
8: <?php
9: /* Prototype : array imap_fetch_overview(resource $stream_id, int $msg_no [, int $options])
10: * Description: Read an overview of the information in the headers
11: * of the given message sequence
12: * Source code: ext/imap/php_imap.c
13: */
14:
15: /*
16: * Pass an incorrect number of arguments to imap_fetch_overview() to test behaviour
17: */
18:
19: echo "*** Testing imap_fetch_overview() : error conditions ***\n";
20:
21: require_once(dirname(__FILE__).'/imap_include.inc');
22:
23: //Test imap_fetch_overview with one more than the expected number of arguments
24: echo "\n-- Testing imap_fetch_overview() function with more than expected no. of arguments --\n";
25: $stream_id = setup_test_mailbox('', 2, $mailbox, 'notSimple'); // set up temp mailbox with 2 msgs
26: $msg_no = 1;
27: $options = FT_UID;
28: $extra_arg = 10;
29: var_dump( imap_fetch_overview($stream_id, $msg_no, $options, $extra_arg) );
30:
31: // Testing imap_fetch_overview with one less than the expected number of arguments
32: echo "\n-- Testing imap_fetch_overview() function with less than expected no. of arguments --\n";
33: var_dump( imap_fetch_overview($stream_id) );
34: ?>
35: ===DONE===
36: --CLEAN--
37: <?php
38: require_once(dirname(__FILE__).'/clean.inc');
39: ?>
40: --EXPECTF--
41: *** Testing imap_fetch_overview() : error conditions ***
42:
43: -- Testing imap_fetch_overview() function with more than expected no. of arguments --
44: Create a temporary mailbox and add 2 msgs
45: .. mailbox '{%s}%s' created
46:
47: Warning: imap_fetch_overview() expects at most 3 parameters, 4 given in %s on line %d
48: NULL
49:
50: -- Testing imap_fetch_overview() function with less than expected no. of arguments --
51:
52: Warning: imap_fetch_overview() expects at least 2 parameters, 1 given in %s on line %d
53: NULL
54: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>