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