1--TEST--
2Test imap_fetch_overview() function : usage variations - FT_UID option
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 of the given message sequence
11 * Source code: ext/imap/php_imap.c
12 */
13
14/*
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
18 */
19
20echo "*** Testing imap_fetch_overview() : usage variations ***\n";
21
22require_once(dirname(__FILE__).'/imap_include.inc');
23
24// Initialise required variables
25$stream_id = setup_test_mailbox('', 1); // set up temporary mailbox with one simple message
26$msg_no = 1;
27$msg_uid = imap_uid($stream_id, $msg_no);
28
29$options = array ('1',
30                  true,
31                  1.000000000000001,
32                  0.00001e5,
33                  PHP_INT_MAX,
34                  -PHP_INT_MAX
35                 );
36
37// iterate over each element of $options array
38$iterator = 1;
39imap_check($stream_id);
40foreach($options as $option) {
41	echo "\nTesting with option value:";
42	var_dump($option);
43	$overview = imap_fetch_overview($stream_id, $msg_uid, $option);
44	if ($overview) {
45                echo "imap_fetch_overview() returns an object\n";
46        }
47	$iterator++;
48}
49
50?>
51===DONE===
52--CLEAN--
53<?php
54require_once(dirname(__FILE__).'/clean.inc');
55?>
56--EXPECTF--
57*** Testing imap_fetch_overview() : usage variations ***
58Create a temporary mailbox and add 1 msgs
59.. mailbox '{%s}%s' created
60
61Testing with option value:%string|unicode%(1) "1"
62imap_fetch_overview() returns an object
63
64Testing with option value:bool(true)
65imap_fetch_overview() returns an object
66
67Testing with option value:float(1)
68imap_fetch_overview() returns an object
69
70Testing with option value:float(1)
71imap_fetch_overview() returns an object
72
73Testing with option value:int(%d)
74
75Warning: imap_fetch_overview(): invalid value for the options parameter in %s on line %d
76
77Testing with option value:int(-%d)
78
79Warning: imap_fetch_overview(): invalid value for the options parameter in %s on line %d
80===DONE===
81