From: Michael Wallner Date: Thu, 12 Feb 2015 10:14:04 +0000 (+0100) Subject: yep, moved there. ugh X-Git-Tag: RELEASE_2_3_0_RC1~40 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=aba1f7d332d866ca1f0397d46751864e430985f3 yep, moved there. ugh --- diff --git a/tests/helper/cookie.inc b/tests/helper/cookie.inc new file mode 100644 index 0000000..d33666b --- /dev/null +++ b/tests/helper/cookie.inc @@ -0,0 +1,11 @@ +getHeader("cookie")); + $response = new http\Env\Response; + $response->setCookie($cookies->setCookie("counter", $cookies->getCookie("counter")+1)); + $response->send($client); +}); diff --git a/tests/helper/pipeline.inc b/tests/helper/pipeline.inc new file mode 100644 index 0000000..815b463 --- /dev/null +++ b/tests/helper/pipeline.inc @@ -0,0 +1,25 @@ +setEnvRequest($msg) + ->setHeader("X-Req", $msg->getRequestUrl()) + ->send($client); +} + +serve(function($client) { + $count = trim(fgets(STDIN)); + + /* the peek message */ + respond($client, new http\Message($client, false)); + + /* pipelined messages */ + $req = array(); + for ($i=0; $i < $count; ++ $i) { + $req[] = new http\Message($client, false); + } + foreach ($req as $msg) { + respond($client, $msg); + } +}); diff --git a/tests/helper/proxy.inc b/tests/helper/proxy.inc new file mode 100644 index 0000000..61b20dd --- /dev/null +++ b/tests/helper/proxy.inc @@ -0,0 +1,21 @@ +getHeader("Proxy-Connection")) { + $response = new http\Env\Response; + $response->send($client); + + /* soak up the request following the connect */ + new http\Message($client, false); + } + + /* return the initial message as response body */ + $response = new http\Env\Response; + $response->getBody()->append($request); + $response->send($client); +}); diff --git a/tests/helper/server.inc b/tests/helper/server.inc new file mode 100644 index 0000000..70fb7cf --- /dev/null +++ b/tests/helper/server.inc @@ -0,0 +1,41 @@ +