1--TEST--
2Test imap_errors() function : invalid password
3--SKIPIF--
4<?php
5require_once __DIR__.'/setup/skipif.inc';
6?>
7--FILE--
8<?php
9echo "*** Testing imap_errors() : invalid password ***\n";
10require_once __DIR__.'/setup/imap_include.inc';
11$password = "bogus"; // invalid password to use in this test
12
13echo "Issue opening with invalid password, 1 retry\n";
14$mbox = imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, $password, OP_READONLY, 1);
15
16echo "List any errors\n";
17var_dump(imap_errors());
18
19?>
20--EXPECTF--
21*** Testing imap_errors() : invalid password ***
22Issue opening with invalid password, 1 retry
23
24Warning: imap_open(): Couldn't open stream %s in %s on line %d
25List any errors
26array(%d) {
27  [0]=>
28  string(%d) "%s"
29  [1]=>
30  string(%d) "%s"
31}
32