diff options
author | George Peter Banyard <girgias@php.net> | 2020-12-22 19:46:48 +0100 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2020-12-22 19:55:30 +0100 |
commit | 7606994356206121a43f2fe877570b1d116c3859 (patch) | |
tree | e674693e0f2239d64922b5ea8b2f31794b325f6c | |
parent | a80a02989629425cb2d9a70973f3aab56333710a (diff) | |
download | php-git-7606994356206121a43f2fe877570b1d116c3859.tar.gz |
Make imap_errors() test no hang
Instead of attempting to connect with an invalid password, connect as an anonymous user.
As this is disabled in our Dovecot configuration, this generates an error, and fails fast.
-rw-r--r-- | ext/imap/tests/imap_errors_basic.phpt | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/ext/imap/tests/imap_errors_basic.phpt b/ext/imap/tests/imap_errors_basic.phpt index 45d1ec8973..8ad007727a 100644 --- a/ext/imap/tests/imap_errors_basic.phpt +++ b/ext/imap/tests/imap_errors_basic.phpt @@ -1,29 +1,24 @@ --TEST-- -Test imap_errors() function : invalid password +Test imap_errors() function : anonymous user not supported --SKIPIF-- <?php require_once __DIR__.'/setup/skipif.inc'; ?> --FILE-- <?php -echo "*** Testing imap_errors() : invalid password ***\n"; +echo "*** Testing imap_errors() : anonymous user not supported ***\n"; require_once __DIR__.'/setup/imap_include.inc'; -$password = "bogus"; // invalid password to use in this test -echo "Issue opening with invalid password, 1 retry\n"; -$mbox = imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, $password, OP_READONLY, 1); +$mbox = @imap_open(IMAP_DEFAULT_MAILBOX, IMAP_MAILBOX_USERNAME, IMAP_MAILBOX_PASSWORD, OP_ANONYMOUS); echo "List any errors\n"; var_dump(imap_errors()); ?> ---EXPECTF-- -*** Testing imap_errors() : invalid password *** -Issue opening with invalid password, 1 retry - -Warning: imap_open(): Couldn't open stream %s in %s on line %d +--EXPECT-- +*** Testing imap_errors() : anonymous user not supported *** List any errors -array(%d) { +array(1) { [0]=> - string(%d) "%s" + string(45) "[ALERT] Unsupported authentication mechanism." } |