let DEV_2 be trunk
[m6w6/ext-http] / tests / message013.phpt
diff --git a/tests/message013.phpt b/tests/message013.phpt
new file mode 100644 (file)
index 0000000..8a192a5
--- /dev/null
@@ -0,0 +1,33 @@
+--TEST--
+message detach
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+
+echo "Test\n";
+
+$m = new http\Message(
+       "HTTP/1.1 200 Ok\r\n".
+       "HTTP/1.1 201 Created\n".
+       "HTTP/1.1 302 Found\r\n"
+);
+
+var_dump(3 === count($m));
+$d = $m->detach();
+var_dump(3 === count($m));
+var_dump(1 === count($d));
+
+var_dump("HTTP/1.1 302 Found\r\n\r\n" === $d->toString(true));
+
+?>
+Done
+--EXPECTF--
+Test
+bool(true)
+bool(true)
+bool(true)
+bool(true)
+Done