xref: /PHP-7.2/ext/imap/tests/imap_mail_copy.phpt (revision f1d7e3ca)
1--TEST--
2Test imap_mail_copy() incorrect parameters
3--CREDITS--
4Olivier Doucet
5--SKIPIF--
6<?php
7require_once(dirname(__FILE__).'/skipif.inc');
8?>
9--FILE--
10<?php
11echo "Checking with no parameters\n";
12imap_mail_copy();
13
14
15echo  "Checking with incorrect parameter type\n";
16imap_mail_copy('');
17imap_mail_copy(false);
18
19
20// more tests
21require_once(dirname(__FILE__).'/imap_include.inc');
22
23
24echo "Test with IMAP server\n";
25$stream_id = imap_open($default_mailbox, $username, $password) or
26	die("Cannot connect to mailbox $default_mailbox: " . imap_last_error());
27
28var_dump(imap_mail_copy($stream_id));
29var_dump(imap_mail_copy($stream_id,-1));
30var_dump(imap_mail_copy($stream_id, ''));
31
32imap_close($stream_id);
33?>
34===Done===
35--EXPECTF--
36Checking with no parameters
37
38Warning: imap_mail_copy() expects at least 3 parameters, 0 given in %s on line %d
39Checking with incorrect parameter type
40
41Warning: imap_mail_copy() expects at least 3 parameters, 1 given in %s on line %d
42
43Warning: imap_mail_copy() expects at least 3 parameters, 1 given in %s on line %d
44Test with IMAP server
45
46Warning: imap_mail_copy() expects at least 3 parameters, 1 given in %s on line %d
47NULL
48
49Warning: imap_mail_copy() expects at least 3 parameters, 2 given in %s on line %d
50NULL
51
52Warning: imap_mail_copy() expects at least 3 parameters, 2 given in %s on line %d
53NULL
54===Done===
55