Skip to content

Commit 976dd99

Browse files
committed
Fix open_basedir tests when running from /tmp
If our cwd is in /tmp, these tests would fail. Use a directory name that is less likely to clash.
1 parent 7bc8f2c commit 976dd99

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ext/standard/tests/file/bug41655_1.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
99
--CREDITS--
1010
Dave Kelsey <[email protected]>
1111
--INI--
12-
open_basedir="{TMP}"
12+
open_basedir="/some_directory_we_are_hopefully_not_running_tests_from"
1313
--FILE--
1414
<?php
1515
$a=glob("./*.jpeg");

ext/standard/tests/file/glob_variation5.phpt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Test glob() function: ensure no platform difference, variation 3
66
<?php
77
$path = __DIR__;
88

9-
ini_set('open_basedir', '/tmp');
9+
$open_basedir = '/some_directory_we_are_hopefully_not_running_tests_from';
10+
ini_set('open_basedir', $open_basedir);
1011

1112
var_dump(glob("$path/*.none"));
1213
var_dump(glob("$path/?.none"));
@@ -15,7 +16,7 @@ var_dump(glob("$path/*/nothere"));
1516
var_dump(glob("$path/[aoeu]*.none"));
1617
var_dump(glob("$path/directly_not_exists"));
1718

18-
var_dump('/tmp' == ini_get('open_basedir'));
19+
var_dump($open_basedir == ini_get('open_basedir'));
1920
?>
2021
--EXPECT--
2122
bool(false)

0 commit comments

Comments
 (0)