]> granicus.if.org Git - php/commitdiff
fix test: skip if user is root
authorRaghubansh Kumar <kraghuba@php.net>
Mon, 20 Aug 2007 03:12:36 +0000 (03:12 +0000)
committerRaghubansh Kumar <kraghuba@php.net>
Mon, 20 Aug 2007 03:12:36 +0000 (03:12 +0000)
ext/standard/tests/file/symlink_link_linkinfo_is_link_variation6.phpt

index 29ef734934283e71920095b7f98a2a2fc919c921..24facf4b21ae7b514be4ffd27d433aa02b9ea9ad 100644 (file)
@@ -11,6 +11,17 @@ if ( substr(PHP_OS, 0, 3) == 'MAC' ) {
 if (PHP_INT_SIZE != 4) {
   die("skip this test is for 32bit platform only");
 }
+
+// Skip if being run by root (files are always readable, writeable and executable)
+$filename = dirname(__FILE__)."/symlink_link_linkinfo_is_link6_check_root.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