gitter
[m6w6/ext-http] / tests / message014.phpt
1 --TEST--
2 message prepend
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9
10 echo "Test\n";
11
12 for ($i=0; $i<9; ++$i) {
13 $a[] = new http\Message("HTTP/1.1 ".($i+200));
14 }
15
16 foreach ($a as $m) {
17 if (isset($p)) $m->prepend($p);
18 $p = $m;
19 }
20
21 var_dump(
22 "HTTP/1.1 200\r\n\r\n".
23 "HTTP/1.1 201\r\n\r\n".
24 "HTTP/1.1 202\r\n\r\n".
25 "HTTP/1.1 203\r\n\r\n".
26 "HTTP/1.1 204\r\n\r\n".
27 "HTTP/1.1 205\r\n\r\n".
28 "HTTP/1.1 206\r\n\r\n".
29 "HTTP/1.1 207\r\n\r\n".
30 "HTTP/1.1 208\r\n\r\n" ===
31 $m->toString(true)
32 );
33
34 ?>
35 Done
36 --EXPECTF--
37 Test
38 bool(true)
39 Done