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

1.1     ! misho       1: --TEST--
        !             2: Test imap_fetchbody() function : usage variation - different resources as $stream_id arg
        !             3: --SKIPIF--
        !             4: <?php
        !             5: extension_loaded('imap') or die('skip imap extension not available in this build');
        !             6: ?>
        !             7: --FILE--
        !             8: <?php
        !             9: /* Prototype  : string imap_fetchbody(resource $stream_id, int $msg_no, string $section 
        !            10:  *           [, int options])
        !            11:  * Description: Get a specific body section 
        !            12:  * Source code: ext/imap/php_imap.c
        !            13:  */
        !            14: 
        !            15: /*
        !            16:  * Pass different resource types to imap_fetchbody() to test behaviour
        !            17:  */
        !            18: 
        !            19: echo "*** Testing imap_fetchbody() : usage variations ***\n";
        !            20: 
        !            21: echo "\n-- File Resource opened with fopen() --\n";
        !            22: var_dump($file_pointer = fopen(__FILE__, 'r+'));
        !            23: var_dump(imap_fetchbody($file_pointer, 1));
        !            24: fclose($file_pointer);
        !            25: 
        !            26: echo "\n-- Directory Resource opened with opendir() --\n";
        !            27: var_dump($dir_handle = opendir(dirname(__FILE__)));
        !            28: var_dump(imap_fetchbody($dir_handle, 1));
        !            29: closedir($dir_handle);
        !            30: ?>
        !            31: ===DONE===
        !            32: --EXPECTF--
        !            33: *** Testing imap_fetchbody() : usage variations ***
        !            34: 
        !            35: -- File Resource opened with fopen() --
        !            36: resource(5) of type (stream)
        !            37: 
        !            38: Warning: imap_fetchbody() expects at least 3 parameters, 2 given in %s on line %d
        !            39: NULL
        !            40: 
        !            41: -- Directory Resource opened with opendir() --
        !            42: resource(6) of type (stream)
        !            43: 
        !            44: Warning: imap_fetchbody() expects at least 3 parameters, 2 given in %s on line %d
        !            45: NULL
        !            46: ===DONE===

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