1--TEST--
2Test imap_fetch_overview() function : basic functionality
3--EXTENSIONS--
4imap
5--SKIPIF--
6<?php
7require_once(__DIR__.'/setup/skipif.inc');
8?>
9--FILE--
10<?php
11echo "*** Testing imap_fetch_overview() : basic functionality ***\n";
12
13require_once __DIR__.'/setup/imap_include.inc';
14
15// create a new mailbox and add two new messages to it
16$stream_id = setup_test_mailbox('imapfetchoverviewbasic', 2, $mailbox, false);
17
18// get UID for new message
19$msg_no = imap_uid($stream_id, 1);
20$options = FT_UID;
21
22// Calling imap_fetch_overview() with all possible arguments
23echo "\n-- All possible arguments --\n";
24$a =  imap_fetch_overview($stream_id, "$msg_no", $options) ;
25echo "\n--> Object #1\n";
26displayOverviewFields($a[0]);
27
28// Calling imap_fetch_overview() with mandatory arguments
29echo "\n-- Mandatory arguments --\n";
30$a = imap_fetch_overview($stream_id, '1:2') ;
31
32//first object in array
33echo "\n--> Object #1\n";
34displayOverviewFields($a[0]);
35
36//Second object in array
37echo "\n--> Object #2\n";
38displayOverviewFields($a[1]);
39
40imap_close($stream_id);
41
42?>
43--CLEAN--
44<?php
45$mailbox_suffix = 'imapfetchoverviewbasic';
46require_once __DIR__.'/setup/clean.inc';
47?>
48--EXPECTF--
49*** Testing imap_fetch_overview() : basic functionality ***
50Create a temporary mailbox and add 2 msgs
51New mailbox created
52
53-- All possible arguments --
54
55--> Object #1
56size is %d
57uid is %d
58msgno is 1
59recent is %d
60flagged is 0
61answered is 0
62deleted is 0
63seen is 0
64draft is 0
65udate is OK
66
67-- Mandatory arguments --
68
69--> Object #1
70size is %d
71uid is %d
72msgno is 1
73recent is %d
74flagged is 0
75answered is 0
76deleted is 0
77seen is 0
78draft is 0
79udate is OK
80
81--> Object #2
82size is %d
83uid is %d
84msgno is 2
85recent is %d
86flagged is 0
87answered is 0
88deleted is 0
89seen is 0
90draft is 0
91udate is OK
92