2 Test imap_fetch_overview() function : usage variations - FT_UID option
5 require_once(dirname(__FILE__).'/skipif.inc');
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 of the given message sequence
11 * Source code: ext/imap/php_imap.c
15 * Test passing a range of values into the $options argument to imap_fetch_overview():
16 * 1. values that equate to 1
17 * 2. Minimum and maximum PHP values
20 echo "*** Testing imap_fetch_overview() : usage variations ***\n";
22 require_once(dirname(__FILE__).'/imap_include.inc');
24 // Initialise required variables
25 $stream_id = setup_test_mailbox('', 1); // set up temporary mailbox with one simple message
27 $msg_uid = imap_uid($stream_id, $msg_no);
29 $options = array ('1',
37 // iterate over each element of $options array
39 imap_check($stream_id);
40 foreach($options as $option) {
41 echo "\nTesting with option value:";
43 $overview = imap_fetch_overview($stream_id, $msg_uid, $option);
45 echo "imap_fetch_overview() returns an object\n";
54 require_once(dirname(__FILE__).'/clean.inc');
57 *** Testing imap_fetch_overview() : usage variations ***
58 Create a temporary mailbox and add 1 msgs
59 .. mailbox '{%s}%s' created
61 Testing with option value:%string|unicode%(1) "1"
62 imap_fetch_overview() returns an object
64 Testing with option value:bool(true)
65 imap_fetch_overview() returns an object
67 Testing with option value:float(1)
68 imap_fetch_overview() returns an object
70 Testing with option value:float(1)
71 imap_fetch_overview() returns an object
73 Testing with option value:int(%d)
75 Warning: imap_fetch_overview(): invalid value for the options parameter in %s on line %d
77 Testing with option value:int(-%d)
79 Warning: imap_fetch_overview(): invalid value for the options parameter in %s on line %d