Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / imap / tests / imap_body_basic.phpt
blob0eb4a2b8387b016e4ba09846cf54b9dc86525907
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  */
14 echo "*** Testing imap_body() : basic functionality ***\n";
16 require_once(dirname(__FILE__).'/imap_include.inc');
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");
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));
30 //Access via FT_UID
31 var_dump(imap_body($imap_stream, 1, FT_UID));
33 imap_close($imap_stream);
35 ===Done===
36 --CLEAN--
37 <?php 
38 require_once('clean.inc');
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===