summaryrefslogtreecommitdiff
path: root/tests/basic
diff options
context:
space:
mode:
Diffstat (limited to 'tests/basic')
-rw-r--r--tests/basic/011.phpt2
-rw-r--r--tests/basic/012.phpt4
-rw-r--r--tests/basic/025.phpt2
-rw-r--r--tests/basic/027.phpt33
-rw-r--r--tests/basic/bug20539.phpt8
-rw-r--r--tests/basic/bug31875.phpt10
-rw-r--r--tests/basic/bug54514.phpt7
-rw-r--r--tests/basic/bug61000.phpt1
-rw-r--r--tests/basic/bug67198.phpt1
-rw-r--r--tests/basic/bug67988.phpt1
-rw-r--r--tests/basic/bug71273.phpt16
-rw-r--r--tests/basic/bug78236.phpt17
-rw-r--r--tests/basic/consistent_float_string_casts.phpt30
-rw-r--r--tests/basic/enable_post_data_reading_01.phpt3
-rw-r--r--tests/basic/enable_post_data_reading_02.phpt1
-rw-r--r--tests/basic/enable_post_data_reading_03.phpt3
-rw-r--r--tests/basic/enable_post_data_reading_04.phpt3
-rw-r--r--tests/basic/enable_post_data_reading_05.phpt2
-rw-r--r--tests/basic/enable_post_data_reading_06.phpt2
-rw-r--r--tests/basic/precision.phpt1
-rw-r--r--tests/basic/req44164.phpt1
-rw-r--r--tests/basic/rfc1867_empty_upload.phpt4
-rw-r--r--tests/basic/rfc1867_max_file_size.phpt4
-rw-r--r--tests/basic/rfc1867_max_file_uploads_empty_files.phpt4
-rw-r--r--tests/basic/rfc1867_post_max_filesize.phpt4
-rw-r--r--tests/basic/timeout_variation_10.phpt3
-rw-r--r--tests/basic/timeout_variation_9.phpt2
27 files changed, 92 insertions, 77 deletions
diff --git a/tests/basic/011.phpt b/tests/basic/011.phpt
index b5c769d9bd..03fccaa9b7 100644
--- a/tests/basic/011.phpt
+++ b/tests/basic/011.phpt
@@ -10,7 +10,7 @@ $argc = $_SERVER['argc'];
$argv = $_SERVER['argv'];
for ($i=0; $i<$argc; $i++) {
- echo "$i: ".$argv[$i]."\n";
+ echo "$i: ".$argv[$i]."\n";
}
?>
diff --git a/tests/basic/012.phpt b/tests/basic/012.phpt
index 038d4beff9..37e5ecd809 100644
--- a/tests/basic/012.phpt
+++ b/tests/basic/012.phpt
@@ -1,7 +1,5 @@
--TEST--
Testing $argc and $argv handling (cli)
---SKIPIF--
-<?php if(php_sapi_name()!='cli') echo 'skip'; ?>
--INI--
register_argc_argv=1
variables_order=GPS
@@ -13,7 +11,7 @@ $argc = $_SERVER['argc'];
$argv = $_SERVER['argv'];
for ($i=1; $i<$argc; $i++) {
- echo ($i-1).": ".$argv[$i]."\n";
+ echo ($i-1).": ".$argv[$i]."\n";
}
?>
diff --git a/tests/basic/025.phpt b/tests/basic/025.phpt
index 37561a2a2e..5bc7bbdb8e 100644
--- a/tests/basic/025.phpt
+++ b/tests/basic/025.phpt
@@ -15,7 +15,7 @@ Warning: Unknown: POST Content-Length of 2050 bytes exceeds the limit of 1024 by
Warning: Cannot modify header information - headers already sent in Unknown on line 0
-Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
+Warning: Undefined variable $HTTP_RAW_POST_DATA in %s on line %d
array(0) {
}
NULL
diff --git a/tests/basic/027.phpt b/tests/basic/027.phpt
deleted file mode 100644
index 0528e835a1..0000000000
--- a/tests/basic/027.phpt
+++ /dev/null
@@ -1,33 +0,0 @@
---TEST--
-Handling of max_input_nesting_level being reached
---INI--
-always_populate_raw_post_data=0
-display_errors=0
-max_input_nesting_level=10
-max_input_vars=1000
-track_errors=1
-log_errors=0
---POST--
-a=1&b=ZYX&c[][][][][][][][][][][][][][][][][][][][][][]=123&d=123&e[][]][]=3
---FILE--
-<?php
-var_dump($_POST, $php_errormsg);
-?>
---EXPECT--
-array(4) {
- ["a"]=>
- string(1) "1"
- ["b"]=>
- string(3) "ZYX"
- ["d"]=>
- string(3) "123"
- ["e"]=>
- array(1) {
- [0]=>
- array(1) {
- [0]=>
- string(1) "3"
- }
- }
-}
-string(115) "Unknown: Input variable nesting level exceeded 10. To increase the limit change max_input_nesting_level in php.ini."
diff --git a/tests/basic/bug20539.phpt b/tests/basic/bug20539.phpt
index 2b84d14189..99a88f66b5 100644
--- a/tests/basic/bug20539.phpt
+++ b/tests/basic/bug20539.phpt
@@ -9,10 +9,10 @@ session.save_handler=files
session.save_path=./tests/basic/
--FILE--
<?php
- print "good :)\n";
- $filename = __DIR__ . '/sess_' . session_id();
- var_dump(file_exists($filename));
- @unlink($filename);
+ print "good :)\n";
+ $filename = __DIR__ . '/sess_' . session_id();
+ var_dump(file_exists($filename));
+ @unlink($filename);
?>
--EXPECT--
good :)
diff --git a/tests/basic/bug31875.phpt b/tests/basic/bug31875.phpt
index 65f68b9af3..c8ad25ec9f 100644
--- a/tests/basic/bug31875.phpt
+++ b/tests/basic/bug31875.phpt
@@ -8,6 +8,8 @@ disable_functions=dl
<?php
$disabled_function = 'dl';
+/* exclude_disabled parameters is harded to true */
+
$functions = get_defined_functions();
var_dump(in_array($disabled_function, $functions['internal']));
@@ -17,7 +19,9 @@ var_dump(in_array($disabled_function, $functions['internal']));
$functions = get_defined_functions(true);
var_dump(in_array($disabled_function, $functions['internal']));
?>
---EXPECT--
-bool(true)
-bool(true)
+--EXPECTF--
+bool(false)
+
+Deprecated: get_defined_functions(): Setting $exclude_disabled to false has no effect in %s on line %d
+bool(false)
bool(false)
diff --git a/tests/basic/bug54514.phpt b/tests/basic/bug54514.phpt
index 0c5595e3f7..fad84d5c64 100644
--- a/tests/basic/bug54514.phpt
+++ b/tests/basic/bug54514.phpt
@@ -3,10 +3,11 @@ Req #54514 (Get php binary path during script execution)
--FILE--
<?php
if(realpath(getenv('TEST_PHP_EXECUTABLE')) === realpath(PHP_BINARY)) {
- echo "done";
+ echo "done";
} else {
- var_dump(getenv('TEST_PHP_EXECUTABLE'));
- var_dump(PHP_BINARY);
+ var_dump(getenv('TEST_PHP_EXECUTABLE'));
+ var_dump(PHP_BINARY);
}
+?>
--EXPECT--
done
diff --git a/tests/basic/bug61000.phpt b/tests/basic/bug61000.phpt
index 01e27bfd9b..7600fa2cc8 100644
--- a/tests/basic/bug61000.phpt
+++ b/tests/basic/bug61000.phpt
@@ -10,6 +10,7 @@ a[a][]=foo&a[a][b][c]=bar
<?php
print_r($_GET);
print_r($_POST);
+?>
--EXPECT--
Array
(
diff --git a/tests/basic/bug67198.phpt b/tests/basic/bug67198.phpt
index 3f5e2a348c..e5ffe3bf6c 100644
--- a/tests/basic/bug67198.phpt
+++ b/tests/basic/bug67198.phpt
@@ -41,6 +41,7 @@ php_cli_server_start(
var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context));
var_dump(file_get_contents("http://" . PHP_CLI_SERVER_ADDRESS, false, $context));
+?>
--EXPECT--
string(4) "PASS"
string(4) "PASS"
diff --git a/tests/basic/bug67988.phpt b/tests/basic/bug67988.phpt
index e1d8e5d7d4..2690a45620 100644
--- a/tests/basic/bug67988.phpt
+++ b/tests/basic/bug67988.phpt
@@ -16,6 +16,7 @@ var_dump(htmlentities("\xA3", ENT_HTML5, 'cp1252'));
var_dump(bin2hex(html_entity_decode("&pound;", ENT_HTML5)));
var_dump(bin2hex(html_entity_decode("&pound;", ENT_HTML5, 'cp1252')));
+?>
--EXPECT--
string(6) "cp1252"
string(0) ""
diff --git a/tests/basic/bug71273.phpt b/tests/basic/bug71273.phpt
index 3db4454605..7634d432d0 100644
--- a/tests/basic/bug71273.phpt
+++ b/tests/basic/bug71273.phpt
@@ -1,21 +1,13 @@
--TEST--
Bug #71273 A wrong ext directory setup in php.ini leads to crash
---SKIPIF--
-<?php
- if ("cli" != php_sapi_name()) {
- die("skip CLI only");
- }
-?>
--FILE--
<?php
- /* NOTE this file is required to be encoded in iso-8859-1 */
+ /* NOTE this file is required to be encoded in iso-8859-1 */
- $cmd = getenv('TEST_PHP_EXECUTABLE') . " -n -d html_errors=on -d extension_dir=a/é/w -d extension=php_kartoffelbrei.dll -v 2>&1";
- $out = shell_exec($cmd);
+ $cmd = getenv('TEST_PHP_EXECUTABLE') . " -n -d html_errors=on -d extension_dir=a/é/w -d extension=php_kartoffelbrei.dll -v 2>&1";
+ $out = shell_exec($cmd);
- var_dump(preg_match(",.+a[\\/].+[\\/]w.php_kartoffelbrei.dll.+,s", $out));
+ var_dump(preg_match(",.+a[\\/].+[\\/]w.php_kartoffelbrei.dll.+,s", $out));
?>
-==DONE==
--EXPECT--
int(1)
-==DONE==
diff --git a/tests/basic/bug78236.phpt b/tests/basic/bug78236.phpt
new file mode 100644
index 0000000000..9b56b1388c
--- /dev/null
+++ b/tests/basic/bug78236.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #78236 (convert error on receiving variables when duplicate [)
+--POST--
+id[name=1&id[[name=a&id[na me.=3
+--FILE--
+<?php
+var_dump($_POST);
+?>
+--EXPECT--
+array(3) {
+ ["id_name"]=>
+ string(1) "1"
+ ["id__name"]=>
+ string(1) "a"
+ ["id_na_me_"]=>
+ string(1) "3"
+}
diff --git a/tests/basic/consistent_float_string_casts.phpt b/tests/basic/consistent_float_string_casts.phpt
new file mode 100644
index 0000000000..adbc1b23ae
--- /dev/null
+++ b/tests/basic/consistent_float_string_casts.phpt
@@ -0,0 +1,30 @@
+--TEST--
+Test that float to string and string to float casts are consistent
+--SKIPIF--
+<?php
+if (!setlocale(
+ LC_ALL,
+ "german", "de", "de_DE", "de_DE.ISO8859-1", "de_DE.ISO_8859-1", "de_DE.UTF-8",
+ "french", "fr", "fr_FR", "fr_FR.ISO8859-1", "fr_FR.ISO_8859-1", "fr_FR.UTF-8",
+)) {
+ die("skip locale needed for this test is not supported on this platform");
+}
+?>
+--FILE--
+<?php
+
+setlocale(
+ LC_ALL,
+ "german", "de", "de_DE", "de_DE.ISO8859-1", "de_DE.ISO_8859-1", "de_DE.UTF-8",
+ "french", "fr", "fr_FR", "fr_FR.ISO8859-1", "fr_FR.ISO_8859-1", "fr_FR.UTF-8",
+);
+
+$float = 1/3;
+$string = (string) $float;
+$float = (float) $string;
+
+printf("%.2f", $float);
+
+?>
+--EXPECT--
+0,33
diff --git a/tests/basic/enable_post_data_reading_01.phpt b/tests/basic/enable_post_data_reading_01.phpt
index 19ee5d583f..9ce4fc288a 100644
--- a/tests/basic/enable_post_data_reading_01.phpt
+++ b/tests/basic/enable_post_data_reading_01.phpt
@@ -12,13 +12,14 @@ var_dump($_POST);
var_dump($HTTP_RAW_POST_DATA);
var_dump(file_get_contents("php://input"));
var_dump(file_get_contents("php://input"));
+?>
--EXPECTF--
array(0) {
}
array(0) {
}
-Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
+Warning: Undefined variable $HTTP_RAW_POST_DATA in %s on line %d
NULL
string(9) "a=1&b=ZYX"
string(9) "a=1&b=ZYX"
diff --git a/tests/basic/enable_post_data_reading_02.phpt b/tests/basic/enable_post_data_reading_02.phpt
index 4e1643ebd0..c8bd0c2517 100644
--- a/tests/basic/enable_post_data_reading_02.phpt
+++ b/tests/basic/enable_post_data_reading_02.phpt
@@ -16,6 +16,7 @@ var_dump($_FILES);
var_dump($_POST);
var_dump(file_get_contents("php://input"));
var_dump(file_get_contents("php://input"));
+?>
--EXPECTF--
array(0) {
}
diff --git a/tests/basic/enable_post_data_reading_03.phpt b/tests/basic/enable_post_data_reading_03.phpt
index 6a62282ea2..c0842382ea 100644
--- a/tests/basic/enable_post_data_reading_03.phpt
+++ b/tests/basic/enable_post_data_reading_03.phpt
@@ -13,13 +13,14 @@ var_dump($_POST);
var_dump($HTTP_RAW_POST_DATA);
var_dump(file_get_contents("php://input"));
var_dump(file_get_contents("php://input"));
+?>
--EXPECTF--
array(0) {
}
array(0) {
}
-Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
+Warning: Undefined variable $HTTP_RAW_POST_DATA in %s on line %d
NULL
string(9) "a=1&b=ZYX"
string(9) "a=1&b=ZYX"
diff --git a/tests/basic/enable_post_data_reading_04.phpt b/tests/basic/enable_post_data_reading_04.phpt
index a7c7e496d8..d309169cb0 100644
--- a/tests/basic/enable_post_data_reading_04.phpt
+++ b/tests/basic/enable_post_data_reading_04.phpt
@@ -13,13 +13,14 @@ var_dump($_POST);
var_dump($HTTP_RAW_POST_DATA);
var_dump(file_get_contents("php://input"));
var_dump(file_get_contents("php://input"));
+?>
--EXPECTF--
array(0) {
}
array(0) {
}
-Notice: Undefined variable: HTTP_RAW_POST_DATA in %s on line %d
+Warning: Undefined variable $HTTP_RAW_POST_DATA in %s on line %d
NULL
string(9) "a=1&b=ZYX"
string(9) "a=1&b=ZYX"
diff --git a/tests/basic/enable_post_data_reading_05.phpt b/tests/basic/enable_post_data_reading_05.phpt
index d8efa0129e..f6695f84c4 100644
--- a/tests/basic/enable_post_data_reading_05.phpt
+++ b/tests/basic/enable_post_data_reading_05.phpt
@@ -14,7 +14,7 @@ $f1 = fopen("php://input", "r");
$f2 = fopen("php://input", "r");
while (!feof($f1) && !feof($f2)) {
- echo fgetc($f1), fgetc($f2);
+ echo fgetc($f1), fgetc($f2);
}
?>
diff --git a/tests/basic/enable_post_data_reading_06.phpt b/tests/basic/enable_post_data_reading_06.phpt
index fbed195c03..8e9db3a1d8 100644
--- a/tests/basic/enable_post_data_reading_06.phpt
+++ b/tests/basic/enable_post_data_reading_06.phpt
@@ -95,7 +95,7 @@ $f1 = fopen("php://input", "r");
$f2 = fopen("php://input", "r");
while (!feof($f1) && !feof($f2)) {
- echo fgets($f1), fgets($f2);
+ echo fgets($f1), fgets($f2);
}
?>
diff --git a/tests/basic/precision.phpt b/tests/basic/precision.phpt
index 42f99dc9fb..1ee4c9a0fc 100644
--- a/tests/basic/precision.phpt
+++ b/tests/basic/precision.phpt
@@ -77,6 +77,7 @@ echo "OUTPUTS".PHP_EOL;
echo join(' ', $v).PHP_EOL;
var_dump(serialize($v));
var_export($v);echo PHP_EOL;
+?>
--EXPECT--
INI
-1
diff --git a/tests/basic/req44164.phpt b/tests/basic/req44164.phpt
index 7a142f5fb9..6786c16b75 100644
--- a/tests/basic/req44164.phpt
+++ b/tests/basic/req44164.phpt
@@ -13,5 +13,6 @@ HTTP_ACCEPT_ENCODING=gzip
<?php
header("Content-length: 200");
echo str_repeat("a", 200);
+?>
--EXPECT--
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
diff --git a/tests/basic/rfc1867_empty_upload.phpt b/tests/basic/rfc1867_empty_upload.phpt
index 77fe53ea58..2b89ca8888 100644
--- a/tests/basic/rfc1867_empty_upload.phpt
+++ b/tests/basic/rfc1867_empty_upload.phpt
@@ -31,10 +31,10 @@ Content-Type: text/plain-file3
var_dump($_FILES);
var_dump($_POST);
if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
- var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
}
if (is_uploaded_file($_FILES["file3"]["tmp_name"])) {
- var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
+ var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
}
?>
--EXPECTF--
diff --git a/tests/basic/rfc1867_max_file_size.phpt b/tests/basic/rfc1867_max_file_size.phpt
index 89406a407f..8d585f7503 100644
--- a/tests/basic/rfc1867_max_file_size.phpt
+++ b/tests/basic/rfc1867_max_file_size.phpt
@@ -31,10 +31,10 @@ Content-Type: text/plain-file3;
var_dump($_FILES);
var_dump($_POST);
if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
- var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
}
if (is_uploaded_file($_FILES["file3"]["tmp_name"])) {
- var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
+ var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
}
?>
--EXPECTF--
diff --git a/tests/basic/rfc1867_max_file_uploads_empty_files.phpt b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt
index 6ea7915c25..b85ed20971 100644
--- a/tests/basic/rfc1867_max_file_uploads_empty_files.phpt
+++ b/tests/basic/rfc1867_max_file_uploads_empty_files.phpt
@@ -31,10 +31,10 @@ Content-Type: text/plain-file
var_dump($_FILES);
var_dump($_POST);
if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
- var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
}
if (is_uploaded_file($_FILES["file4"]["tmp_name"])) {
- var_dump(file_get_contents($_FILES["file4"]["tmp_name"]));
+ var_dump(file_get_contents($_FILES["file4"]["tmp_name"]));
}
?>
--EXPECTF--
diff --git a/tests/basic/rfc1867_post_max_filesize.phpt b/tests/basic/rfc1867_post_max_filesize.phpt
index 58e05319a1..b03220e915 100644
--- a/tests/basic/rfc1867_post_max_filesize.phpt
+++ b/tests/basic/rfc1867_post_max_filesize.phpt
@@ -27,10 +27,10 @@ Content-Type: text/plain-file3
var_dump($_FILES);
var_dump($_POST);
if (is_uploaded_file($_FILES["file1"]["tmp_name"])) {
- var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
+ var_dump(file_get_contents($_FILES["file1"]["tmp_name"]));
}
if (is_uploaded_file($_FILES["file3"]["tmp_name"])) {
- var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
+ var_dump(file_get_contents($_FILES["file3"]["tmp_name"]));
}
?>
--EXPECTF--
diff --git a/tests/basic/timeout_variation_10.phpt b/tests/basic/timeout_variation_10.phpt
index b067238db5..7680c96adf 100644
--- a/tests/basic/timeout_variation_10.phpt
+++ b/tests/basic/timeout_variation_10.phpt
@@ -5,8 +5,6 @@ Timeout within shutdown function, variation
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (PHP_OS_FAMILY !== "Windows") die("skip Windows only test");
?>
---XFAIL--
-Missing timeout check in call_user_function
--FILE--
<?php
@@ -19,4 +17,5 @@ register_shutdown_function("sleep", 1);
shutdown happens after here
--EXPECTF--
shutdown happens after here
+
Fatal error: Maximum execution time of 1 second exceeded in %s on line %d
diff --git a/tests/basic/timeout_variation_9.phpt b/tests/basic/timeout_variation_9.phpt
index e59ae242dc..d645ef2bbf 100644
--- a/tests/basic/timeout_variation_9.phpt
+++ b/tests/basic/timeout_variation_9.phpt
@@ -5,8 +5,6 @@ Timeout within shutdown function
if (getenv("SKIP_SLOW_TESTS")) die("skip slow test");
if (PHP_OS_FAMILY !== "Windows") die("skip Windows only test");
?>
---XFAIL--
-Missing timeout check in call_user_function
--FILE--
<?php