let DEV_2 be trunk
[m6w6/ext-http] / tests / message012.phpt
diff --git a/tests/message012.phpt b/tests/message012.phpt
new file mode 100644 (file)
index 0000000..5f46c48
--- /dev/null
@@ -0,0 +1,34 @@
+--TEST--
+message part
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+
+echo "Test\n";
+
+$p = new http\Message;
+$p->addHeader("Content-Type", "text/plain");
+$p->getBody()->append("data");
+       
+$m = new http\Message("HTTP/1.1 200");
+$m->getBody()->addPart($p);
+echo $m;
+
+?>
+Done
+--EXPECTF--
+Test
+HTTP/1.1 200
+Content-Length: %d
+Content-Type: multipart/form-data; boundary="%x.%x"
+
+--%x.%x
+Content-Type: text/plain
+Content-Length: 4
+
+data
+--%x.%x--
+Done