--TEST-- Test imap_fetchbody() function : basic functionality --SKIPIF-- --FILE-- FT_UID, 'FT_PEEK' => FT_PEEK, 'FT_INTERNAL' => FT_INTERNAL); // Calling imap_fetchbody() with all possible arguments foreach ($options as $key => $option) { echo "-- Option is $key --\n"; if ($key == 'FT_UID') { $msg_uid = imap_uid($stream_id, $msg_no); if(is_string( imap_fetchbody($stream_id, $msg_uid, $section, $option) ) ) {echo "PASS\n";} if(is_string( imap_fetchbody($stream_id, $msg_uid, $section, PHP_INT_MAX) ) ) {echo "PASS\n";} } else { if(is_string( imap_fetchbody($stream_id, $msg_no, $section, $option) ) ) {echo "PASS\n";} if(is_string( imap_fetchbody($stream_id, $msg_no, $section, PHP_INT_MAX) ) ) {echo "PASS\n";} } } echo "\n-- Mandatory arguments --\n"; if(is_string( imap_fetchbody($stream_id, $msg_no, $section) ) ) {echo "PASS\n";} ?> ===DONE=== --CLEAN-- --EXPECTF-- Create a temporary mailbox and add 1 msgs .. mailbox '{localhost/norsh}INBOX.phpttest' created -- Option is FT_UID -- PASS Warning: imap_fetchbody(): invalid value for the options parameter in %s on line %d -- Option is FT_PEEK -- PASS Warning: imap_fetchbody(): invalid value for the options parameter in %s on line %d -- Option is FT_INTERNAL -- PASS Warning: imap_fetchbody(): invalid value for the options parameter in %s on line %d -- Mandatory arguments -- PASS ===DONE===