diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2019-05-08 17:54:02 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2019-05-08 19:21:38 +0200 |
commit | 3d0a0f801b6eb0ec7d4fdee119b339d2dab9771f (patch) | |
tree | 614ef926e547fb068902cd2572c89af2eb0a6336 /run-tests.php | |
parent | d19b6aa5ba6ea7b488cca748934264e11469f3d5 (diff) | |
download | php-git-3d0a0f801b6eb0ec7d4fdee119b339d2dab9771f.tar.gz |
Add {TMP} placeholder for PHPT INI sections
Several tests use `/tmp` in the `--INI--` section, but this is not
portable. We therefore introduce the `{TMP}` placeholder which
evaluates to the system's temporary directory using
`sys_get_temp_dir()`.
We also remove the doubtful `strpos()` optimization.
Diffstat (limited to 'run-tests.php')
-rwxr-xr-x | run-tests.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/run-tests.php b/run-tests.php index 2801959f10..1e07509506 100755 --- a/run-tests.php +++ b/run-tests.php @@ -1604,9 +1604,8 @@ TEST $file // Any special ini settings // these may overwrite the test defaults... if (array_key_exists('INI', $section_text)) { - if (strpos($section_text['INI'], '{PWD}') !== false) { - $section_text['INI'] = str_replace('{PWD}', dirname($file), $section_text['INI']); - } + $section_text['INI'] = str_replace('{PWD}', dirname($file), $section_text['INI']); + $section_text['INI'] = str_replace('{TMP}', sys_get_temp_dir(), $section_text['INI']); settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), $ini_settings); } |