Annotation of embedaddon/php/ext/imap/tests/imap_fetchheader_variation4.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test imap_fetchheader() function : usage variations - diff resource types as $stream_id
                      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_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:  */
                     13: 
                     14: /*
                     15:  * Pass different types of resources to imap_fetchheader() to test behaviour
                     16:  */
                     17: 
                     18: echo "*** Testing imap_fetchheader() : usage variations ***\n";
                     19: 
                     20: echo "\n-- File Resource opened with fopen() --\n";
                     21: var_dump($file_pointer = fopen(__FILE__, 'r+'));
                     22: var_dump(imap_fetchheader($file_pointer, 1));
                     23: fclose($file_pointer);
                     24: 
                     25: echo "\n-- Directory Resource opened with opendir() --\n";
                     26: var_dump($dir_handle = opendir(dirname(__FILE__)));
                     27: var_dump(imap_fetchheader($dir_handle, 1));
                     28: closedir($dir_handle);
                     29: ?>
                     30: ===DONE===
                     31: --EXPECTF--
                     32: *** Testing imap_fetchheader() : usage variations ***
                     33: 
                     34: -- File Resource opened with fopen() --
                     35: resource(%d) of type (stream)
                     36: 
                     37: Warning: imap_fetchheader(): supplied resource is not a valid imap resource in %s on line %d
                     38: bool(false)
                     39: 
                     40: -- Directory Resource opened with opendir() --
                     41: resource(%d) of type (stream)
                     42: 
                     43: Warning: imap_fetchheader(): supplied resource is not a valid imap resource in %s on line %d
                     44: bool(false)
                     45: ===DONE===

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