tests: PHP<=7.3 compat
[m6w6/ext-http] / tests / message012.phpt
1 --TEST--
2 message part
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9
10 echo "Test\n";
11
12 $p = new http\Message;
13 $p->addHeader("Content-Type", "text/plain");
14 $p->getBody()->append("data");
15
16 $m = new http\Message("HTTP/1.1 200");
17 $m->getBody()->addPart($p);
18 echo $m;
19
20 ?>
21 Done
22 --EXPECTF--
23 Test
24 HTTP/1.1 200
25 Content-Length: %d
26 Content-Type: multipart/form-data; boundary="%x.%x"
27
28 --%x.%x
29 Content-Type: text/plain
30 Content-Length: 4
31
32 data
33 --%x.%x--
34 Done