back to dev
[m6w6/ext-http] / tests / envresponse009.phpt
1 --TEST--
2 env response stream cache negative
3 --SKIPIF--
4 <?php include "skipif.inc"; ?>
5 --GET--
6 a=b
7 --ENV--
8 HTTP_IF_MODIFIED_SINCE=Fri, 13 Feb 2009 23:31:30 GMT
9 HTTP_IF_NONE_MATCH=0000-00-0000
10 --FILE--
11 <?php
12 $f = tmpfile();
13 $r = new http\Env\Response;
14 $r->setBody(new http\Message\Body(fopen(__FILE__,"rb")));
15 $r->setEtag("abc");
16 $r->setLastModified(1234567891);
17 $r->send($f);
18 rewind($f);
19 var_dump(stream_get_contents($f));
20 ?>
21 --EXPECTF--
22 string(%d) "HTTP/1.1 200 OK%c
23 Accept-Ranges: bytes%c
24 X-Powered-By: %s%c
25 ETag: "abc"%c
26 Last-Modified: %s%c
27 %c
28 <?php
29 $f = tmpfile();
30 $r = new http\Env\Response;
31 $r->setBody(new http\Message\Body(fopen(__FILE__,"rb")));
32 $r->setEtag("abc");
33 $r->setLastModified(1234567891);
34 $r->send($f);
35 rewind($f);
36 var_dump(stream_get_contents($f));
37 ?>
38 "
39