xref: /PHP-8.1/ext/imap/tests/imap_body_basic.phpt (revision b5a14e6c)
1--TEST--
2Test imap_body() function : basic functionality
3--EXTENSIONS--
4imap
5--SKIPIF--
6<?php
7require_once(__DIR__.'/setup/skipif.inc');
8?>
9--FILE--
10<?php
11echo "*** Testing imap_body() : basic functionality ***\n";
12
13require_once(__DIR__.'/setup/imap_include.inc');
14
15echo "Create a new mailbox for test\n";
16$imap_stream = setup_test_mailbox("imapbodybasic", 1);
17
18$check = imap_check($imap_stream);
19echo "Msg Count in new mailbox: ". $check->Nmsgs . "\n";
20
21// show body for msg 1
22var_dump(imap_body($imap_stream, 1));
23
24//Access via FT_UID
25var_dump(imap_body($imap_stream, 1, FT_UID));
26
27imap_close($imap_stream);
28?>
29--CLEAN--
30<?php
31$mailbox_suffix = 'imapbodybasic';
32require_once __DIR__.'/setup/clean.inc';
33?>
34--EXPECTF--
35*** Testing imap_body() : basic functionality ***
36Create a new mailbox for test
37Create a temporary mailbox and add 1 msgs
38New mailbox created
39Msg Count in new mailbox: 1
40string(%d) "1: this is a test message, please ignore
41newline%r\R?%r"
42string(%d) "1: this is a test message, please ignore
43newline%r\R?%r"
44