diff options
| author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-07-02 15:36:43 +0200 |
|---|---|---|
| committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-07-02 15:36:43 +0200 |
| commit | 1f12d9da5c68ef19890e7fb472b8e3e965bc77c6 (patch) | |
| tree | aff75dfe13f80610f6b052e54b8098485cd84911 | |
| parent | 1eefa09e9025b2ee28ac22875314bf249ce630ab (diff) | |
| parent | 1973ca21bd81032704608be20862d4f40c5b47c7 (diff) | |
| download | php-git-1f12d9da5c68ef19890e7fb472b8e3e965bc77c6.tar.gz | |
Merge branch 'PHP-7.4'
* PHP-7.4:
Enable most lstat_stat_* tests on Windows
17 files changed, 61 insertions, 115 deletions
diff --git a/ext/standard/tests/file/lstat_stat_error.phpt b/ext/standard/tests/file/lstat_stat_error.phpt index a28e9d8675..d2e4518f73 100644 --- a/ext/standard/tests/file/lstat_stat_error.phpt +++ b/ext/standard/tests/file/lstat_stat_error.phpt @@ -1,11 +1,5 @@ --TEST-- Test lstat() and stat() functions: error conditions ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. lstat() not available on Windows'); -} -?> --FILE-- <?php echo "*** Testing lstat() for error conditions ***\n"; diff --git a/ext/standard/tests/file/lstat_stat_variation1.phpt b/ext/standard/tests/file/lstat_stat_variation1.phpt index 6691617c89..9776cdea4d 100644 --- a/ext/standard/tests/file/lstat_stat_variation1.phpt +++ b/ext/standard/tests/file/lstat_stat_variation1.phpt @@ -1,11 +1,5 @@ --TEST-- Test lstat() and stat() functions: usage variations - effects of rename() on file ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} -?> --FILE-- <?php /* test the effects of rename() on stats of file */ diff --git a/ext/standard/tests/file/lstat_stat_variation10.phpt b/ext/standard/tests/file/lstat_stat_variation10.phpt index f002824b94..d4d142405d 100644 --- a/ext/standard/tests/file/lstat_stat_variation10.phpt +++ b/ext/standard/tests/file/lstat_stat_variation10.phpt @@ -3,9 +3,6 @@ Test lstat() and stat() functions: usage variations - effects of is_dir() --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} ?> --FILE-- <?php diff --git a/ext/standard/tests/file/lstat_stat_variation11.phpt b/ext/standard/tests/file/lstat_stat_variation11.phpt index 7ce8d7b539..91510209a6 100644 --- a/ext/standard/tests/file/lstat_stat_variation11.phpt +++ b/ext/standard/tests/file/lstat_stat_variation11.phpt @@ -3,9 +3,6 @@ Test lstat() and stat() functions: usage variations - effect of is_file() --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} ?> --FILE-- <?php diff --git a/ext/standard/tests/file/lstat_stat_variation12.phpt b/ext/standard/tests/file/lstat_stat_variation12.phpt index 7c39a46d02..71ebd5c51c 100644 --- a/ext/standard/tests/file/lstat_stat_variation12.phpt +++ b/ext/standard/tests/file/lstat_stat_variation12.phpt @@ -3,8 +3,9 @@ Test lstat() and stat() functions: usage variations - effects of is_link() --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. lstat() not available on Windows'); +if (PHP_OS_FAMILY === 'Windows') { + include_once __DIR__ . '/windows_links/common.inc'; + skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(__FILE__); } ?> --FILE-- diff --git a/ext/standard/tests/file/lstat_stat_variation13.phpt b/ext/standard/tests/file/lstat_stat_variation13.phpt index 8ffb6801e0..45f7a17c57 100644 --- a/ext/standard/tests/file/lstat_stat_variation13.phpt +++ b/ext/standard/tests/file/lstat_stat_variation13.phpt @@ -3,9 +3,6 @@ Test lstat() and stat() functions: usage variations - file opened using w and r --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} ?> --FILE-- <?php diff --git a/ext/standard/tests/file/lstat_stat_variation14.phpt b/ext/standard/tests/file/lstat_stat_variation14.phpt index c6a5971df3..9da7e65875 100644 --- a/ext/standard/tests/file/lstat_stat_variation14.phpt +++ b/ext/standard/tests/file/lstat_stat_variation14.phpt @@ -1,11 +1,5 @@ --TEST-- Test lstat() and stat() functions: usage variations - hardlink ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. lstat() not available on Windows'); -} -?> --FILE-- <?php /* test the effects of is_link() on stats of hard link */ diff --git a/ext/standard/tests/file/lstat_stat_variation15.phpt b/ext/standard/tests/file/lstat_stat_variation15.phpt index fba06d2770..2d1157d401 100644 --- a/ext/standard/tests/file/lstat_stat_variation15.phpt +++ b/ext/standard/tests/file/lstat_stat_variation15.phpt @@ -3,8 +3,9 @@ Test lstat() and stat() functions: usage variations - effects changing permissio --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. lstat() not available on Windows'); +if (PHP_OS_FAMILY === 'Windows') { + include_once __DIR__ . '/windows_links/common.inc'; + skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(__FILE__); } ?> --FILE-- diff --git a/ext/standard/tests/file/lstat_stat_variation18.phpt b/ext/standard/tests/file/lstat_stat_variation18.phpt index ddc256b771..9dc5af56c5 100644 --- a/ext/standard/tests/file/lstat_stat_variation18.phpt +++ b/ext/standard/tests/file/lstat_stat_variation18.phpt @@ -1,11 +1,5 @@ --TEST-- Test lstat() and stat() functions: usage variations - dir/file name stored in object ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} -?> --FILE-- <?php /* test for stats of dir/file when their names are stored in objects */ @@ -78,9 +72,9 @@ array(26) { [10]=> int(%d) [11]=> - int(%d) + int(%i) [12]=> - int(%d) + int(%i) ["dev"]=> int(%d) ["ino"]=> @@ -104,9 +98,9 @@ array(26) { ["ctime"]=> int(%d) ["blksize"]=> - int(%d) + int(%i) ["blocks"]=> - int(%d) + int(%i) } -- Testing stat() on directory name stored inside an object -- @@ -134,9 +128,9 @@ array(26) { [10]=> int(%d) [11]=> - int(%d) + int(%i) [12]=> - int(%d) + int(%i) ["dev"]=> int(%d) ["ino"]=> @@ -160,9 +154,9 @@ array(26) { ["ctime"]=> int(%d) ["blksize"]=> - int(%d) + int(%i) ["blocks"]=> - int(%d) + int(%i) } --- Done --- diff --git a/ext/standard/tests/file/lstat_stat_variation19.phpt b/ext/standard/tests/file/lstat_stat_variation19.phpt index 27307025d9..5f86d06ea5 100644 --- a/ext/standard/tests/file/lstat_stat_variation19.phpt +++ b/ext/standard/tests/file/lstat_stat_variation19.phpt @@ -1,11 +1,5 @@ --TEST-- Test lstat() and stat() functions: usage variations - dir/file names in array ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} -?> --FILE-- <?php /* test for stats of dir/file when their names are stored in an array */ @@ -79,9 +73,9 @@ array(26) { [10]=> int(%d) [11]=> - int(%d) + int(%i) [12]=> - int(%d) + int(%i) ["dev"]=> int(%d) ["ino"]=> @@ -105,9 +99,9 @@ array(26) { ["ctime"]=> int(%d) ["blksize"]=> - int(%d) + int(%i) ["blocks"]=> - int(%d) + int(%i) } array(26) { [0]=> @@ -133,9 +127,9 @@ array(26) { [10]=> int(%d) [11]=> - int(%d) + int(%i) [12]=> - int(%d) + int(%i) ["dev"]=> int(%d) ["ino"]=> @@ -159,9 +153,9 @@ array(26) { ["ctime"]=> int(%d) ["blksize"]=> - int(%d) + int(%i) ["blocks"]=> - int(%d) + int(%i) } -- Testing stat() on dir name stored inside an array -- @@ -189,9 +183,9 @@ array(26) { [10]=> int(%d) [11]=> - int(%d) + int(%i) [12]=> - int(%d) + int(%i) ["dev"]=> int(%d) ["ino"]=> @@ -215,9 +209,9 @@ array(26) { ["ctime"]=> int(%d) ["blksize"]=> - int(%d) + int(%i) ["blocks"]=> - int(%d) + int(%i) } array(26) { [0]=> @@ -243,9 +237,9 @@ array(26) { [10]=> int(%d) [11]=> - int(%d) + int(%i) [12]=> - int(%d) + int(%i) ["dev"]=> int(%d) ["ino"]=> @@ -269,9 +263,9 @@ array(26) { ["ctime"]=> int(%d) ["blksize"]=> - int(%d) + int(%i) ["blocks"]=> - int(%d) + int(%i) } --- Done --- diff --git a/ext/standard/tests/file/lstat_stat_variation2.phpt b/ext/standard/tests/file/lstat_stat_variation2.phpt index e708ed477a..efc03096a7 100644 --- a/ext/standard/tests/file/lstat_stat_variation2.phpt +++ b/ext/standard/tests/file/lstat_stat_variation2.phpt @@ -1,11 +1,5 @@ --TEST-- Test lstat() and stat() functions: usage variations - effects of rename() on dir ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} -?> --FILE-- <?php /* test the effects of rename() on stats of dir */ diff --git a/ext/standard/tests/file/lstat_stat_variation20.phpt b/ext/standard/tests/file/lstat_stat_variation20.phpt index 58efb30bfe..e7a334a7cd 100644 --- a/ext/standard/tests/file/lstat_stat_variation20.phpt +++ b/ext/standard/tests/file/lstat_stat_variation20.phpt @@ -1,11 +1,5 @@ --TEST-- Test lstat() and stat() functions: usage variations - link names stored in array/object ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. lstat() not available on Windows'); -} -?> --FILE-- <?php /* test for stats of link when their names are stored in object and array */ @@ -81,9 +75,9 @@ array(26) { [10]=> int(%d) [11]=> - int(%d) + int(%i) [12]=> - int(%d) + int(%i) ["dev"]=> int(%d) ["ino"]=> @@ -107,9 +101,9 @@ array(26) { ["ctime"]=> int(%d) ["blksize"]=> - int(%d) + int(%i) ["blocks"]=> - int(%d) + int(%i) } -- Testing stat() on link name stored inside an array -- @@ -137,9 +131,9 @@ array(26) { [10]=> int(%d) [11]=> - int(%d) + int(%i) [12]=> - int(%d) + int(%i) ["dev"]=> int(%d) ["ino"]=> @@ -163,9 +157,9 @@ array(26) { ["ctime"]=> int(%d) ["blksize"]=> - int(%d) + int(%i) ["blocks"]=> - int(%d) + int(%i) } array(26) { [0]=> @@ -191,9 +185,9 @@ array(26) { [10]=> int(%d) [11]=> - int(%d) + int(%i) [12]=> - int(%d) + int(%i) ["dev"]=> int(%d) ["ino"]=> @@ -217,9 +211,9 @@ array(26) { ["ctime"]=> int(%d) ["blksize"]=> - int(%d) + int(%i) ["blocks"]=> - int(%d) + int(%i) } array(26) { [0]=> @@ -245,9 +239,9 @@ array(26) { [10]=> int(%d) [11]=> - int(%d) + int(%i) [12]=> - int(%d) + int(%i) ["dev"]=> int(%d) ["ino"]=> @@ -271,9 +265,9 @@ array(26) { ["ctime"]=> int(%d) ["blksize"]=> - int(%d) + int(%i) ["blocks"]=> - int(%d) + int(%i) } --- Done --- diff --git a/ext/standard/tests/file/lstat_stat_variation22.phpt b/ext/standard/tests/file/lstat_stat_variation22.phpt index 017e323436..b89c5c5298 100644 --- a/ext/standard/tests/file/lstat_stat_variation22.phpt +++ b/ext/standard/tests/file/lstat_stat_variation22.phpt @@ -7,6 +7,7 @@ Dave Kelsey <d_kelsey@uk.ibm.com> if (substr(PHP_OS, 0, 3) == 'WIN') { die('skip ... not for Windows'); } +?> --CONFLICTS-- obscure_filename --FILE-- diff --git a/ext/standard/tests/file/lstat_stat_variation3.phpt b/ext/standard/tests/file/lstat_stat_variation3.phpt index 09f8ea9e94..231510dd07 100644 --- a/ext/standard/tests/file/lstat_stat_variation3.phpt +++ b/ext/standard/tests/file/lstat_stat_variation3.phpt @@ -2,8 +2,9 @@ Test lstat() and stat() functions: usage variations - effects of rename() on link --SKIPIF-- <?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); +if (PHP_OS_FAMILY === 'Windows') { + include_once __DIR__ . '/windows_links/common.inc'; + skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(__FILE__); } ?> --FILE-- diff --git a/ext/standard/tests/file/lstat_stat_variation4.phpt b/ext/standard/tests/file/lstat_stat_variation4.phpt index c0098cd1fa..27ea0bf248 100644 --- a/ext/standard/tests/file/lstat_stat_variation4.phpt +++ b/ext/standard/tests/file/lstat_stat_variation4.phpt @@ -3,9 +3,6 @@ Test lstat() and stat() functions: usage variations - effects of touch() on file --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} ?> --FILE-- <?php diff --git a/ext/standard/tests/file/lstat_stat_variation6.phpt b/ext/standard/tests/file/lstat_stat_variation6.phpt index 80b10ad5b3..729da4624f 100644 --- a/ext/standard/tests/file/lstat_stat_variation6.phpt +++ b/ext/standard/tests/file/lstat_stat_variation6.phpt @@ -3,17 +3,18 @@ Test lstat() and stat() functions: usage variations - effects of touch() on link --SKIPIF-- <?php if (getenv("SKIP_SLOW_TESTS")) die("skip slow test"); -if (!(stristr(PHP_OS, 'linux'))) { - die('skip.. test valid for linux only'); -} +if (PHP_OS_FAMILY === 'Windows') { + include_once __DIR__ . '/windows_links/common.inc'; + skipIfSeCreateSymbolicLinkPrivilegeIsDisabled(__FILE__); +} else { // checking for atime update whether it is enabled or disabled -exec("mount", $mount_output); -foreach( $mount_output as $out ) { - if( stristr($out, "noatime") ) - die('skip.. atime update is disabled, hence skip the test'); + exec("mount", $mount_output); + foreach( $mount_output as $out ) { + if( stristr($out, "noatime") ) + die('skip.. atime update is disabled, hence skip the test'); + } } - ?> --FILE-- <?php diff --git a/ext/standard/tests/file/lstat_stat_variation7.phpt b/ext/standard/tests/file/lstat_stat_variation7.phpt index 223e8f9b94..fab011dd20 100644 --- a/ext/standard/tests/file/lstat_stat_variation7.phpt +++ b/ext/standard/tests/file/lstat_stat_variation7.phpt @@ -1,11 +1,5 @@ --TEST-- Test lstat() and stat() functions: usage variations - writing data into file ---SKIPIF-- -<?php -if (substr(PHP_OS, 0, 3) == 'WIN') { - die('skip.. Not valid for Windows'); -} -?> --FILE-- <?php $file_path = __DIR__; @@ -22,7 +16,8 @@ echo "*** Testing stat() on file after data is written in it ***\n"; $fh = fopen($file_name,"w"); $old_stat = stat($file_name); clearstatcache(); -fwrite($fh, str_repeat("Hello World", $old_stat['blksize'])); +$blksize = PHP_OS_FAMILY === 'Windows' ? 4096 : $old_stat['blksize']; +fwrite($fh, str_repeat("Hello World", $blksize)); $new_stat = stat($file_name); // compare self stats |
