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