Browse Source
Merge branch 'PHP-5.4' into PHP-5.5
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4: split the glob() test to test different basedirpull/782/head
4 changed files with 99 additions and 39 deletions
-
41ext/standard/tests/file/glob_variation3.phpt
-
33ext/standard/tests/file/glob_variation4.phpt
-
29ext/standard/tests/file/glob_variation5.phpt
-
35ext/standard/tests/file/glob_variation6.phpt
@ -0,0 +1,33 @@ |
|||
--TEST-- |
|||
Test glob() function: ensure no platform difference, variation 2 |
|||
--FILE-- |
|||
<?php |
|||
$path = dirname(__FILE__); |
|||
|
|||
ini_set('open_basedir', $path); |
|||
|
|||
var_dump(glob("$path/*.none")); |
|||
var_dump(glob("$path/?.none")); |
|||
var_dump(glob("$path/*{hello,world}.none")); |
|||
var_dump(glob("$path/*/nothere")); |
|||
var_dump(glob("$path/[aoeu]*.none")); |
|||
var_dump(glob("$path/directly_not_exists")); |
|||
|
|||
var_dump($path == ini_get('open_basedir')); |
|||
?> |
|||
==DONE== |
|||
--EXPECT-- |
|||
array(0) { |
|||
} |
|||
array(0) { |
|||
} |
|||
array(0) { |
|||
} |
|||
array(0) { |
|||
} |
|||
array(0) { |
|||
} |
|||
array(0) { |
|||
} |
|||
bool(true) |
|||
==DONE== |
|||
@ -0,0 +1,29 @@ |
|||
--TEST-- |
|||
Test glob() function: ensure no platform difference, variation 3 |
|||
--SKIPIF-- |
|||
<?php if( substr(PHP_OS, 0, 3) == "WIN" ) {die('skip not valid on Windows');} ?> |
|||
--FILE-- |
|||
<?php |
|||
$path = dirname(__FILE__); |
|||
|
|||
ini_set('open_basedir', '/tmp'); |
|||
|
|||
var_dump(glob("$path/*.none")); |
|||
var_dump(glob("$path/?.none")); |
|||
var_dump(glob("$path/*{hello,world}.none")); |
|||
var_dump(glob("$path/*/nothere")); |
|||
var_dump(glob("$path/[aoeu]*.none")); |
|||
var_dump(glob("$path/directly_not_exists")); |
|||
|
|||
var_dump('/tmp' == ini_get('open_basedir')); |
|||
?> |
|||
==DONE== |
|||
--EXPECT-- |
|||
bool(false) |
|||
bool(false) |
|||
bool(false) |
|||
bool(false) |
|||
bool(false) |
|||
bool(false) |
|||
bool(true) |
|||
==DONE== |
|||
@ -0,0 +1,35 @@ |
|||
--TEST-- |
|||
Test glob() function: ensure no platform difference, variation 4 |
|||
--SKIPIF-- |
|||
<?php if( substr(PHP_OS, 0, 3) != "WIN" ) {die('skip only valid on Windows');} ?> |
|||
--FILE-- |
|||
<?php |
|||
$path = dirname(__FILE__); |
|||
|
|||
ini_set('open_basedir', 'c:\\windows'); |
|||
|
|||
var_dump(glob("$path/*.none")); |
|||
var_dump(glob("$path/?.none")); |
|||
var_dump(glob("$path/*{hello,world}.none")); |
|||
var_dump(glob("$path/*/nothere")); |
|||
var_dump(glob("$path/[aoeu]*.none")); |
|||
var_dump(glob("$path/directly_not_exists")); |
|||
|
|||
var_dump('c:\\windows' == ini_get('open_basedir')); |
|||
?> |
|||
==DONE== |
|||
--EXPECT-- |
|||
array(0) { |
|||
} |
|||
array(0) { |
|||
} |
|||
array(0) { |
|||
} |
|||
array(0) { |
|||
} |
|||
array(0) { |
|||
} |
|||
array(0) { |
|||
} |
|||
bool(true) |
|||
==DONE== |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue