1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 05:32:28 +02:00
Files
archived-php-src/ext/imap/tests/imap_errors_basic.phpt
George Peter Banyard 06ddda22fe Modernize IMAP tests
Use constants when appropriate, drop some ouputs which depends on env vars

Enable parallel testing.

Closes GH-6380
2020-11-03 09:50:42 +00:00

32 lines
756 B
PHP

--TEST--
Test imap_errors() function : invalid password
--SKIPIF--
<?php
require_once __DIR__.'/setup/skipif.inc';
?>
--FILE--
<?php
echo "*** Testing imap_errors() : invalid password ***\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);
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
List any errors
array(%d) {
[0]=>
string(%d) "%s"
[1]=>
string(%d) "%s"
}