Annotation of embedaddon/php/ext/imap/tests/imap_fetch_overview_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test imap_fetch_overview() function : basic functionality
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: echo "*** Testing imap_fetch_overview() : basic functionality ***\n";
16:
17: require_once(dirname(__FILE__).'/imap_include.inc');
18:
19: // create a new mailbox and add two new messages to it
20: $stream_id = setup_test_mailbox('', 2, $mailbox, 'notSimple');
21:
22: // get UID for new message
23: $msg_no = imap_uid($stream_id, 1);
24: $options = FT_UID;
25:
26: // Calling imap_fetch_overview() with all possible arguments
27: echo "\n-- All possible arguments --\n";
28: $a = imap_fetch_overview($stream_id, "$msg_no", $options) ;
29: echo "\n--> Object #1\n";
30: displayOverviewFields($a[0]);
31:
32: // Calling imap_fetch_overview() with mandatory arguments
33: echo "\n-- Mandatory arguments --\n";
34: $a = imap_fetch_overview($stream_id, '1:2') ;
35:
36: //first object in array
37: echo "\n--> Object #1\n";
38: displayOverviewFields($a[0]);
39:
40: //Second object in array
41: echo "\n--> Object #2\n";
42: displayOverviewFields($a[1]);
43:
44: imap_close($stream_id);
45:
46: ?>
47: ===DONE===
48: --CLEAN--
49: <?php
50: require_once(dirname(__FILE__).'/clean.inc');
51: ?>
52: --EXPECTF--
53: *** Testing imap_fetch_overview() : basic functionality ***
54: Create a temporary mailbox and add 2 msgs
55: .. mailbox '{%s}%s' created
56:
57: -- All possible arguments --
58:
59: --> Object #1
60: size is %d
61: uid is %d
62: msgno is 1
63: recent is %d
64: flagged is 0
65: answered is 0
66: deleted is 0
67: seen is 0
68: draft is 0
69: udate is OK
70:
71: -- Mandatory arguments --
72:
73: --> Object #1
74: size is %d
75: uid is %d
76: msgno is 1
77: recent is %d
78: flagged is 0
79: answered is 0
80: deleted is 0
81: seen is 0
82: draft is 0
83: udate is OK
84:
85: --> Object #2
86: size is %d
87: uid is %d
88: msgno is 2
89: recent is %d
90: flagged is 0
91: answered is 0
92: deleted is 0
93: seen is 0
94: draft is 0
95: udate is OK
96: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>