Annotation of embedaddon/php/ext/imap/tests/imap_fetch_overview_variation3.phpt, revision 1.1

1.1     ! misho       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:  */
        !            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: 
        !            20: echo "*** Testing imap_fetch_overview() : usage variations ***\n";
        !            21: 
        !            22: require_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;
        !            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++;
        !            48: }
        !            49: 
        !            50: ?>
        !            51: ===DONE===
        !            52: --CLEAN--
        !            53: <?php
        !            54: require_once(dirname(__FILE__).'/clean.inc');
        !            55: ?>
        !            56: --EXPECTF--
        !            57: *** Testing imap_fetch_overview() : usage variations ***
        !            58: Create a temporary mailbox and add 1 msgs
        !            59: .. mailbox '{%s}%s' created
        !            60: 
        !            61: Testing with option value:%string|unicode%(1) "1"
        !            62: imap_fetch_overview() returns an object
        !            63: 
        !            64: Testing with option value:bool(true)
        !            65: imap_fetch_overview() returns an object
        !            66: 
        !            67: Testing with option value:float(1)
        !            68: imap_fetch_overview() returns an object
        !            69: 
        !            70: Testing with option value:float(1)
        !            71: imap_fetch_overview() returns an object
        !            72: 
        !            73: Testing with option value:int(%d)
        !            74: 
        !            75: Warning: imap_fetch_overview(): invalid value for the options parameter in %s on line %d
        !            76: 
        !            77: Testing with option value:int(-%d)
        !            78: 
        !            79: Warning: imap_fetch_overview(): invalid value for the options parameter in %s on line %d
        !            80: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>