Annotation of embedaddon/php/ext/imap/tests/imap_renamemailbox_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: imap_renamemailbox() function : basic functionality
! 3: --CREDITS--
! 4: Olivier Doucet
! 5: --SKIPIF--
! 6: <?php
! 7: require_once(dirname(__FILE__).'/skipif.inc');
! 8: ?>
! 9: --FILE--
! 10: <?php
! 11: echo "Checking with no parameters\n";
! 12: imap_renamemailbox();
! 13:
! 14: echo "Checking with incorrect parameter type\n";
! 15: imap_renamemailbox('');
! 16: imap_renamemailbox(false);
! 17:
! 18:
! 19: require_once(dirname(__FILE__).'/imap_include.inc');
! 20:
! 21: $stream_id = setup_test_mailbox('', 1);
! 22:
! 23: if (!is_resource($stream_id)) {
! 24: exit("TEST FAILED: Unable to create test mailbox\n");
! 25: }
! 26:
! 27: $newbox = $default_mailbox . "." . $mailbox_prefix;
! 28:
! 29: imap_renamemailbox($stream_id, $newbox.'not');
! 30: imap_renamemailbox($stream_id, $newbox);
! 31:
! 32: //commented because of bug #49901
! 33: //$ancError = error_reporting(0);
! 34: //$z = imap_renamemailbox($stream_id, $newbox.'not2', $newbox.'2');
! 35: //var_dump($z);
! 36: //error_reporting($ancError);
! 37: echo "Checking OK\n";
! 38:
! 39:
! 40: var_dump(imap_createmailbox($stream_id, $newbox.'.test'));
! 41: var_dump(imap_renamemailbox($stream_id, $newbox.'.test', $newbox.'.testd'));
! 42:
! 43: imap_close($stream_id);
! 44: ?>
! 45: --CLEAN--
! 46: <?php
! 47: require_once('clean.inc');
! 48: ?>
! 49: --EXPECTF--
! 50: Checking with no parameters
! 51:
! 52: Warning: imap_renamemailbox() expects exactly 3 parameters, 0 given in %s on line %d
! 53: Checking with incorrect parameter type
! 54:
! 55: Warning: imap_renamemailbox() expects exactly 3 parameters, 1 given in %s on line %d
! 56:
! 57: Warning: imap_renamemailbox() expects exactly 3 parameters, 1 given in %s on line %d
! 58: Create a temporary mailbox and add 1 msgs
! 59: .. mailbox '{%s}%s' created
! 60:
! 61: Warning: imap_renamemailbox() expects exactly 3 parameters, 2 given in %s on line %d
! 62:
! 63: Warning: imap_renamemailbox() expects exactly 3 parameters, 2 given in %s on line %d
! 64: Checking OK
! 65: bool(true)
! 66: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>