imap_gc_error.phpt 938 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. imap_gc() 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_gc();
  14. echo "Checking with incorrect parameter type\n";
  15. imap_gc('', false);
  16. imap_gc(false, 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_gc($stream_id, -1);
  21. ?>
  22. --EXPECTF--
  23. Checking with no parameters
  24. Warning: imap_gc() expects exactly 2 parameters, 0 given in %s on line %d
  25. Checking with incorrect parameter type
  26. Warning: imap_gc() expects parameter 1 to be resource, string given in %s on line %d
  27. Warning: imap_gc() expects parameter 1 to be resource, bool given in %s on line %d
  28. Warning: imap_gc(): invalid value for the flags parameter in %s on line %d