rfc1867.phpt 2.8 KB

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