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

1.1       misho       1: --TEST--
                      2: Test imap_close() function : error conditions - incorrect number of args
                      3: --SKIPIF--
                      4: <?php
                      5: require_once (dirname(__FILE__).'/skipif.inc');
                      6: ?>
                      7: --FILE--
                      8: <?php
                      9: /* Prototype  : bool imap_close(resource $stream_id [, int $options])
                     10:  * Description: Close an IMAP stream 
                     11:  * Source code: ext/imap/php_imap.c
                     12:  */
                     13: 
                     14: /*
                     15:  * Pass an incorrect number of arguments to imap_close() to test behaviour
                     16:  */
                     17: 
                     18: echo "*** Testing imap_close() : error conditions ***\n";
                     19: require_once(dirname(__FILE__).'/imap_include.inc');
                     20: 
                     21: // Zero arguments
                     22: echo "\n-- Testing imap_close() function with Zero arguments --\n";
                     23: var_dump( imap_close() );
                     24: 
                     25: //Test imap_close with one more than the expected number of arguments
                     26: echo "\n-- Testing imap_close() function with more than expected no. of arguments --\n";
                     27: $stream_id = imap_open($server, $username, $password);
                     28: $options = CL_EXPUNGE;
                     29: $extra_arg = 10;
                     30: var_dump( imap_close($stream_id, $options, $extra_arg) );
                     31: ?>
                     32: ===DONE===
                     33: --EXPECTF--
                     34: *** Testing imap_close() : error conditions ***
                     35: 
                     36: -- Testing imap_close() function with Zero arguments --
                     37: 
                     38: Warning: imap_close() expects at least 1 parameter, 0 given in %s on line %d
                     39: NULL
                     40: 
                     41: -- Testing imap_close() function with more than expected no. of arguments --
                     42: 
                     43: Warning: imap_close() expects at most 2 parameters, 3 given in %s on line %d
                     44: NULL
                     45: ===DONE===

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