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

index 12521b76bf8681ef0080f47a6a716c59ea1c480d..402f41a5fc6fe0d5cdfff20c8aee5dc1a67d5637 100644 (file)
@@ -1,10 +1,18 @@
 --TEST--
 Test copy() function: usage variations - destination dir access perms
 --SKIPIF--
---SKIPIF--
 <?php
-if( (substr(PHP_OS, 0, 3) == "WIN") || (stristr(PHP_OS, "Mac")) )
+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 b7c3a2ffbf3029ab5e6f0ad9dd52ca477386cc87..8af4f7f14aaccbd6f836def9b5cea238bb821df0 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