unfold message body tests
[m6w6/ext-http] / tests / messagebody008.phpt
diff --git a/tests/messagebody008.phpt b/tests/messagebody008.phpt
new file mode 100644 (file)
index 0000000..cb9612c
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+message body to callback
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$file = new http\Message\Body(fopen(__FILE__,"r"));
+$s = "";
+$file->toCallback(
+       function($body, $string) use (&$s) { $s.=$string; }
+);
+var_dump($s === (string) $file);
+
+?>
+DONE
+--EXPECT--
+Test
+bool(true)
+DONE