From 853b2299d2b7d57dfe6ce415241368312b7dd680 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sat, 28 Sep 2024 17:27:45 +0200 Subject: [PATCH 1/2] Fix potential parallel test conflicts Both tests call `create_files()` with the same `$name_prefix` what might clash. --- ext/standard/tests/file/file_get_contents_basic.phpt | 4 ++-- ext/standard/tests/file/file_get_contents_error.phpt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/standard/tests/file/file_get_contents_basic.phpt b/ext/standard/tests/file/file_get_contents_basic.phpt index 5c060fdae1ba5..0207838bd936b 100644 --- a/ext/standard/tests/file/file_get_contents_basic.phpt +++ b/ext/standard/tests/file/file_get_contents_basic.phpt @@ -13,13 +13,13 @@ 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"); +create_files($file_path, 1, "text", 0755, 100, "w", "file_get_contents_basic", 1, "byte"); var_dump( file_get_contents($file_path."/file1.tmp") ); delete_files($file_path, 1); echo "\n-- Testing with empty file --\n"; -create_files($file_path, 1, "empty", 0755, 100, "w", "file", 1, "byte"); +create_files($file_path, 1, "empty", 0755, 100, "w", "file_get_contents_basic", 1, "byte"); var_dump( file_get_contents($file_path."/file1.tmp") ); delete_files($file_path, 1); diff --git a/ext/standard/tests/file/file_get_contents_error.phpt b/ext/standard/tests/file/file_get_contents_error.phpt index 12ddfc73f5787..60150ca2cd005 100644 --- a/ext/standard/tests/file/file_get_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_error.phpt @@ -13,7 +13,7 @@ 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"; From 4be4c6429a628abf84544be5ff663aa6a5f95adf Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sat, 28 Sep 2024 20:19:55 +0200 Subject: [PATCH 2/2] fix Co-authored-by: Gina Peter Bnayard --- ext/standard/tests/file/file_get_contents_basic.phpt | 8 ++++---- ext/standard/tests/file/file_get_contents_error.phpt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/standard/tests/file/file_get_contents_basic.phpt b/ext/standard/tests/file/file_get_contents_basic.phpt index 0207838bd936b..e4b8173e7a144 100644 --- a/ext/standard/tests/file/file_get_contents_basic.phpt +++ b/ext/standard/tests/file/file_get_contents_basic.phpt @@ -14,14 +14,14 @@ echo "-- Testing with simple valid data file --\n"; create_files($file_path, 1, "text", 0755, 100, "w", "file_get_contents_basic", 1, "byte"); -var_dump( file_get_contents($file_path."/file1.tmp") ); -delete_files($file_path, 1); +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_get_contents_basic", 1, "byte"); -var_dump( file_get_contents($file_path."/file1.tmp") ); -delete_files($file_path, 1); +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 ***"; ?> diff --git a/ext/standard/tests/file/file_get_contents_error.phpt b/ext/standard/tests/file/file_get_contents_error.phpt index 60150ca2cd005..5ac352123b309 100644 --- a/ext/standard/tests/file/file_get_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_error.phpt @@ -18,12 +18,12 @@ $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");