2 imap_savebody() function : basic functionality
7 require_once(dirname(__FILE__).'/skipif.inc');
11 echo "Checking with no parameters\n";
14 echo "Checking with incorrect parameter type\n";
18 require_once(dirname(__FILE__).'/imap_include.inc');
19 $stream_id = setup_test_mailbox('', 1);
21 imap_savebody($stream_id);
23 $file = dirname(__FILE__).'/tmpsavebody.txt';
26 $z = imap_savebody($stream_id, $file, 1);
28 echo "Size: ".filesize($file)."\n";
31 $fp = fopen($file, 'w');
32 $z = imap_savebody($stream_id, $fp, 1);
35 echo "Size: ".filesize($file)."\n";
37 imap_close($stream_id);
41 @unlink(dirname(__FILE__).'/tmpsavebody.txt');
42 require_once('clean.inc');
45 Checking with no parameters
47 Warning: imap_savebody() expects at least 3 parameters, 0 given in %s on line %d
48 Checking with incorrect parameter type
50 Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d
52 Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d
53 Create a temporary mailbox and add 1 msgs
54 .. mailbox '{%s}%s' created
56 Warning: imap_savebody() expects at least 3 parameters, 1 given in %s on line %d