Skip to content

Commit 832e2d0

Browse files
committed
tests
1 parent 449d4c0 commit 832e2d0

6 files changed

+310
-0
lines changed

tests/basic/enable_post_data_reading_01.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var_dump($_FILES);
1111
var_dump($_POST);
1212
var_dump($HTTP_RAW_POST_DATA);
1313
var_dump(file_get_contents("php://input"));
14+
var_dump(file_get_contents("php://input"));
1415
--EXPECTF--
1516
array(0) {
1617
}
@@ -20,3 +21,4 @@ array(0) {
2021
Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
2122
NULL
2223
string(9) "a=1&b=ZYX"
24+
string(9) "a=1&b=ZYX"

tests/basic/enable_post_data_reading_02.phpt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Content-Type: text/plain-file
1515
var_dump($_FILES);
1616
var_dump($_POST);
1717
var_dump(file_get_contents("php://input"));
18+
var_dump(file_get_contents("php://input"));
1819
--EXPECTF--
1920
array(0) {
2021
}
@@ -26,3 +27,9 @@ Content-Type: text/plain-file
2627

2728
1
2829
-----------------------------20896060251896012921717172737--"
30+
string(%d) "-----------------------------20896060251896012921717172737
31+
Content-Disposition: form-data; name="file1"; filename="file1.txt"
32+
Content-Type: text/plain-file
33+
34+
1
35+
-----------------------------20896060251896012921717172737--"

tests/basic/enable_post_data_reading_03.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var_dump($_FILES);
1212
var_dump($_POST);
1313
var_dump($HTTP_RAW_POST_DATA);
1414
var_dump(file_get_contents("php://input"));
15+
var_dump(file_get_contents("php://input"));
1516
--EXPECTF--
1617
array(0) {
1718
}
@@ -21,3 +22,4 @@ array(0) {
2122
Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
2223
NULL
2324
string(9) "a=1&b=ZYX"
25+
string(9) "a=1&b=ZYX"

tests/basic/enable_post_data_reading_04.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var_dump($_FILES);
1212
var_dump($_POST);
1313
var_dump($HTTP_RAW_POST_DATA);
1414
var_dump(file_get_contents("php://input"));
15+
var_dump(file_get_contents("php://input"));
1516
--EXPECTF--
1617
array(0) {
1718
}
@@ -21,3 +22,4 @@ array(0) {
2122
Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
2223
NULL
2324
string(9) "a=1&b=ZYX"
25+
string(9) "a=1&b=ZYX"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--TEST--
2+
enable_post_data_reading: using multiple input streams
3+
--INI--
4+
enable_post_data_reading=0
5+
max_execution_time=2
6+
--POST_RAW--
7+
Content-Type: application/unknown
8+
One line of data
9+
--FILE--
10+
<?php
11+
echo "Test\n";
12+
13+
$f1 = fopen("php://input", "r");
14+
$f2 = fopen("php://input", "r");
15+
16+
while (!feof($f1) && !feof($f2)) {
17+
echo fgetc($f1), fgetc($f2);
18+
}
19+
20+
?>
21+
22+
Done
23+
--EXPECT--
24+
Test
25+
OOnnee lliinnee ooff ddaattaa
26+
Done

0 commit comments

Comments
 (0)