xref: /PHP-5.4/ext/imap/tests/bug45705_2.phpt (revision 22b62586)
1--TEST--
2Bug #45705 test #2 (imap rfc822_parse_adrlist() modifies passed address parameter)
3--SKIPIF--
4<?php
5	if (!extension_loaded("imap")) {
6		die("skip imap extension not available");
7	}
8?>
9--FILE--
10<?php
11
12$envelope = array('return_path' => 'John Doe <john@example.com>',
13                  'from'        => 'John Doe <john@example.com>',
14                  'reply_to'    => 'John Doe <john@example.com>',
15                  'to'          => 'John Doe <john@example.com>',
16                  'cc'          => 'John Doe <john@example.com>',
17                  'bcc'         => 'John Doe <john@example.com>',
18);
19
20var_dump($envelope);
21imap_mail_compose($envelope, array(1 => array()));
22var_dump($envelope);
23
24?>
25--EXPECT--
26array(6) {
27  ["return_path"]=>
28  string(27) "John Doe <john@example.com>"
29  ["from"]=>
30  string(27) "John Doe <john@example.com>"
31  ["reply_to"]=>
32  string(27) "John Doe <john@example.com>"
33  ["to"]=>
34  string(27) "John Doe <john@example.com>"
35  ["cc"]=>
36  string(27) "John Doe <john@example.com>"
37  ["bcc"]=>
38  string(27) "John Doe <john@example.com>"
39}
40array(6) {
41  ["return_path"]=>
42  string(27) "John Doe <john@example.com>"
43  ["from"]=>
44  string(27) "John Doe <john@example.com>"
45  ["reply_to"]=>
46  string(27) "John Doe <john@example.com>"
47  ["to"]=>
48  string(27) "John Doe <john@example.com>"
49  ["cc"]=>
50  string(27) "John Doe <john@example.com>"
51  ["bcc"]=>
52  string(27) "John Doe <john@example.com>"
53}
54