Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / imap / tests / bug40854.phpt
blob3df81ea29de17ac1678e5acb1819f8401eb07f43
1 --TEST--                                 
2 Bug #40854 (imap_mail_compose() creates an invalid terminator for multipart e-mails)
3 --SKIPIF--
4 <?php
5         if (!extension_loaded("imap")) { 
6                 die("skip imap extension not available");  
7         }
8 ?>
9 --FILE--
10 <?php
11 $envelope["from"]= "joe@example.com";
12 $envelope["to"]  = "foo@example.com";
13 $envelope["cc"]  = "bar@example.com";
15 $part1["type"] = TYPEMULTIPART;
16 $part1["subtype"] = "mixed";
18 $part2["type"] = TYPEAPPLICATION;
19 $part2["encoding"] = ENCBINARY;
20 $part2["subtype"] = "octet-stream";
21 $part2["description"] = 'a.txt';
22 $part2["contents.data"] = '';
24 $part3["type"] = TYPETEXT;
25 $part3["subtype"] = "plain";
26 $part3["description"] = "description3";
27 $part3["contents.data"] = "contents.data3\n\n\n\t";
29 $body[1] = $part1;
30 $body[2] = $part2;
31 $body[3] = $part3;
33 echo imap_mail_compose($envelope, $body);
35 --EXPECTF--
36 From: joe@example.com
37 To: foo@example.com
38 cc: bar@example.com
39 MIME-Version: 1.0
40 Content-Type: MULTIPART/mixed; BOUNDARY="%s"
42 --%s
43 Content-Type: APPLICATION/octet-stream
44 Content-Transfer-Encoding: BASE64
45 Content-Description: a.txt
49 --%s
50 Content-Type: TEXT/plain; CHARSET=US-ASCII
51 Content-Description: description3
53 contents.data3
56         
57 --%s--