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