Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / imap / tests / imap_fetchheader_variation3.phpt
blobfeba766e685ad1ff506eb8951ee5e9fabaeab44b
1 --TEST--
2 Test imap_fetchheader() function : usage variations - FT_UID option
3 --SKIPIF--
4 <?php
5 require_once(dirname(__FILE__).'/skipif.inc');
6 ?>
7 --FILE--
8 <?php
9 /* Prototype  : string imap_fetchheader(resource $stream_id, int $msg_no [, int $options])
10  * Description: Get the full unfiltered header for a message 
11  * Source code: ext/imap/php_imap.c
12  */
15  * Test if FT_UID is set by passing the following as $options argument to imap_fetchheader():
16  * 1. values that equate to 1
17  * 2. Minimum and maximum PHP values
18  */
20 echo "*** Testing imap_fetchheader() : 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', true, 
30                   1.000000000000001, 0.00001e5, 
31                   PHP_INT_MAX, -PHP_INT_MAX);
33 // iterate over each element of $options array to test whether FT_UID is set
34 $iterator = 1;
35 imap_check($stream_id);
36 foreach($options as $option) {
37         echo "\n-- Iteration $iterator --\n";
38         if(is_string(imap_fetchheader($stream_id, $msg_uid, $option))) {
39                 echo "FT_UID valid\n";
40         } else {
41                 echo "FT_UID not valid\n";
42         }
43         $iterator++;
46 ===DONE===
47 --CLEAN--
48 <?php
49 require_once(dirname(__FILE__).'/clean.inc');
51 --EXPECTF--
52 *** Testing imap_fetchheader() : usage variations ***
53 Create a temporary mailbox and add 1 msgs
54 .. mailbox '{%s}%s' created
56 -- Iteration 1 --
57 FT_UID valid
59 -- Iteration 2 --
60 FT_UID valid
62 -- Iteration 3 --
63 FT_UID valid
65 -- Iteration 4 --
66 FT_UID valid
68 -- Iteration 5 --
70 Warning: imap_fetchheader(): invalid value for the options parameter in %s on line %d
71 FT_UID not valid
73 -- Iteration 6 --
75 Warning: imap_fetchheader(): invalid value for the options parameter in %s on line %d
76 FT_UID not valid
77 ===DONE===