add test
authorMichael Wallner <mike@php.net>
Thu, 12 Feb 2015 22:09:35 +0000 (23:09 +0100)
committerMichael Wallner <mike@php.net>
Thu, 12 Feb 2015 22:09:35 +0000 (23:09 +0100)
tests/client025.phpt [new file with mode: 0644]

diff --git a/tests/client025.phpt b/tests/client025.phpt
new file mode 100644 (file)
index 0000000..7b7a605
--- /dev/null
@@ -0,0 +1,41 @@
+--TEST--
+client seek
+--SKIPIF--
+<?php 
+include "skipif.inc";
+?>
+--FILE--
+<?php 
+
+include "helper/server.inc";
+
+echo "Test\n";
+
+server("proxy.inc", function($port) {
+       $client = new http\Client;
+       $request = new http\Client\Request("PUT", "http://localhost:$port");
+       $request->setOptions(["resume" => 1, "expect_100_timeout" => 0]);
+       $request->getBody()->append("123");
+       echo $client->enqueue($request)->send()->getResponse();
+});
+
+?>
+===DONE===
+--EXPECTF--
+Test
+HTTP/1.1 200 OK
+Accept-Ranges: bytes
+Etag: "%x"
+X-Original-Transfer-Encoding: chunked
+Content-Length: %d
+
+PUT / HTTP/1.1
+User-Agent: %s
+Host: localhost:%d
+Accept: */*
+Content-Length: 2
+Expect: 100-continue
+X-Original-Content-Length: 3
+X-Original-Content-Range: bytes 1-2/3
+
+23===DONE===