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