Annotation of embedaddon/php/ext/imap/tests/imap_body_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test imap_body() function : basic functionality
! 3: --SKIPIF--
! 4: <?php
! 5: require_once(dirname(__FILE__).'/skipif.inc');
! 6: ?>
! 7: --FILE--
! 8: <?php
! 9: /* Prototype : string imap_body ( resource $imap_stream , int $msg_number [, int $options ] )
! 10: * Description: Read the message body.
! 11: * Source code: ext/imap/php_imap.c
! 12: */
! 13:
! 14: echo "*** Testing imap_body() : basic functionality ***\n";
! 15:
! 16: require_once(dirname(__FILE__).'/imap_include.inc');
! 17:
! 18: echo "Create a new mailbox for test\n";
! 19: $imap_stream = setup_test_mailbox("", 1);
! 20: if (!is_resource($imap_stream)) {
! 21: exit("TEST FAILED: Unable to create test mailbox\n");
! 22: }
! 23:
! 24: $check = imap_check($imap_stream);
! 25: echo "Msg Count in new mailbox: ". $check->Nmsgs . "\n";
! 26:
! 27: // show body for msg 1
! 28: var_dump(imap_body($imap_stream, 1));
! 29:
! 30: //Access via FT_UID
! 31: var_dump(imap_body($imap_stream, 1, FT_UID));
! 32:
! 33: imap_close($imap_stream);
! 34: ?>
! 35: ===Done===
! 36: --CLEAN--
! 37: <?php
! 38: require_once('clean.inc');
! 39: ?>
! 40: --EXPECTF--
! 41: *** Testing imap_body() : basic functionality ***
! 42: Create a new mailbox for test
! 43: Create a temporary mailbox and add 1 msgs
! 44: .. mailbox '%s' created
! 45: Msg Count in new mailbox: 1
! 46: %unicode|string%(%d) "1: this is a test message, please ignore%a"
! 47: %unicode|string%(%d) "1: this is a test message, please ignore%a"
! 48: ===Done===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>