summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRaghubansh Kumar <kraghuba@php.net>2007-12-25 16:14:32 +0000
committerRaghubansh Kumar <kraghuba@php.net>2007-12-25 16:14:32 +0000
commit74584f8521c2c7ab8500bba49d10d577857f7c6c (patch)
tree84b0d07e071f3ada51553127f112ddf76167a16b /ext
parenta84b22d125616facbb64968ee6e9166a1a6f76fc (diff)
downloadphp-git-74584f8521c2c7ab8500bba49d10d577857f7c6c.tar.gz
fix test : do not run when run as root
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/tests/dir/dir_variation3.phpt9
-rw-r--r--ext/standard/tests/dir/dir_variation7.phpt9
2 files changed, 18 insertions, 0 deletions
diff --git a/ext/standard/tests/dir/dir_variation3.phpt b/ext/standard/tests/dir/dir_variation3.phpt
index 67fbcf1649..0af648d4d6 100644
--- a/ext/standard/tests/dir/dir_variation3.phpt
+++ b/ext/standard/tests/dir/dir_variation3.phpt
@@ -5,6 +5,15 @@ Test dir() function : usage variations - different directory permissions
if( substr(PHP_OS, 0, 3) == 'WIN') {
die('skip Not for Windows');
}
+// Skip if being run by root (files are always readable, writeable and executable)
+$filename = dirname(__FILE__)."/dir_root_check.tmp";
+$fp = fopen($filename, 'w');
+fclose($fp);
+if(fileowner($filename) == 0) {
+ unlink ($filename);
+ die('skip...cannot be run as root\n');
+}
+unlink($filename);
?>
--FILE--
<?php
diff --git a/ext/standard/tests/dir/dir_variation7.phpt b/ext/standard/tests/dir/dir_variation7.phpt
index 351af8e503..b99fe41d4e 100644
--- a/ext/standard/tests/dir/dir_variation7.phpt
+++ b/ext/standard/tests/dir/dir_variation7.phpt
@@ -5,6 +5,15 @@ Test dir() function : usage variations - directories with restricted permissions
if( substr(PHP_OS, 0, 3) == 'WIN') {
die('skip Not for Windows');
}
+// Skip if being run by root (files are always readable, writeable and executable)
+$filename = dirname(__FILE__)."/dir_root_check.tmp";
+$fp = fopen($filename, 'w');
+fclose($fp);
+if(fileowner($filename) == 0) {
+ unlink ($filename);
+ die('skip...cannot be run as root\n');
+}
+unlink($filename);
?>
--FILE--
<?php