2 Test imap_errors() function : basic functionality
5 require_once(dirname(__FILE__).'/skipif.inc');
9 /* Prototype : array imap_errors ( void )
10 * Description: Returns all of the IMAP errors that have occurred.
11 * Source code: ext/imap/php_imap.c
14 echo "*** Testing imap_errors() : basic functionality ***\n";
15 require_once(dirname(__FILE__).'/imap_include.inc');
16 $password = "bogus"; // invalid password to use in this test
18 echo "Issue open with invalid password with normal default number of retries, i.e 3\n";
19 $mbox = imap_open($default_mailbox, $username, $password, OP_READONLY, 3);
21 echo "List any errors\n";
22 var_dump(imap_errors());
24 echo "\n\nIssue open with invalid password with retries == 1\n";
25 $mbox = imap_open($default_mailbox, $username, $password, OP_READONLY, 1);
27 echo "List any errors\n";
28 var_dump(imap_errors());
32 *** Testing imap_errors() : basic functionality ***
33 Issue open with invalid password with normal default number of retries, i.e 3
35 Warning: imap_open(): Couldn't open stream %s in %s on line %d
47 Issue open with invalid password with retries == 1
49 Warning: imap_open(): Couldn't open stream %s in %s on line %d