imap_body.phpt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. --TEST--
  2. imap_body() incorrect parameter count
  3. --CREDITS--
  4. Paul Sohier
  5. #phptestfest utrecht
  6. --SKIPIF--
  7. <?php
  8. require_once(dirname(__FILE__).'/skipif.inc');
  9. ?>
  10. --FILE--
  11. <?php
  12. echo "Checking with no parameters\n";
  13. imap_body();
  14. echo "Checking with incorrect parameter type\n";
  15. imap_body('');
  16. imap_body(false);
  17. require_once(dirname(__FILE__).'/imap_include.inc');
  18. $stream_id = imap_open($default_mailbox, $username, $password) or
  19. die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
  20. imap_body($stream_id);
  21. imap_body($stream_id,-1);
  22. imap_body($stream_id,1,-1);
  23. //Access not existing
  24. var_dump(imap_body($stream_id, 999, FT_UID));
  25. imap_close($stream_id);
  26. ?>
  27. --EXPECTF--
  28. Checking with no parameters
  29. Warning: imap_body() expects at least 2 parameters, 0 given in %s on line %d
  30. Checking with incorrect parameter type
  31. Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d
  32. Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d
  33. Warning: imap_body() expects at least 2 parameters, 1 given in %s on line %d
  34. Warning: imap_body(): Bad message number in %s on line %d
  35. Warning: imap_body(): invalid value for the options parameter in %s on line %d
  36. Warning: imap_body(): Bad message number in %s on line %d
  37. bool(false)