Browse Source

Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  split the glob() test to test different basedir
pull/782/head
Stanislav Malyshev 12 years ago
parent
commit
008330e5b3
  1. 41
      ext/standard/tests/file/glob_variation3.phpt
  2. 33
      ext/standard/tests/file/glob_variation4.phpt
  3. 29
      ext/standard/tests/file/glob_variation5.phpt
  4. 35
      ext/standard/tests/file/glob_variation6.phpt

41
ext/standard/tests/file/glob_variation3.phpt

@ -5,22 +5,7 @@ Test glob() function: ensure no platform difference
$path = dirname(__FILE__);
ini_set('open_basedir', NULL);
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"));
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"));
ini_set('open_basedir', '/tmp');
var_dump(glob("$path/*.none"));
var_dump(glob("$path/?.none"));
var_dump(glob("$path/*{hello,world}.none"));
@ -28,6 +13,7 @@ var_dump(glob("$path/*/nothere"));
var_dump(glob("$path/[aoeu]*.none"));
var_dump(glob("$path/directly_not_exists"));
var_dump(empty(ini_get('open_basedir')));
?>
==DONE==
--EXPECT--
@ -43,28 +29,5 @@ array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
array(0) {
}
bool(true)
==DONE==

33
ext/standard/tests/file/glob_variation4.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==

29
ext/standard/tests/file/glob_variation5.phpt

@ -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==

35
ext/standard/tests/file/glob_variation6.phpt

@ -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==
Loading…
Cancel
Save