Annotation of embedaddon/php/ext/imap/tests/bug40854.phpt, revision 1.1

1.1     ! misho       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";
        !            14: 
        !            15: $part1["type"] = TYPEMULTIPART;
        !            16: $part1["subtype"] = "mixed";
        !            17: 
        !            18: $part2["type"] = TYPEAPPLICATION;
        !            19: $part2["encoding"] = ENCBINARY;
        !            20: $part2["subtype"] = "octet-stream";
        !            21: $part2["description"] = 'a.txt';
        !            22: $part2["contents.data"] = '';
        !            23: 
        !            24: $part3["type"] = TYPETEXT;
        !            25: $part3["subtype"] = "plain";
        !            26: $part3["description"] = "description3";
        !            27: $part3["contents.data"] = "contents.data3\n\n\n\t";
        !            28: 
        !            29: $body[1] = $part1;
        !            30: $body[2] = $part2;
        !            31: $body[3] = $part3;
        !            32: 
        !            33: echo imap_mail_compose($envelope, $body);
        !            34: ?>
        !            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"
        !            41: 
        !            42: --%s
        !            43: Content-Type: APPLICATION/octet-stream
        !            44: Content-Transfer-Encoding: BASE64
        !            45: Content-Description: a.txt
        !            46: 
        !            47: 
        !            48: 
        !            49: --%s
        !            50: Content-Type: TEXT/plain; CHARSET=US-ASCII
        !            51: Content-Description: description3
        !            52: 
        !            53: contents.data3
        !            54: 
        !            55: 
        !            56:        
        !            57: --%s--

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