cvs: pear /Mail_Mime/tests test_Bug_10816_1.phpt
| From: | Cipriano Groenendal | Date: | Tue, 24 Apr 2007 18:11:45 +0000 |
| Subject: | cvs: pear /Mail_Mime/tests test_Bug_10816_1.phpt | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-46129@lists.php.net to get a copy of this message | ||
cipri Tue Apr 24 18:11:45 2007 UTC
Added files:
/pear/Mail_Mime/tests test_Bug_10816_1.phpt
Log:
Added unit test for Bug #10816 Unwanted linebreak at the end of output
http://cvs.php.net/viewvc.cgi/pear/Mail_Mime/tests/test_Bug_10816_1.phpt?view=markup&rev=1.1
Index: pear/Mail_Mime/tests/test_Bug_10816_1.phpt
+++ pear/Mail_Mime/tests/test_Bug_10816_1.phpt
--TEST--
Bug #10816 Unwanted linebreak at the end of output
--SKIPIF--
--FILE--
<?php
error_reporting(E_ALL); // ignore E_STRICT
define("MAIL_MIMEPART_CRLF", "#");
include("Mail/mime.php");
$encoder = new Mail_mime();
$encoder->_build_params['ignore-iconv'] = true;
$encoder->setTXTBody('test');
$encoder->setHTMLBody('<b>test</b>');
$encoder->addAttachment('Just a test', 'application/octet-stream',
'test.txt', false);
$body = $encoder->get();
$taillength = -1 * strlen(MAIL_MIMEPART_CRLF) * 2;
if (substr($body, $taillength) == (MAIL_MIMEPART_CRLF . MAIL_MIMEPART_CRLF)){
print("FAILED\n");
print("Body:\n");
print("..." . substr($body, -10) . "\n");
}else{
print("OK\n");
}
--EXPECT--
OK