xref: /PHP-7.2/ext/imap/tests/imap_gc_error.phpt (revision 17ccbeec)
1--TEST--
2imap_gc() incorrect parameter count
3--CREDITS--
4Paul Sohier
5#phptestfest utrecht
6--SKIPIF--
7<?php
8require_once(dirname(__FILE__).'/skipif.inc');
9?>
10--FILE--
11<?php
12echo "Checking with no parameters\n";
13imap_gc();
14
15echo  "Checking with incorrect parameter type\n";
16imap_gc('', false);
17imap_gc(false, false);
18
19require_once(dirname(__FILE__).'/imap_include.inc');
20$stream_id = imap_open($default_mailbox, $username, $password) or
21	die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
22imap_gc($stream_id, -1);
23
24?>
25--EXPECTF--
26Checking with no parameters
27
28Warning: imap_gc() expects exactly 2 parameters, 0 given in %s on line %d
29Checking with incorrect parameter type
30
31Warning: imap_gc() expects parameter 1 to be resource, string given in %s on line %d
32
33Warning: imap_gc() expects parameter 1 to be resource, boolean given in %s on line %d
34
35Warning: imap_gc(): invalid value for the flags parameter in %s on line %d
36