1--TEST--
2Test imap_fetch_overview() function : basic functionality
3--SKIPIF--
4<?php
5require_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
15echo "*** Testing imap_fetch_overview() : basic functionality ***\n";
16
17require_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
27echo "\n-- All possible arguments --\n";
28$a =  imap_fetch_overview($stream_id, "$msg_no", $options) ;
29echo "\n--> Object #1\n";
30displayOverviewFields($a[0]);
31
32// Calling imap_fetch_overview() with mandatory arguments
33echo "\n-- Mandatory arguments --\n";
34$a = imap_fetch_overview($stream_id, '1:2') ;
35
36//first object in array
37echo "\n--> Object #1\n";
38displayOverviewFields($a[0]);
39
40//Second object in array
41echo "\n--> Object #2\n";
42displayOverviewFields($a[1]);
43
44imap_close($stream_id);
45
46?>
47===DONE===
48--CLEAN--
49<?php
50require_once(dirname(__FILE__).'/clean.inc');
51?>
52--EXPECTF--
53*** Testing imap_fetch_overview() : basic functionality ***
54Create a temporary mailbox and add 2 msgs
55.. mailbox '{%s}%s' created
56
57-- All possible arguments --
58
59--> Object #1
60size is %d
61uid is %d
62msgno is 1
63recent is %d
64flagged is 0
65answered is 0
66deleted is 0
67seen is 0
68draft is 0
69udate is OK
70
71-- Mandatory arguments --
72
73--> Object #1
74size is %d
75uid is %d
76msgno is 1
77recent is %d
78flagged is 0
79answered is 0
80deleted is 0
81seen is 0
82draft is 0
83udate is OK
84
85--> Object #2
86size is %d
87uid is %d
88msgno is 2
89recent is %d
90flagged is 0
91answered is 0
92deleted is 0
93seen is 0
94draft is 0
95udate is OK
96===DONE===
97