xref: /php-src/ext/session/tests/rfc1867.phpt (revision c5bce0d8)
1--TEST--
2session rfc1867
3--INI--
4display_startup_errors=0
5file_uploads=1
6upload_max_filesize=1024
7session.save_path=
8session.name=PHPSESSID
9session.use_strict_mode=0
10session.use_cookies=1
11session.use_only_cookies=0
12session.upload_progress.enabled=1
13session.upload_progress.cleanup=0
14session.upload_progress.prefix=upload_progress_
15session.upload_progress.name=PHP_SESSION_UPLOAD_PROGRESS
16session.upload_progress.freq=1%
17session.upload_progress.min_freq=0.000000001
18session.save_handler=files
19--EXTENSIONS--
20session
21--SKIPIF--
22<?php include('skipif.inc'); ?>
23--COOKIE--
24PHPSESSID=rfc1867
25--GET--
26PHPSESSID=rfc1867-get
27--POST_RAW--
28Content-Type: multipart/form-data; boundary=---------------------------20896060251896012921717172737
29-----------------------------20896060251896012921717172737
30Content-Disposition: form-data; name="PHPSESSID"
31
32rfc1867-post
33-----------------------------20896060251896012921717172737
34Content-Disposition: form-data; name="PHP_SESSION_UPLOAD_PROGRESS"
35
36rfc1867.php
37-----------------------------20896060251896012921717172737
38Content-Disposition: form-data; name="file1"; filename="file1.txt"
39
401
41-----------------------------20896060251896012921717172737
42Content-Disposition: form-data; name="file2"; filename="file2.txt"
43
442
45-----------------------------20896060251896012921717172737--
46--FILE--
47<?php
48session_start();
49var_dump(session_id());
50var_dump(basename(__FILE__) == $_POST[ini_get("session.upload_progress.name")]);
51var_dump($_FILES);
52var_dump($_SESSION["upload_progress_" . basename(__FILE__)]);
53session_destroy();
54?>
55--EXPECTF--
56string(%d) "rfc1867"
57bool(true)
58array(2) {
59  ["file1"]=>
60  array(6) {
61    ["name"]=>
62    string(9) "file1.txt"
63    ["full_path"]=>
64    string(9) "file1.txt"
65    ["type"]=>
66    string(0) ""
67    ["tmp_name"]=>
68    string(%d) "%s"
69    ["error"]=>
70    int(0)
71    ["size"]=>
72    int(1)
73  }
74  ["file2"]=>
75  array(6) {
76    ["name"]=>
77    string(9) "file2.txt"
78    ["full_path"]=>
79    string(9) "file2.txt"
80    ["type"]=>
81    string(0) ""
82    ["tmp_name"]=>
83    string(%d) "%s"
84    ["error"]=>
85    int(0)
86    ["size"]=>
87    int(1)
88  }
89}
90array(5) {
91  ["start_time"]=>
92  int(%d)
93  ["content_length"]=>
94  int(%d)
95  ["bytes_processed"]=>
96  int(%d)
97  ["done"]=>
98  bool(true)
99  ["files"]=>
100  array(2) {
101    [0]=>
102    array(7) {
103      ["field_name"]=>
104      string(5) "file1"
105      ["name"]=>
106      string(9) "file1.txt"
107      ["tmp_name"]=>
108      string(%d) "%s"
109      ["error"]=>
110      int(0)
111      ["done"]=>
112      bool(true)
113      ["start_time"]=>
114      int(%d)
115      ["bytes_processed"]=>
116      int(1)
117    }
118    [1]=>
119    array(7) {
120      ["field_name"]=>
121      string(5) "file2"
122      ["name"]=>
123      string(9) "file2.txt"
124      ["tmp_name"]=>
125      string(%d) "%s"
126      ["error"]=>
127      int(0)
128      ["done"]=>
129      bool(true)
130      ["start_time"]=>
131      int(%d)
132      ["bytes_processed"]=>
133      int(1)
134    }
135  }
136}
137