Skip to content

Commit 3d0a0f8

Browse files
committed
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.
1 parent d19b6aa commit 3d0a0f8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

run-tests.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,9 +1604,8 @@ function run_test($php, $file, $env)
16041604
// Any special ini settings
16051605
// these may overwrite the test defaults...
16061606
if (array_key_exists('INI', $section_text)) {
1607-
if (strpos($section_text['INI'], '{PWD}') !== false) {
1608-
$section_text['INI'] = str_replace('{PWD}', dirname($file), $section_text['INI']);
1609-
}
1607+
$section_text['INI'] = str_replace('{PWD}', dirname($file), $section_text['INI']);
1608+
$section_text['INI'] = str_replace('{TMP}', sys_get_temp_dir(), $section_text['INI']);
16101609
settings2array(preg_split( "/[\n\r]+/", $section_text['INI']), $ini_settings);
16111610
}
16121611

0 commit comments

Comments
 (0)