[php-src] PHP-8.5: sapi/cli/tests/023.phpt: support TEST_PHP_EXTRA_ARGS
| From: | Michael Orlitzky via Gina Peter Banyard | Date: | Wed, 14 Oct 2026 17:44:23 +0000 |
| Subject: | [php-src] PHP-8.5: sapi/cli/tests/023.phpt: support TEST_PHP_EXTRA_ARGS | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-142279@lists.php.net to get a copy of this message | ||
Author: Michael Orlitzky (orlitzky)
Committer: Gina Peter Banyard (Girgias)
Date: 2026-10-14T18:34:07+01:00
Commit: https://github.com/php/php-src/commit/c522554a02dbecf23738b82b590bb1dd983591a5
Raw diff: https://github.com/php/php-src/commit/c522554a02dbecf23738b82b590bb1dd983591a5.diff
sapi/cli/tests/023.phpt: support TEST_PHP_EXTRA_ARGS
This test runs the PHP test executable from the command-line, but was
not passing TEST_PHP_EXTRA_ARGS to it from run-tests.php. This commit
adds the args, but also updates the test case.
This test relies on memory_limit being updated by an INI file
(generated on-the-fly), but by default, run-tests.php overrides PHP's
memory_limit using TEST_PHP_EXTRA_ARGS. So if we pass the extra args
to PHP, then the memory limit will be constant. To work around that,
we switch to using max_input_vars (as opposed to memory_limit) inside
the test.
Changed paths:
M sapi/cli/tests/023.phpt
Diff:
diff --git a/sapi/cli/tests/023.phpt b/sapi/cli/tests/023.phpt
index ae8ac5e8da3b..4dbe436a8a80 100644
--- a/sapi/cli/tests/023.phpt
+++ b/sapi/cli/tests/023.phpt
@@ -8,18 +8,19 @@ if (substr(PHP_OS, 0, 3) == "WIN") die("skip non windows
test");
--FILE--
<?php
$php = getenv("TEST_PHP_EXECUTABLE_ESCAPED");
+$args = getenv("TEST_PHP_EXTRA_ARGS");
$cwd = getcwd();
$ini_file = __DIR__ . "/023.ini";
$ini_file_escaped = escapeshellarg($ini_file);
file_put_contents($ini_file, <<<INI
; no sections should match as cli doesn't support any
-memory_limit = 40M
+max_input_vars = 4
[PATH={$cwd}]
-memory_limit = 50M
+max_input_vars = 5
[PATH=/does/not/exist]
-memory_limit = 60M
+max_input_vars = 6
[HOST=some_fake_host]
-memory_limit = 70M
+max_input_vars = 7
INI
);
$desc = array(
@@ -28,7 +29,7 @@ $desc = array(
2 => array("pipe", "w"),
);
$pipes = array();
-$proc = proc_open("$php -c $ini_file_escaped -r 'echo
ini_get(\"memory_limit\");'", $desc, $pipes);
+$proc = proc_open("$php $args -c $ini_file_escaped -r 'echo
ini_get(\"max_input_vars\");'", $desc, $pipes);
if (!$proc) {
exit(1);
}
@@ -43,5 +44,5 @@ proc_close($proc);
unlink(__DIR__ . "/023.ini");
?>
--EXPECT--
-string(3) "40M"
+string(1) "4"
string(0) ""