Skip to content

Commit 45deb01

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Skip large ftruncate test if large files not supported Don't test "blocks" in lstat_stat_variation7.phpt Increase FD used in php://fd test Use posix_getuid() to check for root in pcntl_setpriority() test
2 parents 97f9947 + edf7346 commit 45deb01

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

ext/pcntl/tests/pcntl_setpriority_basic.phpt

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ Er Galvão Abbott [email protected]
55
# TestFest 2017 PHPRS PHP UG 2017-10-31
66
--SKIPIF--
77
<?php
8-
if (!isset($_SERVER['SUDO_USER'])) {
9-
die('skip - this functions needs to run with superuser');
10-
}
11-
128
if (!extension_loaded('pcntl')) {
13-
die('skip - ext/pcntl not loaded');
14-
} else if (!function_exists('pcntl_setpriority')) {
15-
die('skip - pcntl_setpriority doesn\'t exist');
9+
die('skip ext/pcntl not loaded');
10+
}
11+
if (!function_exists('pcntl_setpriority')) {
12+
die('skip pcntl_setpriority doesn\'t exist');
13+
}
14+
if (!function_exists('posix_getuid') || posix_getuid() !== 0) {
15+
die('skip this functions needs to run with superuser');
1616
}
1717
?>
1818
--FILE--

ext/standard/tests/file/ftruncate_bug76422.phpt

+9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ if (false === $file_handle) {
1717
die('Cannot open test file :/');
1818
}
1919

20+
/* Check if ftruncate() with 2GB works. If it doesn't, it's likely that large files are
21+
* generally not supported (EFBIG). */
22+
$truncate_offset = 2 * 1024 * 1024 * 1024;
23+
$ftruncate_result = ftruncate($file_handle, $truncate_offset);
24+
if (false === $ftruncate_result) {
25+
var_dump(true);
26+
return;
27+
}
28+
2029
$truncate_offset = 4 * 1024 * 1024 * 1024 + 1;
2130
$ftruncate_result = ftruncate($file_handle, $truncate_offset);
2231

ext/standard/tests/file/lstat_stat_variation7.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $new_stat = stat($file_name);
3636
var_dump( compare_self_stat($old_stat) );
3737
var_dump( compare_self_stat($new_stat) );
3838
// compare the stats
39-
$comp_arr = array(7, 12, 'size', 'blocks');
39+
$comp_arr = array(7, 'size');
4040
var_dump(compare_stats($old_stat, $new_stat, $comp_arr, "<"));
4141
clearstatcache();
4242

ext/standard/tests/file/php_fd_wrapper_04.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
php://fd wrapper: invalid file descriptor
33
--FILE--
44
<?php
5-
fopen("php://fd/12", "w");
5+
fopen("php://fd/120", "w");
66

77
echo "\nDone.\n";
88
--EXPECTF--
9-
Warning: fopen(php://fd/12): failed to open stream: Error duping file descriptor 12; possibly it doesn't exist: [9]: %s in %s on line %d
9+
Warning: fopen(php://fd/120): failed to open stream: Error duping file descriptor 120; possibly it doesn't exist: [9]: %s in %s on line %d
1010

1111
Done.

0 commit comments

Comments
 (0)