X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=phpunit%2FMessageBodyTest.php;h=cc0f421efd9f92c31d2d9d7cd76999773b563a20;hb=4957436be59f65fae9cdbaec1dc865acc680862f;hp=4ef4efe43814f7f2a9c0ed0018c1d5247b2b17ce;hpb=de1f7e0ab81d134c3dffe95623b6c27b9ce16235;p=m6w6%2Fext-http diff --git a/phpunit/MessageBodyTest.php b/phpunit/MessageBodyTest.php index 4ef4efe..cc0f421 100644 --- a/phpunit/MessageBodyTest.php +++ b/phpunit/MessageBodyTest.php @@ -78,6 +78,20 @@ class MessageBodyTest extends PHPUnit_Framework_TestCase { ); } + function testAddPart() { + $this->temp->addPart(new http\Message("This: is a header\n\nand this is the data\n")); + $this->assertStringMatchesFormat( + "--%x.%x\r\n". + "This: is a header\r\n". + "Content-Length: 21\r\n". + "\r\n". + "and this is the data\n\r\n". + "--%x.%x--\r\n". + "", + str_replace("\r", "", $this->temp) + ); + } + function testEtag() { $s = stat(__FILE__); $this->assertEquals(