From 092e090cf00477e51802eae39651493b718c1415 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 10 Jul 2023 04:25:25 -0400 Subject: [PATCH] ext/session/tests: more lenient expected output checks. (#11631) 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 d2301e9464f..59d441e2f04 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 9b1550e905b..ed98145a2a7 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 26e0ec9685d..124e82ce07e 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