comparison vendor/pear/mail_mime/tests/test_Bug_10816_1.phpt @ 0:1e000243b222

vanilla 1.3.3 distro, I hope
author Charlie Root
date Thu, 04 Jan 2018 15:50:29 -0500
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1e000243b222
1 --TEST--
2 Bug #10816 Unwanted linebreak at the end of output
3 --SKIPIF--
4 --FILE--
5 <?php
6 $eol = "#";
7 include("Mail/mime.php");
8 $encoder = new Mail_mime(array('eol'=>$eol));
9 $encoder->setTXTBody('test');
10 $encoder->setHTMLBody('<b>test</b>');
11 $encoder->addAttachment('Just a test', 'application/octet-stream', 'test.txt', false);
12 $body = $encoder->get();
13 $taillength = -1 * strlen($eol) * 2;
14 if (substr($body, $taillength) == ($eol.$eol)){
15 print("FAILED\n");
16 print("Body:\n");
17 print("..." . substr($body, -10) . "\n");
18 }else{
19 print("OK\n");
20 }
21 --EXPECT--
22 OK
23