- fix request errors hidden under the hood of the request pool
[m6w6/ext-http] / tests / chunked_decode_003.phpt
diff --git a/tests/chunked_decode_003.phpt b/tests/chunked_decode_003.phpt
new file mode 100644 (file)
index 0000000..5af29a4
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+http_chunked_decode() truncated message
+--SKIPIF--
+<?php
+include 'skip.inc';
+?>
+--FILE--
+<?php
+echo "-TEST\n";
+$data =
+"02\r\n".
+"ab\r\n".
+"04\r\n".
+"ra\nc\r\n".
+"06\r\n".
+"adabra\r\n".
+"ff\r\n".
+"\nall we got\n";
+var_dump(http_chunked_decode($data));
+?>
+--EXPECTF--
+%sTEST
+%sWarning%s:%shttp_chunked_decode()%sTruncated message: chunk size %d exceeds remaining data size %d at pos %d of %d%s
+string(24) "abra
+cadabra
+all we got
+"