summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2013-08-20 13:39:30 +0200
committerAnatol Belski <ab@php.net>2013-08-20 13:40:19 +0200
commit827100df823e5a36c97b808407e775f5d203164c (patch)
tree9ff048df983facca36c1106d1c49fb62a6143907
parent8da7aa7e4189f0be434b7c936840429302e021b6 (diff)
downloadphp-git-827100df823e5a36c97b808407e775f5d203164c.tar.gz
split the glob() test to test different basedir
-rw-r--r--ext/standard/tests/file/glob_variation3.phpt41
-rw-r--r--ext/standard/tests/file/glob_variation4.phpt33
-rw-r--r--ext/standard/tests/file/glob_variation5.phpt29
-rw-r--r--ext/standard/tests/file/glob_variation6.phpt35
4 files changed, 99 insertions, 39 deletions
diff --git a/ext/standard/tests/file/glob_variation3.phpt b/ext/standard/tests/file/glob_variation3.phpt
index 9c57ada3be..c50f8a81b8 100644
--- a/ext/standard/tests/file/glob_variation3.phpt
+++ b/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==
diff --git a/ext/standard/tests/file/glob_variation4.phpt b/ext/standard/tests/file/glob_variation4.phpt
new file mode 100644
index 0000000000..00d8f648aa
--- /dev/null
+++ b/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==
diff --git a/ext/standard/tests/file/glob_variation5.phpt b/ext/standard/tests/file/glob_variation5.phpt
new file mode 100644
index 0000000000..10db40099b
--- /dev/null
+++ b/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==
diff --git a/ext/standard/tests/file/glob_variation6.phpt b/ext/standard/tests/file/glob_variation6.phpt
new file mode 100644
index 0000000000..9cd9c2b353
--- /dev/null
+++ b/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==