Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / imap / tests / imap_fetch_overview_variation3.phpt
blob7bd78d899efef93cc16306fcb3cc9b73dc10e12b
1 --TEST--
2 Test imap_fetch_overview() function : usage variations - FT_UID option
3 --SKIPIF--
4 <?php
5 require_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  */
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  */
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
26 $msg_no = 1;
27 $msg_uid = imap_uid($stream_id, $msg_no);
29 $options = array ('1',
30                   true,
31                   1.000000000000001, 
32                   0.00001e5, 
33                   PHP_INT_MAX, 
34                   -PHP_INT_MAX
35                  );
37 // iterate over each element of $options array 
38 $iterator = 1;
39 imap_check($stream_id);
40 foreach($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++;
51 ===DONE===
52 --CLEAN--
53 <?php
54 require_once(dirname(__FILE__).'/clean.inc');
56 --EXPECTF--
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
80 ===DONE===