Annotation of embedaddon/php/ext/imap/tests/imap_getsubscribed_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: imap_getsubscribed() 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_getsubscribed();
! 13:
! 14: echo "Checking with incorrect parameter type\n";
! 15: imap_getsubscribed('');
! 16: imap_getsubscribed(false);
! 17:
! 18: require_once(dirname(__FILE__).'/imap_include.inc');
! 19: $stream_id = imap_open($default_mailbox, $username, $password) or
! 20: die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
! 21:
! 22: imap_getsubscribed($stream_id);
! 23: imap_getsubscribed($stream_id,$default_mailbox);
! 24: var_dump(imap_getsubscribed($stream_id,$default_mailbox,'ezDvfXvbvcxSerz'));
! 25:
! 26:
! 27: echo "Checking OK\n";
! 28:
! 29: $newbox = $default_mailbox . "." . $mailbox_prefix;
! 30:
! 31: imap_createmailbox($stream_id, $newbox);
! 32: imap_subscribe($stream_id, $newbox);
! 33:
! 34: $z = imap_getsubscribed($stream_id,$default_mailbox,'*');
! 35:
! 36: var_dump(is_array($z));
! 37: var_dump($z[0]);
! 38:
! 39: imap_close($stream_id);
! 40: ?>
! 41: --CLEAN--
! 42: <?php
! 43: require_once('clean.inc');
! 44: ?>
! 45: --EXPECTF--
! 46: Checking with no parameters
! 47:
! 48: Warning: imap_getsubscribed() expects exactly 3 parameters, 0 given in %s on line %d
! 49: Checking with incorrect parameter type
! 50:
! 51: Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d
! 52:
! 53: Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d
! 54:
! 55: Warning: imap_getsubscribed() expects exactly 3 parameters, 1 given in %s on line %d
! 56:
! 57: Warning: imap_getsubscribed() expects exactly 3 parameters, 2 given in %s on line %d
! 58: bool(false)
! 59: Checking OK
! 60: bool(true)
! 61: object(stdClass)#%d (%d) {
! 62: [%sname"]=>
! 63: string(%d) "{%s}%s"
! 64: [%sattributes"]=>
! 65: int(%d)
! 66: [%sdelimiter"]=>
! 67: string(%d) "%s"
! 68: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>