add some more tests; fix leak in php_http_env_get_response_header(); honor content...
[m6w6/ext-http] / tests / message003.phpt
1 --TEST--
2 multipart message
3 --SKIPIF--
4 <? include "skipif.inc";
5 --FILE--
6 <?
7 $m = new http\Message(fopen(__DIR__."/data/message_r_multipart_put.txt","rb"));
8 if ($m->isMultipart($boundary)) {
9 var_dump($boundary);
10
11 foreach ($m->splitMultipartBody() as $mm) {
12 echo "===\n",$mm,"===\n";
13 }
14 }
15 ?>
16 DONE
17 --EXPECTF--
18 string(40) "----------------------------6e182425881c"
19 ===
20 Content-Disposition: form-data; name="composer"; filename="composer.json"
21 Content-Type: application/octet-stream
22 Content-Length: 567
23
24 {
25 "name": "mike_php_net/autocracy",
26 "type": "library",
27 "description": "http\\Controller preserves your autocracy",
28 "keywords": ["http", "controller", "pecl", "pecl_http"],
29 "homepage": "http://github.com/mike-php-net/autocracy",
30 "license": "BSD-2",
31 "authors": [
32 {
33 "name": "Michael Wallner",
34 "email": "mike@php.net"
35 }
36 ],
37 "require": {
38 "php": ">=5.4.0",
39 "pecl/pecl_http": "2.*"
40 },
41 "autoload": {
42 "psr-0": {
43 "http\\Controller": "lib"
44 }
45 }
46 }
47
48
49 ===
50 ===
51 Content-Disposition: form-data; name="LICENSE"; filename="LICENSE"
52 Content-Type: application/octet-stream
53 Content-Length: 1354
54
55 Copyright (c) 2011-2012, Michael Wallner <mike@iworks.at>.
56 All rights reserved.
57
58 Redistribution and use in source and binary forms, with or without
59 modification, are permitted provided that the following conditions are met:
60
61 * Redistributions of source code must retain the above copyright notice,
62 this list of conditions and the following disclaimer.
63 * Redistributions in binary form must reproduce the above copyright
64 notice, this list of conditions and the following disclaimer in the
65 documentation and/or other materials provided with the distribution.
66
67 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
68 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
69 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
70 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
71 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
72 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
73 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
74 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
75 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
76 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
77
78
79
80 ===
81 DONE