Closes GH-5569.
+++ /dev/null
---TEST--
-Test imap_alerts() function : error conditions
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-/* Prototype : array imap_alerts(void)
- * Description: Returns an array of all IMAP alerts that have been generated since the last page load or since the last imap_alerts() call, whichever came last. The alert stack is cleared after imap_alerts() is called.
- * Source code: ext/imap/php_imap.c
- * Alias to functions:
- */
-
-echo "*** Testing imap_alerts() : error conditions ***\n";
-
-// One argument
-echo "\n-- Testing imap_alerts() function with one argument --\n";
-$extra_arg = 10;
-var_dump( imap_alerts($extra_arg) );
-
-?>
---EXPECTF--
-*** Testing imap_alerts() : error conditions ***
-
--- Testing imap_alerts() function with one argument --
-
-Warning: imap_alerts() expects exactly 0 parameters, 1 given in %s on line %d
-NULL
+++ /dev/null
---TEST--
-Test imap_close() function : error conditions - incorrect number of args
---SKIPIF--
-<?php
-require_once (__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-/* Prototype : bool imap_close(resource $stream_id [, int $options])
- * Description: Close an IMAP stream
- * Source code: ext/imap/php_imap.c
- */
-
-/*
- * Pass an incorrect number of arguments to imap_close() to test behaviour
- */
-
-echo "*** Testing imap_close() : error conditions ***\n";
-require_once(__DIR__.'/imap_include.inc');
-
-// Zero arguments
-echo "\n-- Testing imap_close() function with Zero arguments --\n";
-var_dump( imap_close() );
-
-//Test imap_close with one more than the expected number of arguments
-echo "\n-- Testing imap_close() function with more than expected no. of arguments --\n";
-$stream_id = imap_open($server, $username, $password);
-$options = CL_EXPUNGE;
-$extra_arg = 10;
-var_dump( imap_close($stream_id, $options, $extra_arg) );
-?>
---EXPECTF--
-*** Testing imap_close() : error conditions ***
-
--- Testing imap_close() function with Zero arguments --
-
-Warning: imap_close() expects at least 1 parameter, 0 given in %s on line %d
-NULL
-
--- Testing imap_close() function with more than expected no. of arguments --
-
-Warning: imap_close() expects at most 2 parameters, 3 given in %s on line %d
-NULL
+++ /dev/null
---TEST--
-imap_num_recent() incorrect parameter count
---CREDITS--
-Paul Sohier
-#phptestfest utrecht
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-echo "Checking with no parameters\n";
-imap_num_recent();
-
-echo "Checking with incorrect parameter type\n";
-imap_num_recent('');
-imap_num_recent(false);
-?>
---EXPECTF--
-Checking with no parameters
-
-Warning: imap_num_recent() expects exactly 1 parameter, 0 given in %s on line %d
-Checking with incorrect parameter type
-
-Warning: imap_num_recent(): Argument #1 must be of type resource, string given in %s on line %d
-
-Warning: imap_num_recent(): Argument #1 must be of type resource, bool given in %s on line %d
+++ /dev/null
---TEST--
-Test imap_fetch_overview() function : error conditions - incorrect number of args
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-/* Prototype : array imap_fetch_overview(resource $stream_id, int $msg_no [, int $options])
- * Description: Read an overview of the information in the headers
- * of the given message sequence
- * Source code: ext/imap/php_imap.c
- */
-
-/*
- * Pass an incorrect number of arguments to imap_fetch_overview() to test behaviour
- */
-
-echo "*** Testing imap_fetch_overview() : error conditions ***\n";
-
-require_once(__DIR__.'/imap_include.inc');
-
-//Test imap_fetch_overview with one more than the expected number of arguments
-echo "\n-- Testing imap_fetch_overview() function with more than expected no. of arguments --\n";
-$stream_id = setup_test_mailbox('', 2, $mailbox, 'notSimple'); // set up temp mailbox with 2 msgs
-$msg_no = 1;
-$options = FT_UID;
-$extra_arg = 10;
-var_dump( imap_fetch_overview($stream_id, $msg_no, $options, $extra_arg) );
-
-// Testing imap_fetch_overview with one less than the expected number of arguments
-echo "\n-- Testing imap_fetch_overview() function with less than expected no. of arguments --\n";
-var_dump( imap_fetch_overview($stream_id) );
-?>
---CLEAN--
-<?php
-require_once(__DIR__.'/clean.inc');
-?>
---EXPECTF--
-*** Testing imap_fetch_overview() : error conditions ***
-
--- Testing imap_fetch_overview() function with more than expected no. of arguments --
-Create a temporary mailbox and add 2 msgs
-.. mailbox '{%s}%s' created
-
-Warning: imap_fetch_overview() expects at most 3 parameters, 4 given in %s on line %d
-NULL
-
--- Testing imap_fetch_overview() function with less than expected no. of arguments --
-
-Warning: imap_fetch_overview() expects at least 2 parameters, 1 given in %s on line %d
-NULL
+++ /dev/null
---TEST--
-Test imap_fetchbody() function : error conditions - incorrect number of args
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-/* Prototype :string imap_fetchbody(resource $stream_id, int $msg_no, string $section
- * [, int $options])
- * Description: Get a specific body section
- * Source code: ext/imap/php_imap.c
- */
-
-/*
- * Pass an incorrect number of arguments to imap_fetchbody() to test behaviour
- */
-
-echo "*** Testing imap_fetchbody() : error conditions ***\n";
-require_once(__DIR__.'/imap_include.inc');
-
-//Test imap_fetchbody with one more than the expected number of arguments
-echo "\n-- Testing imap_fetchbody() function with more than expected no. of arguments --\n";
-
-$stream_id = setup_test_mailbox('', 1); // set up temp mailbox with 1 simple msg
-$msg_no = 1;
-$section = '1';
-$options = FT_PEEK;
-$extra_arg = 10;
-
-var_dump( imap_fetchbody($stream_id, $msg_no, $section, $options, $extra_arg) );
-
-// Testing imap_fetchbody with one less than the expected number of arguments
-echo "\n-- Testing imap_fetchbody() function with less than expected no. of arguments --\n";
-
-var_dump( imap_fetchbody($stream_id, $msg_no) );
-?>
---CLEAN--
-<?php
-require_once(__DIR__.'/clean.inc');
-?>
---EXPECTF--
-*** Testing imap_fetchbody() : error conditions ***
-
--- Testing imap_fetchbody() function with more than expected no. of arguments --
-Create a temporary mailbox and add 1 msgs
-.. mailbox '{%s}%s' created
-
-Warning: imap_fetchbody() expects at most 4 parameters, 5 given in %s on line %d
-NULL
-
--- Testing imap_fetchbody() function with less than expected no. of arguments --
-
-Warning: imap_fetchbody() expects at least 3 parameters, 2 given in %s on line %d
-NULL
+++ /dev/null
---TEST--
-Test imap_fetchheader() function : error conditions - incorrect number of args
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-/* Prototype : string imap_fetchheader(resource $stream_id, int $msg_no [, int $options])
- * Description: Get the full unfiltered header for a message
- * Source code: ext/imap/php_imap.c
- */
-
-/*
- * Pass an incorrect number of arguments to imap_fetchheader() to test behaviour
- */
-
-echo "*** Testing imap_fetchheader() : error conditions ***\n";
-require_once(__DIR__.'/imap_include.inc');
-
-//Test imap_fetchheader with one more than the expected number of arguments
-echo "\n-- Testing imap_fetchheader() function with more than expected no. of arguments --\n";
-
-$stream_id = imap_open($server, $username, $password);
-$msg_no = 10;
-$options = 10;
-$extra_arg = 10;
-var_dump( imap_fetchheader($stream_id, $msg_no, $options, $extra_arg) );
-
-// Testing imap_fetchheader with one less than the expected number of arguments
-echo "\n-- Testing imap_fetchheader() function with less than expected no. of arguments --\n";
-var_dump( imap_fetchheader($stream_id) );
-
-imap_close($stream_id);
-?>
---EXPECTF--
-*** Testing imap_fetchheader() : error conditions ***
-
--- Testing imap_fetchheader() function with more than expected no. of arguments --
-
-Warning: imap_fetchheader() expects at most 3 parameters, 4 given in %s on line %d
-NULL
-
--- Testing imap_fetchheader() function with less than expected no. of arguments --
-
-Warning: imap_fetchheader() expects at least 2 parameters, 1 given in %s on line %d
-NULL
+++ /dev/null
---TEST--
-imap_headerinfo() incorrect parameter count
---CREDITS--
-Olivier Doucet
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-echo "Checking with no parameters\n";
-imap_headerinfo();
-
-echo "Checking with incorrect parameter type\n";
-imap_headerinfo('');
-imap_headerinfo(false);
-
-require_once(__DIR__.'/imap_include.inc');
-$stream_id = imap_open($default_mailbox, $username, $password) or
- die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
-
-imap_headerinfo($stream_id);
-
-imap_close($stream_id);
-?>
---EXPECTF--
-Checking with no parameters
-
-Warning: imap_headerinfo() expects at least 2 parameters, 0 given in %s on line %d
-Checking with incorrect parameter type
-
-Warning: imap_headerinfo() expects at least 2 parameters, 1 given in %s on line %d
-
-Warning: imap_headerinfo() expects at least 2 parameters, 1 given in %s on line %d
-
-Warning: imap_headerinfo() expects at least 2 parameters, 1 given in %s on line %d
+++ /dev/null
---TEST--
-imap_headers() incorrect parameter count
---CREDITS--
-Paul Sohier
-#phptestfest utrecht
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-echo "Checking with no parameters\n";
-imap_headers();
-
-echo "Checking with incorrect parameter type\n";
-imap_headers('');
-imap_headers(false);
-?>
---EXPECTF--
-Checking with no parameters
-
-Warning: imap_headers() expects exactly 1 parameter, 0 given in %s on line %d
-Checking with incorrect parameter type
-
-Warning: imap_headers(): Argument #1 must be of type resource, string given in %s on line %d
-
-Warning: imap_headers(): Argument #1 must be of type resource, bool given in %s on line %d
+++ /dev/null
---TEST--
-Test imap_mail_copy() incorrect parameters
---CREDITS--
-Olivier Doucet
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-echo "Checking with no parameters\n";
-imap_mail_copy();
-
-
-echo "Checking with incorrect parameter type\n";
-imap_mail_copy('');
-imap_mail_copy(false);
-
-
-// more tests
-require_once(__DIR__.'/imap_include.inc');
-
-
-echo "Test with IMAP server\n";
-$stream_id = imap_open($default_mailbox, $username, $password) or
- die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
-
-var_dump(imap_mail_copy($stream_id));
-var_dump(imap_mail_copy($stream_id,-1));
-var_dump(imap_mail_copy($stream_id, ''));
-
-imap_close($stream_id);
-?>
---EXPECTF--
-Checking with no parameters
-
-Warning: imap_mail_copy() expects at least 3 parameters, 0 given in %s on line %d
-Checking with incorrect parameter type
-
-Warning: imap_mail_copy() expects at least 3 parameters, 1 given in %s on line %d
-
-Warning: imap_mail_copy() expects at least 3 parameters, 1 given in %s on line %d
-Test with IMAP server
-
-Warning: imap_mail_copy() expects at least 3 parameters, 1 given in %s on line %d
-NULL
-
-Warning: imap_mail_copy() expects at least 3 parameters, 2 given in %s on line %d
-NULL
-
-Warning: imap_mail_copy() expects at least 3 parameters, 2 given in %s on line %d
-NULL
+++ /dev/null
---TEST--
-Test imap_mail_move() incorrect parameters
---CREDITS--
-Olivier Doucet
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-echo "Checking with no parameters\n";
-imap_mail_move();
-
-
-echo "Checking with incorrect parameter type\n";
-imap_mail_move('');
-imap_mail_move(false);
-
-
-// more tests
-require_once(__DIR__.'/imap_include.inc');
-
-
-echo "Test with IMAP server\n";
-$stream_id = imap_open($default_mailbox, $username, $password) or
- die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
-
-var_dump(imap_mail_move($stream_id));
-var_dump(imap_mail_move($stream_id,-1));
-var_dump(imap_mail_move($stream_id, ''));
-
-imap_close($stream_id);
-?>
---EXPECTF--
-Checking with no parameters
-
-Warning: imap_mail_move() expects at least 3 parameters, 0 given in %s on line %d
-Checking with incorrect parameter type
-
-Warning: imap_mail_move() expects at least 3 parameters, 1 given in %s on line %d
-
-Warning: imap_mail_move() expects at least 3 parameters, 1 given in %s on line %d
-Test with IMAP server
-
-Warning: imap_mail_move() expects at least 3 parameters, 1 given in %s on line %d
-NULL
-
-Warning: imap_mail_move() expects at least 3 parameters, 2 given in %s on line %d
-NULL
-
-Warning: imap_mail_move() expects at least 3 parameters, 2 given in %s on line %d
-NULL
+++ /dev/null
---TEST--
-imap_num_msg() incorrect parameter count
---CREDITS--
-Paul Sohier
-#phptestfest utrecht
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-echo "Checking with no parameters\n";
-imap_num_msg();
-
-echo "Checking with incorrect parameter type\n";
-imap_num_msg('');
-imap_num_msg(false);
-?>
---EXPECTF--
-Checking with no parameters
-
-Warning: imap_num_msg() expects exactly 1 parameter, 0 given in %s on line %d
-Checking with incorrect parameter type
-
-Warning: imap_num_msg(): Argument #1 must be of type resource, string given in %s on line %d
-
-Warning: imap_num_msg(): Argument #1 must be of type resource, bool given in %s on line %d
+++ /dev/null
---TEST--
-imap_expunge() incorrect parameter count
---CREDITS--
-Paul Sohier
-#phptestfest utrecht
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-echo "Checking with no parameters\n";
-imap_expunge();
-
-echo "Checking with incorrect parameter type\n";
-imap_expunge('');
-imap_expunge(false);
-?>
---EXPECTF--
-Checking with no parameters
-
-Warning: imap_expunge() expects exactly 1 parameter, 0 given in %s on line %d
-Checking with incorrect parameter type
-
-Warning: imap_expunge(): Argument #1 must be of type resource, string given in %s on line %d
-
-Warning: imap_expunge(): Argument #1 must be of type resource, bool given in %s on line %d
+++ /dev/null
---TEST--
-imap_ping() incorrect parameter count
---CREDITS--
-Paul Sohier
-#phptestfest utrecht
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-echo "Checking with no parameters\n";
-imap_ping();
-
-echo "Checking with incorrect parameter type\n";
-imap_ping('');
-imap_ping(false);
-?>
---EXPECTF--
-Checking with no parameters
-
-Warning: imap_ping() expects exactly 1 parameter, 0 given in %s on line %d
-Checking with incorrect parameter type
-
-Warning: imap_ping(): Argument #1 must be of type resource, string given in %s on line %d
-
-Warning: imap_ping(): Argument #1 must be of type resource, bool given in %s on line %d
+++ /dev/null
---TEST--
-imap_undelete() incorrect parameter count
---CREDITS--
-Olivier Doucet
---SKIPIF--
-<?php
-require_once(__DIR__.'/skipif.inc');
-?>
---FILE--
-<?php
-echo "Checking with no parameters\n";
-imap_undelete();
-
-echo "Checking with incorrect parameter type\n";
-imap_undelete('');
-imap_undelete(false);
-
-require_once(__DIR__.'/imap_include.inc');
-$stream_id = imap_open($default_mailbox, $username, $password) or
- die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
-
-imap_undelete($stream_id);
-
-imap_close($stream_id);
-?>
---EXPECTF--
-Checking with no parameters
-
-Warning: imap_undelete() expects at least 2 parameters, 0 given in %s on line %d
-Checking with incorrect parameter type
-
-Warning: imap_undelete() expects at least 2 parameters, 1 given in %s on line %d
-
-Warning: imap_undelete() expects at least 2 parameters, 1 given in %s on line %d
-
-Warning: imap_undelete() expects at least 2 parameters, 1 given in %s on line %d