let DEV_2 be trunk
[m6w6/ext-http] / tests / envresponse014.phpt
diff --git a/tests/envresponse014.phpt b/tests/envresponse014.phpt
new file mode 100644 (file)
index 0000000..ef85e2c
--- /dev/null
@@ -0,0 +1,24 @@
+--TEST--
+env response invalid ranges
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+$f = tmpfile();
+$req = new http\Env\Request;
+$req->setHeader("Range", "bytes=321-123,123-0");
+$res = new http\Env\Response;
+$res->getBody()->append("foobar");
+$res->setEnvRequest($req);
+$res->send($f);
+rewind($f);
+var_dump(stream_get_contents($f));
+--EXPECTF--
+string(96) "HTTP/1.1 416 Requested Range Not Satisfiable
+Accept-Ranges: bytes
+Content-Range: bytes */6
+
+"
+