Annotation of embedaddon/php/ext/imap/tests/bug31142_1.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--                                 
                      2: Bug #31142 test #1 (imap_mail_compose() generates incorrect output)
                      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["from"]= "joe@example.com";
                     13: $envelope["to"]  = "foo@example.com";
                     14: $envelope["cc"]  = "bar@example.com";
                     15: 
                     16: $part1["type"] = TYPEMULTIPART;
                     17: $part1["subtype"] = "mixed";
                     18: 
                     19: $part2["type"] = TYPEAPPLICATION;
                     20: $part2["encoding"] = ENCBINARY;
                     21: $part2["subtype"] = "octet-stream";
                     22: $part2["description"] = "some file";
                     23: $part2["contents.data"] = "ABC";
                     24: 
                     25: $part3["type"] = TYPETEXT;
                     26: $part3["subtype"] = "plain";
                     27: $part3["description"] = "description3";
                     28: $part3["contents.data"] = "contents.data3\n\n\n\t";
                     29: 
                     30: $body[1] = $part1;
                     31: $body[2] = $part2;
                     32: $body[3] = $part3;
                     33: 
                     34: echo imap_mail_compose($envelope, $body);
                     35: 
                     36: ?>
                     37: --EXPECTF--
                     38: From: joe@example.com
                     39: To: foo@example.com
                     40: cc: bar@example.com
                     41: MIME-Version: 1.0
                     42: Content-Type: MULTIPART/mixed; BOUNDARY="%s"
                     43: 
                     44: --%s
                     45: Content-Type: APPLICATION/octet-stream
                     46: Content-Transfer-Encoding: BASE64
                     47: Content-Description: some file
                     48: 
                     49: QUJD
                     50: 
                     51: --%s
                     52: Content-Type: TEXT/plain; CHARSET=US-ASCII
                     53: Content-Description: description3
                     54: 
                     55: contents.data3
                     56: 
                     57: 
                     58:        
                     59: --%s--

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>