back to dev
[m6w6/ext-http] / tests / envresponse011.phpt
1 --TEST--
2 env response cache positive with env message
3 --SKIPIF--
4 <?php include "skipif.inc"; ?>
5 --GET--
6 dummy=1
7 --FILE--
8 <?php
9 $e = new http\Env\Request;
10 $e->setHeader("If-Modified-Since", "Fri, 13 Feb 2009 23:31:32 GMT");
11 $r = new http\Env\Response;
12 $r->setEnvRequest($e);
13 $r->setBody(new http\Message\Body(fopen(__FILE__,"rb")));
14 $r->setEtag("abc");
15 $r->setLastModified(1234567891);
16 $r->isCachedByEtag("If-None-Match") and die("Huh? etag? really?\n");
17 $r->isCachedByLastModified("If-Modified-Since") or die("yep, I should be cached");
18 $r->send();
19 ?>
20 --EXPECTHEADERS--
21 HTTP/1.1 304 Not Modified
22 ETag: "abc"
23 Last-Modified: Fri, 13 Feb 2009 23:31:31 GMT
24 --EXPECT--