summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/is_executable_variation3.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/tests/file/is_executable_variation3.phpt')
-rw-r--r--ext/standard/tests/file/is_executable_variation3.phpt13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/standard/tests/file/is_executable_variation3.phpt b/ext/standard/tests/file/is_executable_variation3.phpt
index 4ec53a5ab2..634ce1f40c 100644
--- a/ext/standard/tests/file/is_executable_variation3.phpt
+++ b/ext/standard/tests/file/is_executable_variation3.phpt
@@ -5,6 +5,16 @@ Test is_executable() function: usage variations - invalid file names
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__)."/is_executable_root_check.tmp";
+$fp = fopen($filename, 'w');
+fclose($fp);
+if(fileowner($filename) == 0) {
+ unlink ($filename);
+ die('skip cannot be run as root');
+}
+
+unlink($filename);
?>
--FILE--
<?php
@@ -27,6 +37,7 @@ $invalid_files = array(
TRUE,
FALSE,
NULL,
+ " ",
@array(),
@$file_handle
);
@@ -49,8 +60,10 @@ bool(false)
bool(false)
bool(false)
bool(false)
+bool(false)
Warning: is_executable() expects parameter 1 to be string, array given in %s on line %d
NULL
bool(false)
Done
+