From 1c99028adcd5a6a072344ba381d11c54b9d444d4 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 7 Jul 2023 19:11:02 -0400 Subject: [PATCH] ext/session/tests: more lenient expected output checks. Several session tests incidentally check the values of INI variables like session.name and session.save_path. This isn't the point of the tests, and it can cause spurious failures if (for example) you want to override your temporary directory while testing. So here, we make the expected output patterns more lenient. --- ext/session/tests/bug74514.phpt | 14 +++++++------- ext/session/tests/bug74936.phpt | 8 ++++---- ext/session/tests/user_session_module/gh7787.phpt | 8 ++++---- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ext/session/tests/bug74514.phpt b/ext/session/tests/bug74514.phpt index d2301e9464fcc..59d441e2f0499 100644 --- a/ext/session/tests/bug74514.phpt +++ b/ext/session/tests/bug74514.phpt @@ -25,10 +25,10 @@ var_dump(session_save_path()); var_dump(session_cache_limiter()); var_dump(session_cache_expire()); ?> ---EXPECT-- -string(9) "PHPSESSID" -string(3) "foo" -string(5) "files" -string(0) "" -string(7) "nocache" -int(180) +--EXPECTF-- +string(%d) "%S" +string(%d) "%S" +string(%d) "%S" +string(%d) "%S" +string(%d) "%S" +int(%d) diff --git a/ext/session/tests/bug74936.phpt b/ext/session/tests/bug74936.phpt index 9b1550e905be3..ed98145a2a74a 100644 --- a/ext/session/tests/bug74936.phpt +++ b/ext/session/tests/bug74936.phpt @@ -14,7 +14,7 @@ var_dump(session_cache_expire()); var_dump(session_cache_limiter()); var_dump(session_save_path()); ?> ---EXPECT-- -int(180) -string(7) "nocache" -string(0) "" +--EXPECTF-- +int(%d) +string(%d) "%S" +string(%d) "%S" diff --git a/ext/session/tests/user_session_module/gh7787.phpt b/ext/session/tests/user_session_module/gh7787.phpt index 26e0ec9685d92..124e82ce07efd 100644 --- a/ext/session/tests/user_session_module/gh7787.phpt +++ b/ext/session/tests/user_session_module/gh7787.phpt @@ -78,10 +78,10 @@ session_write_close(); ?> --EXPECTF-- -Warning: session_write_close(): Failed to write session data using user defined save handler. (session.save_path: , handler: MySessionHandler::write) in %s on line %d +Warning: session_write_close(): Failed to write session data using user defined save handler. (session.save_path: %S, handler: MySessionHandler::write) in %s on line %d -Warning: session_write_close(): Failed to write session data using user defined save handler. (session.save_path: , handler: MySessionHandler::updateTimestamp) in %s on line %d +Warning: session_write_close(): Failed to write session data using user defined save handler. (session.save_path: %S, handler: MySessionHandler::updateTimestamp) in %s on line %d -Warning: session_write_close(): Failed to write session data using user defined save handler. (session.save_path: , handler: write) in %s on line %d +Warning: session_write_close(): Failed to write session data using user defined save handler. (session.save_path: %S, handler: write) in %s on line %d -Warning: session_write_close(): Failed to write session data using user defined save handler. (session.save_path: , handler: update_timestamp) in %s on line %d +Warning: session_write_close(): Failed to write session data using user defined save handler. (session.save_path: %S, handler: update_timestamp) in %s on line %d