diff options
| author | Fabien Villepinte <fabien.villepinte@gmail.com> | 2019-10-05 14:26:33 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-10-08 18:20:13 +0200 |
| commit | 8b5c351154284a88152ee3d166a32dc77316a658 (patch) | |
| tree | e38e10fe7b65983618ae29a290adea19a97f005d /ext/standard/tests/file/lchown_error.phpt | |
| parent | bea832cbf6b7a06ee65b93902233864c1ac9ec98 (diff) | |
| download | php-git-8b5c351154284a88152ee3d166a32dc77316a658.tar.gz | |
Avoid file clash in root_check skipifs
Extract root check into skipif_root.inc to share this commonly
repeated logic.
Closes GH-4779.
Diffstat (limited to 'ext/standard/tests/file/lchown_error.phpt')
| -rw-r--r-- | ext/standard/tests/file/lchown_error.phpt | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/ext/standard/tests/file/lchown_error.phpt b/ext/standard/tests/file/lchown_error.phpt index fd54b482b3..dbd9a7bbe8 100644 --- a/ext/standard/tests/file/lchown_error.phpt +++ b/ext/standard/tests/file/lchown_error.phpt @@ -4,15 +4,7 @@ Test lchown() function : error functionality <?php if (substr(PHP_OS, 0, 3) == 'WIN') die('skip no windows support'); if (!function_exists("posix_getuid")) die("skip no posix_getuid()"); -// Skip if being run by root -$filename = __DIR__."/lchow_error_root_check.tmp"; -$fp = fopen($filename, 'w'); -fclose($fp); -if(fileowner($filename) == 0) { - unlink ($filename); - die('skip cannot be run as root'); -} -unlink($filename); +require __DIR__ . '/../skipif_root.inc'; ?> --FILE-- <?php |
