1--TEST--
2Test imap_close() function : error conditions - incorrect number of args
3--SKIPIF--
4<?php
5require_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
18echo "*** Testing imap_close() : error conditions ***\n";
19require_once(dirname(__FILE__).'/imap_include.inc');
20
21// Zero arguments
22echo "\n-- Testing imap_close() function with Zero arguments --\n";
23var_dump( imap_close() );
24
25//Test imap_close with one more than the expected number of arguments
26echo "\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;
30var_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
38Warning: imap_close() expects at least 1 parameter, 0 given in %s on line %d
39NULL
40
41-- Testing imap_close() function with more than expected no. of arguments --
42
43Warning: imap_close() expects at most 2 parameters, 3 given in %s on line %d
44NULL
45===DONE===
46