1--TEST-- 2Test imap_fetch_overview() function : error conditions - incorrect number of args 3--SKIPIF-- 4<?php 5require_once(dirname(__FILE__).'/skipif.inc'); 6?> 7--FILE-- 8<?php 9/* Prototype : array imap_fetch_overview(resource $stream_id, int $msg_no [, int $options]) 10 * Description: Read an overview of the information in the headers 11 * of the given message sequence 12 * Source code: ext/imap/php_imap.c 13 */ 14 15/* 16 * Pass an incorrect number of arguments to imap_fetch_overview() to test behaviour 17 */ 18 19echo "*** Testing imap_fetch_overview() : error conditions ***\n"; 20 21require_once(dirname(__FILE__).'/imap_include.inc'); 22 23//Test imap_fetch_overview with one more than the expected number of arguments 24echo "\n-- Testing imap_fetch_overview() function with more than expected no. of arguments --\n"; 25$stream_id = setup_test_mailbox('', 2, $mailbox, 'notSimple'); // set up temp mailbox with 2 msgs 26$msg_no = 1; 27$options = FT_UID; 28$extra_arg = 10; 29var_dump( imap_fetch_overview($stream_id, $msg_no, $options, $extra_arg) ); 30 31// Testing imap_fetch_overview with one less than the expected number of arguments 32echo "\n-- Testing imap_fetch_overview() function with less than expected no. of arguments --\n"; 33var_dump( imap_fetch_overview($stream_id) ); 34?> 35===DONE=== 36--CLEAN-- 37<?php 38require_once(dirname(__FILE__).'/clean.inc'); 39?> 40--EXPECTF-- 41*** Testing imap_fetch_overview() : error conditions *** 42 43-- Testing imap_fetch_overview() function with more than expected no. of arguments -- 44Create a temporary mailbox and add 2 msgs 45.. mailbox '{%s}%s' created 46 47Warning: imap_fetch_overview() expects at most 3 parameters, 4 given in %s on line %d 48NULL 49 50-- Testing imap_fetch_overview() function with less than expected no. of arguments -- 51 52Warning: imap_fetch_overview() expects at least 2 parameters, 1 given in %s on line %d 53NULL 54===DONE=== 55