- changelog
[m6w6/ext-http] / tests / HttpMessage_004.phpt
1 --TEST--
2 HttpMessage::detach()
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkver(5);
7 ?>
8 --FILE--
9 <?php
10 echo "-TEST\n";
11
12 $m = new HttpMessage("
13 GET / HTTP/1.1
14 Host: example.com
15 Accept: */*
16 Connection: close
17 HTTP/1.1 200 ok
18 Server: Funky/1.0
19 Content-Type: text/plain
20 Content-Length: 3
21
22 Hi!"
23 );
24
25 $d = $m->detach();
26 $d->addHeaders(array('Server'=>'Funky/2.0'));
27 var_dump($d->getHeaders() == $m->getHeaders());
28 var_dump($d->getBody());
29
30 echo "Done\n";
31 ?>
32 --EXPECTF--
33 %sTEST
34 bool(false)
35 string(3) "Hi!"
36 Done