summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaghubansh Kumar <kraghuba@php.net>2007-08-23 09:32:37 +0000
committerRaghubansh Kumar <kraghuba@php.net>2007-08-23 09:32:37 +0000
commitede06426eef04535e715a70bf5baaf757037c88a (patch)
tree4ae64cd2c17e6401d0812624d699bb18807a53b9
parent89c0ba1685032b0da7626f794fbea215a5b78cf2 (diff)
downloadphp-git-ede06426eef04535e715a70bf5baaf757037c88a.tar.gz
fix tests
-rw-r--r--ext/standard/tests/file/copy_variation15.phpt9
-rw-r--r--ext/standard/tests/file/copy_variation9.phpt10
2 files changed, 19 insertions, 0 deletions
diff --git a/ext/standard/tests/file/copy_variation15.phpt b/ext/standard/tests/file/copy_variation15.phpt
index b17e7b6a59..1278116899 100644
--- a/ext/standard/tests/file/copy_variation15.phpt
+++ b/ext/standard/tests/file/copy_variation15.phpt
@@ -4,6 +4,15 @@ Test copy() function: usage variations - destination dir access perms
<?php
if( (stristr(PHP_OS, "Mac")) || (substr(PHP_OS, 0, 3) == "WIN") )
die("skip do not run on Win/MacOS");
+// Skip if being run by root (files are always readable, writeable and executable)
+$filename = dirname(__FILE__)."/copy_variation15_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/file/copy_variation9.phpt b/ext/standard/tests/file/copy_variation9.phpt
index 5f9cfd0023..1450f3ebc5 100644
--- a/ext/standard/tests/file/copy_variation9.phpt
+++ b/ext/standard/tests/file/copy_variation9.phpt
@@ -4,6 +4,16 @@ Test copy() function: usage variations - destination file access perms
<?php
if( (stristr(PHP_OS, "Mac")) || (substr(PHP_OS, 0, 3) == "WIN") )
die("skip do not run on Win/MacOS");
+
+// Skip if being run by root (files are always readable, writeable and executable)
+$filename = dirname(__FILE__)."/copy_variation9_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