release 2.4.0
[m6w6/ext-http] / tests / envresponse015.phpt
1 --TEST--
2 env response send replaced body using multiple ob_start
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9
10 $r = new http\Env\Response;
11
12 ob_start($r);
13 echo "bar";
14 ob_end_flush();
15
16 $b = $r->getBody();
17 $r->setBody(new http\Message\Body);
18
19 ob_start($r);
20 echo "foo: $b\n";
21 ob_end_flush();
22
23 $f = fopen("php://memory", "r+");
24
25 $r->send($f);
26
27 fseek($f, 0, SEEK_SET);
28 echo stream_get_contents($f);
29
30 ?>
31 --EXPECT--
32 HTTP/1.1 200 OK
33 Accept-Ranges: bytes
34 ETag: "fc8305a1"
35 Transfer-Encoding: chunked
36
37 9
38 foo: bar
39
40 0
41