1--TEST-- 2imap_savebody() function : basic functionality 3--CREDITS-- 4Olivier Doucet 5--EXTENSIONS-- 6imap 7--SKIPIF-- 8<?php 9require_once(__DIR__.'/setup/skipif.inc'); 10?> 11--FILE-- 12<?php 13 14require_once(__DIR__.'/setup/imap_include.inc'); 15$stream_id = setup_test_mailbox('imapsavebodybasic', 1); 16 17$file = __DIR__.'/tmpsavebody.txt'; 18 19//with URL 20$z = imap_savebody($stream_id, $file, 1); 21var_dump($z); 22echo "Size: ".filesize($file)."\n"; 23 24//With FOPEN 25$fp = fopen($file, 'w'); 26$z = imap_savebody($stream_id, $fp, 1); 27fclose($fp); 28var_dump($z); 29echo "Size: ".filesize($file)."\n"; 30 31imap_close($stream_id); 32?> 33--CLEAN-- 34<?php 35@unlink(__DIR__.'/tmpsavebody.txt'); 36$mailbox_suffix = 'imapsavebodybasic'; 37require_once(__DIR__ . '/setup/clean.inc'); 38?> 39--EXPECTF-- 40Create a temporary mailbox and add 1 msgs 41New mailbox created 42bool(true) 43Size: %d 44bool(true) 45Size: %d 46