Annotation of embedaddon/php/ext/imap/tests/imap_fetch_overview_variation5.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test imap_fetch_overview() function : usage variations - $msg_no argument
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 different sequences/msg numbers as $msg_no argument to test behaviour
17: * of imap_fetch_overview()
18: */
19:
20: echo "*** Testing imap_fetch_overview() : usage variations ***\n";
21: require_once(dirname(__FILE__).'/imap_include.inc');
22:
23: $stream_id = setup_test_mailbox('', 3, $mailbox, 'notSimple'); // set up temp mailbox with 3 msgs
24:
25: $sequences = array (0, 4, '4', // out of range
26: '2', '1,3', '1, 2',
27: '1:3'); // pass uid without setting FT_UID option
28:
29: foreach($sequences as $msg_no) {
30: echo "\n-- \$msg_no is $msg_no --\n";
31: $overview = imap_fetch_overview($stream_id, $msg_no);
32: if (!$overview) {
33: echo imap_last_error() . "\n";
34: } else {
35: foreach($overview as $ov) {
36: echo "\n";
37: displayOverviewFields($ov);
38: }
39: }
40: }
41:
42: // clear error stack
43: imap_errors();
44: ?>
45: ===DONE===
46: --CLEAN--
47: <?php
48: require_once(dirname(__FILE__).'/clean.inc');
49: ?>
50: --EXPECTF--
51: *** Testing imap_fetch_overview() : usage variations ***
52: Create a temporary mailbox and add 3 msgs
53: .. mailbox '{%s}%s' created
54:
55: -- $msg_no is 0 --
56: Sequence out of range
57:
58: -- $msg_no is 4 --
59: Sequence out of range
60:
61: -- $msg_no is 4 --
62: Sequence out of range
63:
64: -- $msg_no is 2 --
65:
66: size is %d
67: uid is %d
68: msgno is 2
69: recent is %d
70: flagged is 0
71: answered is 0
72: deleted is 0
73: seen is 0
74: draft is 0
75: udate is OK
76:
77: -- $msg_no is 1,3 --
78:
79: size is %d
80: uid is %d
81: msgno is 1
82: recent is %d
83: flagged is 0
84: answered is 0
85: deleted is 0
86: seen is 0
87: draft is 0
88: udate is OK
89:
90: size is %d
91: uid is %d
92: msgno is 3
93: recent is %d
94: flagged is 0
95: answered is 0
96: deleted is 0
97: seen is 0
98: draft is 0
99: udate is OK
100:
101: -- $msg_no is 1, 2 --
102: Syntax error in sequence
103:
104: -- $msg_no is 1:3 --
105:
106: size is %d
107: uid is %d
108: msgno is 1
109: recent is %d
110: flagged is 0
111: answered is 0
112: deleted is 0
113: seen is 0
114: draft is 0
115: udate is OK
116:
117: size is %d
118: uid is %d
119: msgno is 2
120: recent is %d
121: flagged is 0
122: answered is 0
123: deleted is 0
124: seen is 0
125: draft is 0
126: udate is OK
127:
128: size is %d
129: uid is %d
130: msgno is 3
131: recent is %d
132: flagged is 0
133: answered is 0
134: deleted is 0
135: seen is 0
136: draft is 0
137: udate is OK
138: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>