]> granicus.if.org Git - php/commitdiff
fix tests
authorRaghubansh Kumar <kraghuba@php.net>
Thu, 23 Aug 2007 09:32:37 +0000 (09:32 +0000)
committerRaghubansh Kumar <kraghuba@php.net>
Thu, 23 Aug 2007 09:32:37 +0000 (09:32 +0000)
ext/standard/tests/file/copy_variation15.phpt
ext/standard/tests/file/copy_variation9.phpt

index b17e7b6a59afef1f291f11b7db67cc0749884652..1278116899ceea6a57f443e0eb349a095211258a 100644 (file)
@@ -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
index 5f9cfd0023cfb46f086dd40f773bd7faf8d3b7fa..1450f3ebc5cd95d68dda921524fd47c52df0d0ce 100644 (file)
@@ -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