com php-src: split the glob() test to test different basedir: ext/standard/tests/file/glob_variation3.phpt ext/standa
rd/tests/file/glob_variation4.phpt ext/standard/tests/f ile/glob_variation5.phpt ext/standard/tests/file/glob _variation6.phpt
| From: | Stanislav Malyshev | Date: | Fri, 15 Aug 2014 00:04:51 +0000 |
| Subject: | com php-src: split the glob() test to test different basedir: ext/standard/tests/file/glob_variation3.phpt ext/standa rd/tests/file/glob_variation4.phpt ext/standard/tests/f ile/glob_variation5.phpt ext/standard/tests/file/glob _variation6.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79876@lists.php.net to get a copy of this message | ||
Commit: b7cd099ae04c926f8faedbf8c726984d9315ccb9
Author: Anatol Belski <ab@php.net> Tue, 20 Aug 2013 13:39:30 +0200
Committer: Stanislav Malyshev <stas@php.net> Thu, 14 Aug 2014 17:04:51 -0700
Parents: ad492ca9327fc9f7f0ea7a0ddd32e62cdf0c9137
Branches: PHP-5.4 PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b7cd099ae04c926f8faedbf8c726984d9315ccb9
Log:
split the glob() test to test different basedir
Changed paths:
M ext/standard/tests/file/glob_variation3.phpt
A ext/standard/tests/file/glob_variation4.phpt
A ext/standard/tests/file/glob_variation5.phpt
A ext/standard/tests/file/glob_variation6.phpt
Diff:
diff --git a/ext/standard/tests/file/glob_variation3.phpt
b/ext/standard/tests/file/glob_variation3.phpt
index 9c57ada..c50f8a8 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 0000000..00d8f64
--- /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 0000000..10db400
--- /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 0000000..9cd9c2b
--- /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==