unfold encoding tests
[m6w6/ext-http] / tests / encstream001.phpt
diff --git a/tests/encstream001.phpt b/tests/encstream001.phpt
new file mode 100644 (file)
index 0000000..5dc13d3
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+encoding stream chunked static
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$file = file(__FILE__);
+$cenc = array_reduce(
+       $file,
+       function($data, $line) {
+               return $data . sprintf("%lx\r\n%s\r\n", strlen($line), $line);
+       }
+) . "0\r\n";
+
+var_dump(implode("", $file) === http\Encoding\Stream\Dechunk::decode($cenc));
+
+?>
+DONE
+--EXPECT--
+Test
+bool(true)
+DONE
+