Annotation of embedaddon/php/ext/imap/tests/imap_errors_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test imap_errors() function : basic functionality
! 3: --SKIPIF--
! 4: <?php
! 5: require_once(dirname(__FILE__).'/skipif.inc');
! 6: ?>
! 7: --FILE--
! 8: <?php
! 9: /* Prototype : array imap_errors ( void )
! 10: * Description: Returns all of the IMAP errors that have occured.
! 11: * Source code: ext/imap/php_imap.c
! 12: */
! 13:
! 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
! 17:
! 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);
! 20:
! 21: echo "List any errors\n";
! 22: var_dump(imap_errors());
! 23:
! 24: echo "\n\nIssue open with invalid password with retries == 1\n";
! 25: $mbox = imap_open($default_mailbox, $username, $password, OP_READONLY, 1);
! 26:
! 27: echo "List any errors\n";
! 28: var_dump(imap_errors());
! 29: ?>
! 30: ===Done===
! 31: --EXPECTF--
! 32: *** Testing imap_errors() : basic functionality ***
! 33: Issue open with invalid password with normal default number of retries, i.e 3
! 34:
! 35: Warning: imap_open(): Couldn't open stream %s in %s on line %d
! 36: List any errors
! 37: array(%d) {
! 38: [0]=>
! 39: string(%d) "%s"
! 40: [1]=>
! 41: string(%d) "%s"
! 42: [2]=>
! 43: string(%d) "%a
! 44: }
! 45:
! 46:
! 47: Issue open with invalid password with retries == 1
! 48:
! 49: Warning: imap_open(): Couldn't open stream %s in %s on line %d
! 50: List any errors
! 51: array(%d) {
! 52: [0]=>
! 53: string(%d) "%a
! 54: }
! 55: ===Done===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>