let DEV_2 be trunk
[m6w6/ext-http] / tests / message005.phpt
diff --git a/tests/message005.phpt b/tests/message005.phpt
new file mode 100644 (file)
index 0000000..6f7a546
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+message cloning
+--SKIPIF--
+<?php include "skipif.inc";
+--FILE--
+<?php
+
+$msg = new http\Message("
+HTTP/1.1 201 Created
+HTTP/1.1 200 Ok
+String: foobar
+");
+
+$cpy = clone $msg;
+
+$cpy->setType(http\Message::TYPE_REQUEST);
+$cpy->setHeaders(array("Numbers" => array(1,2,3,4.5)));
+
+echo $msg;
+echo "\n===\n";
+echo $cpy;
+
+?>
+DONE
+--EXPECTF--
+HTTP/1.1 200 Ok
+String: foobar
+
+===
+UNKNOWN / HTTP/1.1
+Numbers: 1, 2, 3, 4.5
+DONE