1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix potential parallel test conflicts

Both tests call `create_files()` with the same `$name_prefix` what
might clash.

Co-authored-by: Gina Peter Banyard <girgias@php.net>

Closes GH-16103.
This commit is contained in:
Christoph M. Becker
2024-09-28 20:19:55 +02:00
parent 19bba83715
commit f5649556ea
2 changed files with 9 additions and 9 deletions

View File

@@ -13,15 +13,15 @@ echo "*** Testing the basic functionality of the file_get_contents() function **
echo "-- Testing with simple valid data file --\n";
create_files($file_path, 1, "text", 0755, 100, "w", "file", 1, "byte");
var_dump( file_get_contents($file_path."/file1.tmp") );
delete_files($file_path, 1);
create_files($file_path, 1, "text", 0755, 100, "w", "file_get_contents_basic", 1, "byte");
var_dump( file_get_contents($file_path."/file_get_contents_basic1.tmp") );
delete_files($file_path, 1, "file_get_contents_basic", 1);
echo "\n-- Testing with empty file --\n";
create_files($file_path, 1, "empty", 0755, 100, "w", "file", 1, "byte");
var_dump( file_get_contents($file_path."/file1.tmp") );
delete_files($file_path, 1);
create_files($file_path, 1, "empty", 0755, 100, "w", "file_get_contents_basic", 1, "byte");
var_dump( file_get_contents($file_path."/file_get_contents_basic1.tmp") );
delete_files($file_path, 1, "file_get_contents_basic", 1);
echo "\n*** Done ***";
?>

View File

@@ -13,17 +13,17 @@ include($file_path."/file.inc");
echo "\n-- Testing with Non-existing file --\n";
print( file_get_contents("/no/such/file/or/dir") );
create_files($file_path, 1, "text", 0755, 100, "w", "file", 1, "byte");
create_files($file_path, 1, "text", 0755, 100, "w", "file_get_contents_error", 1, "byte");
$file_handle = fopen($file_path."/file_put_contents_error.tmp", "w");
echo "\n-- Testing for invalid negative maxlen values --\n";
try {
file_get_contents($file_path."/file1.tmp", FALSE, $file_handle, 0, -5);
file_get_contents($file_path."/file_get_contents_error1.tmp", FALSE, $file_handle, 0, -5);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
delete_files($file_path, 1);
delete_files($file_path, 1, "file_get_contents_error", 1);
fclose($file_handle);
unlink($file_path."/file_put_contents_error.tmp");