xref: /PHP-5.6/ext/imap/tests/imap_open_error.phpt (revision db8c6d5d)
1--TEST--
2imap_open() 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_open();
14imap_open(false);
15imap_open(false, false);
16imap_open('');
17imap_open('', '');
18
19echo "Checking with incorrect parameters\n" ;
20imap_open('', '', '');
21imap_open('', '', '', -1);
22
23require_once(dirname(__FILE__).'/imap_include.inc');
24imap_open($default_mailbox, $username, $password, NIL, -1);
25
26?>
27--EXPECTF--
28Checking with no parameters
29
30Warning: imap_open() expects at least 3 parameters, 0 given in %s on line %d
31
32Warning: imap_open() expects at least 3 parameters, 1 given in %s on line %d
33
34Warning: imap_open() expects at least 3 parameters, 2 given in %s on line %d
35
36Warning: imap_open() expects at least 3 parameters, 1 given in %s on line %d
37
38Warning: imap_open() expects at least 3 parameters, 2 given in %s on line %d
39Checking with incorrect parameters
40
41Warning: imap_open(): Couldn't open stream  in %s on line %d
42
43Warning: imap_open(): Couldn't open stream  in %s on line %d
44
45Warning: imap_open(): Retries must be greater or equal to 0 in %s on line %d
46
47Notice: Unknown: Can't open mailbox : no such mailbox (errflg=2) in Unknown on line 0
48