xref: /PHP-7.0/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  [%u|b%"file1"]=>
59  array(5) {
60    [%u|b%"name"]=>
61    %string|unicode%(9) "file1.txt"
62    [%u|b%"type"]=>
63    %string|unicode%(0) ""
64    [%u|b%"tmp_name"]=>
65    %string|unicode%(%d) "%s"
66    [%u|b%"error"]=>
67    int(0)
68    [%u|b%"size"]=>
69    int(1)
70  }
71  [%u|b%"file2"]=>
72  array(5) {
73    [%u|b%"name"]=>
74    %string|unicode%(9) "file2.txt"
75    [%u|b%"type"]=>
76    %string|unicode%(0) ""
77    [%u|b%"tmp_name"]=>
78    %string|unicode%(%d) "%s"
79    [%u|b%"error"]=>
80    int(0)
81    [%u|b%"size"]=>
82    int(1)
83  }
84}
85array(5) {
86  [%u|b%"start_time"]=>
87  int(%d)
88  [%u|b%"content_length"]=>
89  int(%d)
90  [%u|b%"bytes_processed"]=>
91  int(%d)
92  [%u|b%"done"]=>
93  bool(true)
94  [%u|b%"files"]=>
95  array(2) {
96    [0]=>
97    array(7) {
98      [%u|b%"field_name"]=>
99      %unicode|string%(5) "file1"
100      [%u|b%"name"]=>
101      %unicode|string%(9) "file1.txt"
102      [%u|b%"tmp_name"]=>
103      %unicode|string%(%d) "%s"
104      [%u|b%"error"]=>
105      int(0)
106      [%u|b%"done"]=>
107      bool(true)
108      [%u|b%"start_time"]=>
109      int(%d)
110      [%u|b%"bytes_processed"]=>
111      int(1)
112    }
113    [1]=>
114    array(7) {
115      [%u|b%"field_name"]=>
116      %unicode|string%(5) "file2"
117      [%u|b%"name"]=>
118      %unicode|string%(9) "file2.txt"
119      [%u|b%"tmp_name"]=>
120      %unicode|string%(%d) "%s"
121      [%u|b%"error"]=>
122      int(0)
123      [%u|b%"done"]=>
124      bool(true)
125      [%u|b%"start_time"]=>
126      int(%d)
127      [%u|b%"bytes_processed"]=>
128      int(1)
129    }
130  }
131}
132