69be990725030e3c7bdd411109eb5ec1a9b592ed
[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 $i => $mm) {
12 echo "==$i==\n",$mm,"===\n";
13 }
14 }
15 ?>
16 DONE
17 --EXPECTF--
18 string(40) "----------------------------6e182425881c"
19 ==%d==
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 ==%d==
50 Content-Disposition: form-data; name="LICENSE"; filename="LICENSE"
51 Content-Type: application/octet-stream
52 Content-Length: 1354
53
54 Copyright (c) 2011-2012, Michael Wallner <mike@iworks.at>.
55 All rights reserved.
56
57 Redistribution and use in source and binary forms, with or without
58 modification, are permitted provided that the following conditions are met:
59
60 * Redistributions of source code must retain the above copyright notice,
61 this list of conditions and the following disclaimer.
62 * Redistributions in binary form must reproduce the above copyright
63 notice, this list of conditions and the following disclaimer in the
64 documentation and/or other materials provided with the distribution.
65
66 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
67 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
68 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
69 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
70 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
71 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
72 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
73 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
74 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
75 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
76
77
78 ===
79 DONE