@@ -1315,7 +1315,7 @@ function run_test($php, $file, $env)
1315
1315
$ tested = trim ($ section_text ['TEST ' ]);
1316
1316
1317
1317
/* For GET/POST/PUT tests, check if cgi sapi is available and if it is, use it. */
1318
- if (!empty ($ section_text ['GET ' ]) || !empty ($ section_text ['POST ' ]) || !empty ($ section_text ['POST_RAW ' ]) || !empty ($ section_text ['PUT ' ]) || !empty ($ section_text ['COOKIE ' ]) || !empty ($ section_text ['EXPECTHEADERS ' ])) {
1318
+ if (!empty ($ section_text ['GET ' ]) || !empty ($ section_text ['POST ' ]) || !empty ($ section_text ['GZIP_POST ' ]) || ! empty ( $ section_text [ ' DEFLATE_POST ' ]) || ! empty ( $ section_text [ ' POST_RAW ' ]) || !empty ($ section_text ['PUT ' ]) || !empty ($ section_text ['COOKIE ' ]) || !empty ($ section_text ['EXPECTHEADERS ' ])) {
1319
1319
if (isset ($ php_cgi )) {
1320
1320
$ old_php = $ php ;
1321
1321
$ php = $ php_cgi . ' -C ' ;
@@ -1700,15 +1700,6 @@ function run_test($php, $file, $env)
1700
1700
} else if (array_key_exists ('POST ' , $ section_text ) && !empty ($ section_text ['POST ' ])) {
1701
1701
1702
1702
$ post = trim ($ section_text ['POST ' ]);
1703
-
1704
- if (array_key_exists ('GZIP_POST ' , $ section_text ) && function_exists ('gzencode ' )) {
1705
- $ post = gzencode ($ post , 9 , FORCE_GZIP );
1706
- $ env ['HTTP_CONTENT_ENCODING ' ] = 'gzip ' ;
1707
- } else if (array_key_exists ('DEFLATE_POST ' , $ section_text ) && function_exists ('gzcompress ' )) {
1708
- $ post = gzcompress ($ post , 9 );
1709
- $ env ['HTTP_CONTENT_ENCODING ' ] = 'deflate ' ;
1710
- }
1711
-
1712
1703
save_text ($ tmp_post , $ post );
1713
1704
$ content_length = strlen ($ post );
1714
1705
@@ -1718,6 +1709,35 @@ function run_test($php, $file, $env)
1718
1709
1719
1710
$ cmd = "$ php $ pass_options $ ini_settings -f \"$ test_file \" 2>&1 < \"$ tmp_post \"" ;
1720
1711
1712
+ } else if (array_key_exists ('GZIP_POST ' , $ section_text ) && !empty ($ section_text ['GZIP_POST ' ])) {
1713
+
1714
+ $ post = trim ($ section_text ['GZIP_POST ' ]);
1715
+ $ post = gzencode ($ post , 9 , FORCE_GZIP );
1716
+ $ env ['HTTP_CONTENT_ENCODING ' ] = 'gzip ' ;
1717
+
1718
+ save_text ($ tmp_post , $ post );
1719
+ $ content_length = strlen ($ post );
1720
+
1721
+ $ env ['REQUEST_METHOD ' ] = 'POST ' ;
1722
+ $ env ['CONTENT_TYPE ' ] = 'application/x-www-form-urlencoded ' ;
1723
+ $ env ['CONTENT_LENGTH ' ] = $ content_length ;
1724
+
1725
+ $ cmd = "$ php $ pass_options $ ini_settings -f \"$ test_file \" 2>&1 < \"$ tmp_post \"" ;
1726
+
1727
+ } else if (array_key_exists ('DEFLATE_POST ' , $ section_text ) && !empty ($ section_text ['DEFLATE_POST ' ])) {
1728
+ $ post = trim ($ section_text ['DEFLATE_POST ' ]);
1729
+ $ post = gzcompress ($ post , 9 );
1730
+ $ env ['HTTP_CONTENT_ENCODING ' ] = 'deflate ' ;
1731
+ save_text ($ tmp_post , $ post );
1732
+ $ content_length = strlen ($ post );
1733
+
1734
+ $ env ['REQUEST_METHOD ' ] = 'POST ' ;
1735
+ $ env ['CONTENT_TYPE ' ] = 'application/x-www-form-urlencoded ' ;
1736
+ $ env ['CONTENT_LENGTH ' ] = $ content_length ;
1737
+
1738
+ $ cmd = "$ php $ pass_options $ ini_settings -f \"$ test_file \" 2>&1 < \"$ tmp_post \"" ;
1739
+
1740
+
1721
1741
} else {
1722
1742
1723
1743
$ env ['REQUEST_METHOD ' ] = 'GET ' ;
0 commit comments