diff options
Diffstat (limited to 'ext/session/tests')
50 files changed, 281 insertions, 211 deletions
diff --git a/ext/session/tests/014.phpt b/ext/session/tests/014.phpt index cbf22b142d..d8369cfec5 100644 --- a/ext/session/tests/014.phpt +++ b/ext/session/tests/014.phpt @@ -33,8 +33,8 @@ session_destroy(); --EXPECTF-- <a href="/link"> -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line %d +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d <a href="/link"> -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line %d +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d <a href="/link"> diff --git a/ext/session/tests/016.phpt b/ext/session/tests/016.phpt index aa7ba1cebb..8a076a1d9f 100644 --- a/ext/session/tests/016.phpt +++ b/ext/session/tests/016.phpt @@ -22,7 +22,7 @@ session_write_close(); print "I live\n"; ?> --EXPECTF-- -Warning: session_start(): Failed to create session data file path. Too short session ID, invalid save_path or path lentgth exceeds MAXPATHLEN(%d) in %s on line 4 +Warning: session_start(): Failed to create session data file path. Too short session ID, invalid save_path or path length exceeds %d characters in %s on line %d Warning: session_start(): Failed to read session data: files (path: 123;:/really%scompletely:::/invalid;;,23123;213) in %s on line 4 I live diff --git a/ext/session/tests/029.phpt b/ext/session/tests/029.phpt index 23676ecbda..518ead85d6 100644 --- a/ext/session/tests/029.phpt +++ b/ext/session/tests/029.phpt @@ -14,7 +14,7 @@ session_decode("userid|s:5:\"mazen\";chatRoom|s:1:\"1\";"); print "I live\n"; ?> --EXPECTF-- -Warning: session_decode(): Session is not active. You cannot decode session data in %s on line %d +Warning: session_decode(): Session data cannot be decoded when there is no active session in %s on line %d -Warning: session_decode(): Session is not active. You cannot decode session data in %s on line %d +Warning: session_decode(): Session data cannot be decoded when there is no active session in %s on line %d I live diff --git a/ext/session/tests/bug31454.phpt b/ext/session/tests/bug31454.phpt index 9e99135e5f..4ae0dbd7f5 100644 --- a/ext/session/tests/bug31454.phpt +++ b/ext/session/tests/bug31454.phpt @@ -5,16 +5,21 @@ Bug #31454 (session_set_save_handler crashes PHP when supplied non-existent obje --FILE-- <?php -session_set_save_handler( - array(&$arf, 'open'), - array(&$arf, 'close'), - array(&$arf, 'read'), - array(&$arf, 'write'), - array(&$arf, 'destroy'), - array(&$arf, 'gc')); +try { + session_set_save_handler( + array(&$arf, 'open'), + array(&$arf, 'close'), + array(&$arf, 'read'), + array(&$arf, 'write'), + array(&$arf, 'destroy'), + array(&$arf, 'gc') + ); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} echo "Done\n"; ?> ---EXPECTF-- -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %sbug31454.php on line %d +--EXPECT-- +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "Array" not found or invalid function name Done diff --git a/ext/session/tests/bug60860.phpt b/ext/session/tests/bug60860.phpt index e2b961c387..487fba5307 100644 --- a/ext/session/tests/bug60860.phpt +++ b/ext/session/tests/bug60860.phpt @@ -15,5 +15,5 @@ echo "ok\n"; ?> --EXPECT-- -Recoverable fatal error: PHP Startup: Cannot set 'user' save handler by ini_set() or session_module_name() in Unknown on line 0 +Recoverable fatal error: PHP Startup: Session save handler "user" cannot be set by ini_set() or session_module_name() in Unknown on line 0 ok diff --git a/ext/session/tests/bug66481.phpt b/ext/session/tests/bug66481.phpt index 626b497759..ba0f2d28b1 100644 --- a/ext/session/tests/bug66481.phpt +++ b/ext/session/tests/bug66481.phpt @@ -13,6 +13,6 @@ var_dump(session_name("foo")); var_dump(session_name("bar")); ?> --EXPECT-- -Warning: PHP Startup: session.name cannot be a numeric or empty '' in Unknown on line 0 +Warning: PHP Startup: session.name "" cannot be numeric or empty in Unknown on line 0 string(9) "PHPSESSID" string(3) "foo" diff --git a/ext/session/tests/bug73100.phpt b/ext/session/tests/bug73100.phpt index 9334bbf16e..a59e9f41cc 100644 --- a/ext/session/tests/bug73100.phpt +++ b/ext/session/tests/bug73100.phpt @@ -20,7 +20,7 @@ session_module_name("user"); --EXPECTF-- bool(true) -Warning: session_module_name(): Cannot change save handler module when session is active in %s on line 4 +Warning: session_module_name(): Session save handler module cannot be changed when a session is active in %s on line %d bool(true) -Recoverable fatal error: session_module_name(): Cannot set 'user' save handler by ini_set() or session_module_name() in %s on line 7 +Recoverable fatal error: session_module_name(): Session save handler "user" cannot be set by ini_set() or session_module_name() in %s on line %d diff --git a/ext/session/tests/rfc1867_invalid_settings.phpt b/ext/session/tests/rfc1867_invalid_settings.phpt index fcdb40d3ba..bfec37c9cd 100644 --- a/ext/session/tests/rfc1867_invalid_settings.phpt +++ b/ext/session/tests/rfc1867_invalid_settings.phpt @@ -12,5 +12,5 @@ include('skipif.inc'); var_dump(ini_get("session.upload_progress.freq")); ?> --EXPECTF-- -Warning: PHP Startup: session.upload_progress.freq must be greater than or equal to zero in %s +Warning: PHP Startup: session.upload_progress.freq must be greater than or equal to 0 in Unknown on line 0 string(%d) "1%" diff --git a/ext/session/tests/rfc1867_invalid_settings_2.phpt b/ext/session/tests/rfc1867_invalid_settings_2.phpt index cafe007076..bf8e6cc2dd 100644 --- a/ext/session/tests/rfc1867_invalid_settings_2.phpt +++ b/ext/session/tests/rfc1867_invalid_settings_2.phpt @@ -12,5 +12,5 @@ include('skipif.inc'); var_dump(ini_get("session.upload_progress.freq")); ?> --EXPECTF-- -Warning: PHP Startup: session.upload_progress.freq cannot be over 100% in %s +Warning: PHP Startup: session.upload_progress.freq must be less than or equal to 100% in Unknown on line 0 string(%d) "1%" diff --git a/ext/session/tests/rfc1867_sid_invalid.phpt b/ext/session/tests/rfc1867_sid_invalid.phpt index b75a9f6470..4d8372c538 100644 --- a/ext/session/tests/rfc1867_sid_invalid.phpt +++ b/ext/session/tests/rfc1867_sid_invalid.phpt @@ -45,14 +45,18 @@ var_dump($_FILES); var_dump($_SESSION["upload_progress_" . basename(__FILE__)]); session_destroy(); ?> +--CLEAN-- +<?php +@unlink(__DIR__ . DIRECTORY_SEPARATOR . "rfc1867_sid_invalid.post.txt"); +?> --EXPECTF-- -Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0 +Warning: Unknown: Session ID is too long or contains illegal characters. Only the A-Z, a-z, 0-9, "-", and "," characters are allowed in Unknown on line 0 Warning: Unknown: Failed to read session data: files (path: ) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0 -Warning: Unknown: The session id is too long or contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0 +Warning: Unknown: Session ID is too long or contains illegal characters. Only the A-Z, a-z, 0-9, "-", and "," characters are allowed in Unknown on line 0 Warning: Unknown: Failed to read session data: files (path: ) in Unknown on line 0 diff --git a/ext/session/tests/session_cache_limiter_variation1.phpt b/ext/session/tests/session_cache_limiter_variation1.phpt index 1ef15d7ff5..3241cb3cdb 100644 --- a/ext/session/tests/session_cache_limiter_variation1.phpt +++ b/ext/session/tests/session_cache_limiter_variation1.phpt @@ -28,7 +28,7 @@ string(7) "nocache" bool(true) string(7) "nocache" -Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line %d +Warning: session_cache_limiter(): Session cache limiter cannot be changed when a session is active in %s on line %d bool(false) string(7) "nocache" bool(true) diff --git a/ext/session/tests/session_cache_limiter_variation2.phpt b/ext/session/tests/session_cache_limiter_variation2.phpt index 695f63ebca..00724a3f9a 100644 --- a/ext/session/tests/session_cache_limiter_variation2.phpt +++ b/ext/session/tests/session_cache_limiter_variation2.phpt @@ -27,7 +27,7 @@ string(7) "nocache" bool(true) string(7) "nocache" -Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line %d +Warning: session_cache_limiter(): Session cache limiter cannot be changed when a session is active in %s on line %d bool(false) string(7) "nocache" bool(true) diff --git a/ext/session/tests/session_cache_limiter_variation3.phpt b/ext/session/tests/session_cache_limiter_variation3.phpt index f37af43936..8f4e9296d1 100644 --- a/ext/session/tests/session_cache_limiter_variation3.phpt +++ b/ext/session/tests/session_cache_limiter_variation3.phpt @@ -26,7 +26,7 @@ string(7) "nocache" bool(true) string(7) "nocache" -Warning: session_cache_limiter(): Cannot change cache limiter when session is active in %s on line %d +Warning: session_cache_limiter(): Session cache limiter cannot be changed when a session is active in %s on line %d bool(false) string(7) "nocache" bool(true) diff --git a/ext/session/tests/session_decode_variation3.phpt b/ext/session/tests/session_decode_variation3.phpt index 9494edd339..ef4eab2bd2 100644 --- a/ext/session/tests/session_decode_variation3.phpt +++ b/ext/session/tests/session_decode_variation3.phpt @@ -28,7 +28,7 @@ ob_end_flush(); --EXPECTF-- *** Testing session_decode() : variation *** -Warning: session_start(): Cannot find serialization handler 'blah' - session startup failed in %s on line %d +Warning: session_start(): Cannot find session serialization handler "blah" - session startup failed in %s on line %d bool(false) Warning: Undefined variable $_SESSION in %s on line %d @@ -42,7 +42,7 @@ array(3) { float(123.456) } -Warning: session_decode(): Session is not active. You cannot decode session data in %s on line %d +Warning: session_decode(): Session data cannot be decoded when there is no active session in %s on line %d bool(false) array(3) { ["foo"]=> diff --git a/ext/session/tests/session_encode_error2.phpt b/ext/session/tests/session_encode_error2.phpt index 9cca3ffea4..a2d3d0ca30 100644 --- a/ext/session/tests/session_encode_error2.phpt +++ b/ext/session/tests/session_encode_error2.phpt @@ -98,63 +98,63 @@ ob_end_flush(); -- Iteration 1 -- bool(true) -Notice: session_encode(): Skipping numeric key 0 in %s on line %d +Warning: session_encode(): Skipping numeric key 0 in %s on line %d bool(false) bool(true) -- Iteration 2 -- bool(true) -Notice: session_encode(): Skipping numeric key 1 in %s on line %d +Warning: session_encode(): Skipping numeric key 1 in %s on line %d bool(false) bool(true) -- Iteration 3 -- bool(true) -Notice: session_encode(): Skipping numeric key 12345 in %s on line %d +Warning: session_encode(): Skipping numeric key 12345 in %s on line %d bool(false) bool(true) -- Iteration 4 -- bool(true) -Notice: session_encode(): Skipping numeric key -2345 in %s on line %d +Warning: session_encode(): Skipping numeric key -2345 in %s on line %d bool(false) bool(true) -- Iteration 5 -- bool(true) -Notice: session_encode(): Skipping numeric key 10 in %s on line %d +Warning: session_encode(): Skipping numeric key 10 in %s on line %d bool(false) bool(true) -- Iteration 6 -- bool(true) -Notice: session_encode(): Skipping numeric key -10 in %s on line %d +Warning: session_encode(): Skipping numeric key -10 in %s on line %d bool(false) bool(true) -- Iteration 7 -- bool(true) -Notice: session_encode(): Skipping numeric key %s in %s on line %d +Warning: session_encode(): Skipping numeric key %s in %s on line %d bool(false) bool(true) -- Iteration 8 -- bool(true) -Notice: session_encode(): Skipping numeric key 0 in %s on line %d +Warning: session_encode(): Skipping numeric key 0 in %s on line %d bool(false) bool(true) -- Iteration 9 -- bool(true) -Notice: session_encode(): Skipping numeric key 0 in %s on line %d +Warning: session_encode(): Skipping numeric key 0 in %s on line %d bool(false) bool(true) @@ -171,28 +171,28 @@ bool(true) -- Iteration 12 -- bool(true) -Notice: session_encode(): Skipping numeric key 1 in %s on line %d +Warning: session_encode(): Skipping numeric key 1 in %s on line %d bool(false) bool(true) -- Iteration 13 -- bool(true) -Notice: session_encode(): Skipping numeric key 0 in %s on line %d +Warning: session_encode(): Skipping numeric key 0 in %s on line %d bool(false) bool(true) -- Iteration 14 -- bool(true) -Notice: session_encode(): Skipping numeric key 1 in %s on line %d +Warning: session_encode(): Skipping numeric key 1 in %s on line %d bool(false) bool(true) -- Iteration 15 -- bool(true) -Notice: session_encode(): Skipping numeric key 0 in %s on line %d +Warning: session_encode(): Skipping numeric key 0 in %s on line %d bool(false) bool(true) @@ -242,7 +242,7 @@ bool(true) Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d -Notice: session_encode(): Skipping numeric key %d in %s on line %d +Warning: session_encode(): Skipping numeric key %d in %s on line %d bool(false) bool(true) Done diff --git a/ext/session/tests/session_encode_variation6.phpt b/ext/session/tests/session_encode_variation6.phpt index b334842fea..5305d483b5 100644 --- a/ext/session/tests/session_encode_variation6.phpt +++ b/ext/session/tests/session_encode_variation6.phpt @@ -29,17 +29,17 @@ ob_end_flush(); *** Testing session_encode() : variation *** bool(true) -Notice: session_encode(): Skipping numeric key 0 in %s on line %d +Warning: session_encode(): Skipping numeric key 0 in %s on line %d bool(false) bool(true) bool(true) -Notice: session_encode(): Skipping numeric key 1234567890 in %s on line %d +Warning: session_encode(): Skipping numeric key 1234567890 in %s on line %d bool(false) bool(true) bool(true) -Notice: session_encode(): Skipping numeric key -1234567890 in %s on line %d +Warning: session_encode(): Skipping numeric key -1234567890 in %s on line %d bool(false) bool(true) Done diff --git a/ext/session/tests/session_encode_variation8.phpt b/ext/session/tests/session_encode_variation8.phpt index 2ffa79335b..8b867b6b63 100644 --- a/ext/session/tests/session_encode_variation8.phpt +++ b/ext/session/tests/session_encode_variation8.phpt @@ -23,7 +23,7 @@ ob_end_flush(); --EXPECTF-- *** Testing session_encode() : variation *** -Warning: session_start(): Cannot find serialization handler 'blah' - session startup failed in %s on line %d +Warning: session_start(): Cannot find session serialization handler "blah" - session startup failed in %s on line %d bool(false) Warning: session_encode(): Cannot encode non-existent session in %s on line %d diff --git a/ext/session/tests/session_gc_basic.phpt b/ext/session/tests/session_gc_basic.phpt index b98c7e43e1..103b784c8f 100644 --- a/ext/session/tests/session_gc_basic.phpt +++ b/ext/session/tests/session_gc_basic.phpt @@ -22,7 +22,7 @@ ob_end_flush(); --EXPECTF-- *** Testing session_gc() : basic functionality *** -Warning: session_gc(): Session is not active in %s on line %d +Warning: session_gc(): Session cannot be garbage collected when there is no active session in %s on line %d bool(false) bool(true) int(%d) diff --git a/ext/session/tests/session_id_error2.phpt b/ext/session/tests/session_id_error2.phpt index c017d73d6b..23a9a59a2b 100644 --- a/ext/session/tests/session_id_error2.phpt +++ b/ext/session/tests/session_id_error2.phpt @@ -29,7 +29,7 @@ string(4) "test" string(10) "1234567890" bool(true) -Warning: session_id(): Cannot change session id when session is active in %s on line %d +Warning: session_id(): Session ID cannot be changed when a session is active in %s on line %d bool(false) bool(true) string(0) "" diff --git a/ext/session/tests/session_ini_set.phpt b/ext/session/tests/session_ini_set.phpt index 58c3f837a7..0335d58239 100644 --- a/ext/session/tests/session_ini_set.phpt +++ b/ext/session/tests/session_ini_set.phpt @@ -116,67 +116,67 @@ string(1) "4" string(1) "1" string(15) "session started" -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 38 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 39 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 40 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 42 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 43 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 44 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 45 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 46 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 47 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 48 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 49 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 50 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 51 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 52 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 53 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 54 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 55 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 56 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 57 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 58 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) -Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in %s on line 59 +Warning: ini_set(): Session ini settings cannot be changed when a session is active in %s on line %d bool(false) Done diff --git a/ext/session/tests/session_module_name_variation1.phpt b/ext/session/tests/session_module_name_variation1.phpt index 05c972fb91..fff325ad96 100644 --- a/ext/session/tests/session_module_name_variation1.phpt +++ b/ext/session/tests/session_module_name_variation1.phpt @@ -20,7 +20,7 @@ ob_end_flush(); --EXPECTF-- *** Testing session_module_name() : variation *** -Warning: session_module_name(): Cannot find named PHP session module (blah) in %s on line %d +Warning: session_module_name(): Session handler module "blah" cannot be found in %s on line %d bool(false) bool(true) string(%d) "%s" diff --git a/ext/session/tests/session_module_name_variation3.phpt b/ext/session/tests/session_module_name_variation3.phpt index 481229eebc..2be7b636de 100644 --- a/ext/session/tests/session_module_name_variation3.phpt +++ b/ext/session/tests/session_module_name_variation3.phpt @@ -36,8 +36,6 @@ ob_end_flush(); string(5) "files" string(4) "user" -Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d - Fatal error: Uncaught Exception: Stop...! in %s:%d Stack trace: #0 [internal function]: open('', 'PHPSESSID') diff --git a/ext/session/tests/session_name_variation1.phpt b/ext/session/tests/session_name_variation1.phpt index 35db378ea5..71849de565 100644 --- a/ext/session/tests/session_name_variation1.phpt +++ b/ext/session/tests/session_name_variation1.phpt @@ -47,7 +47,7 @@ string(1) " " bool(true) string(1) " " -Warning: session_name(): session.name cannot be a numeric or empty '' in %s on line %d +Warning: session_name(): session.name "" cannot be numeric or empty in %s on line %d string(1) " " bool(true) string(1) " " diff --git a/ext/session/tests/session_regenerate_id_basic.phpt b/ext/session/tests/session_regenerate_id_basic.phpt index 8d221ef006..9be5a65b1b 100644 --- a/ext/session/tests/session_regenerate_id_basic.phpt +++ b/ext/session/tests/session_regenerate_id_basic.phpt @@ -26,7 +26,7 @@ ob_end_flush(); *** Testing session_regenerate_id() : basic functionality *** string(0) "" -Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in %s on line %d +Warning: session_regenerate_id(): Session ID cannot be regenerated when there is no active session in %s on line %d bool(false) string(0) "" bool(true) @@ -34,7 +34,7 @@ bool(true) string(%d) "%s" bool(true) -Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in %s on line %d +Warning: session_regenerate_id(): Session ID cannot be regenerated when there is no active session in %s on line %d bool(false) string(0) "" Done diff --git a/ext/session/tests/session_regenerate_id_variation1.phpt b/ext/session/tests/session_regenerate_id_variation1.phpt index 1967cff018..806f20696e 100644 --- a/ext/session/tests/session_regenerate_id_variation1.phpt +++ b/ext/session/tests/session_regenerate_id_variation1.phpt @@ -26,7 +26,7 @@ ob_end_flush(); *** Testing session_regenerate_id() : variation *** string(0) "" -Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in %s on line %d +Warning: session_regenerate_id(): Session ID cannot be regenerated when there is no active session in %s on line %d bool(false) string(0) "" bool(true) @@ -34,7 +34,7 @@ bool(true) string(%d) "%s" bool(true) -Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in %s on line %d +Warning: session_regenerate_id(): Session ID cannot be regenerated when there is no active session in %s on line %d bool(false) string(0) "" Done diff --git a/ext/session/tests/session_save_path_variation1.phpt b/ext/session/tests/session_save_path_variation1.phpt index 8475b2d2e4..8dbddca98d 100644 --- a/ext/session/tests/session_save_path_variation1.phpt +++ b/ext/session/tests/session_save_path_variation1.phpt @@ -38,7 +38,7 @@ string(%d) "%stests" bool(true) string(%d) "%stests" -Warning: session_save_path(): Cannot change save path when session is active in %s on line %d +Warning: session_save_path(): Session save path cannot be changed when a session is active in %s on line %d bool(false) string(%d) "%stests" bool(true) diff --git a/ext/session/tests/session_set_cookie_params_basic.phpt b/ext/session/tests/session_set_cookie_params_basic.phpt index 79bf7a9ea9..21f04ef17f 100644 --- a/ext/session/tests/session_set_cookie_params_basic.phpt +++ b/ext/session/tests/session_set_cookie_params_basic.phpt @@ -23,7 +23,7 @@ ob_end_flush(); bool(true) bool(true) -Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d +Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d bool(false) bool(true) bool(true) diff --git a/ext/session/tests/session_set_cookie_params_variation1.phpt b/ext/session/tests/session_set_cookie_params_variation1.phpt index bad85d3aaf..7b2c474d1a 100644 --- a/ext/session/tests/session_set_cookie_params_variation1.phpt +++ b/ext/session/tests/session_set_cookie_params_variation1.phpt @@ -36,7 +36,7 @@ string(4) "3600" bool(true) string(4) "3600" -Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d +Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d bool(false) string(4) "3600" bool(true) diff --git a/ext/session/tests/session_set_cookie_params_variation2.phpt b/ext/session/tests/session_set_cookie_params_variation2.phpt index ac80c10c10..ca3f0aa887 100644 --- a/ext/session/tests/session_set_cookie_params_variation2.phpt +++ b/ext/session/tests/session_set_cookie_params_variation2.phpt @@ -34,7 +34,7 @@ string(4) "/foo" bool(true) string(4) "/foo" -Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d +Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d bool(false) string(4) "/foo" bool(true) diff --git a/ext/session/tests/session_set_cookie_params_variation3.phpt b/ext/session/tests/session_set_cookie_params_variation3.phpt index 1ba46eae7d..166730f89a 100644 --- a/ext/session/tests/session_set_cookie_params_variation3.phpt +++ b/ext/session/tests/session_set_cookie_params_variation3.phpt @@ -34,7 +34,7 @@ string(4) "blah" bool(true) string(4) "blah" -Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d +Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d bool(false) string(4) "blah" bool(true) diff --git a/ext/session/tests/session_set_cookie_params_variation4.phpt b/ext/session/tests/session_set_cookie_params_variation4.phpt index 16606f9f61..380defcd2c 100644 --- a/ext/session/tests/session_set_cookie_params_variation4.phpt +++ b/ext/session/tests/session_set_cookie_params_variation4.phpt @@ -34,7 +34,7 @@ string(1) "0" bool(true) string(1) "0" -Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d +Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d bool(false) string(1) "0" bool(true) diff --git a/ext/session/tests/session_set_cookie_params_variation5.phpt b/ext/session/tests/session_set_cookie_params_variation5.phpt index a73c834ed7..390937258b 100644 --- a/ext/session/tests/session_set_cookie_params_variation5.phpt +++ b/ext/session/tests/session_set_cookie_params_variation5.phpt @@ -34,7 +34,7 @@ string(1) "0" bool(true) string(1) "0" -Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d +Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d bool(false) string(1) "0" bool(true) diff --git a/ext/session/tests/session_set_cookie_params_variation6.phpt b/ext/session/tests/session_set_cookie_params_variation6.phpt index 983e8e68ad..9d9f116d42 100644 --- a/ext/session/tests/session_set_cookie_params_variation6.phpt +++ b/ext/session/tests/session_set_cookie_params_variation6.phpt @@ -34,7 +34,7 @@ string(7) "nothing" bool(true) string(7) "nothing" -Warning: session_set_cookie_params(): Cannot change session cookie parameters when session is active in %s on line %d +Warning: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in %s on line %d bool(false) string(7) "nothing" bool(true) diff --git a/ext/session/tests/session_set_cookie_params_variation7.phpt b/ext/session/tests/session_set_cookie_params_variation7.phpt index bd5aec592b..25feabf1fd 100644 --- a/ext/session/tests/session_set_cookie_params_variation7.phpt +++ b/ext/session/tests/session_set_cookie_params_variation7.phpt @@ -17,8 +17,17 @@ ob_start(); echo "*** Testing session_set_cookie_params() : array parameter variation ***\n"; // Invalid cases -var_dump(session_set_cookie_params([])); -var_dump(session_set_cookie_params(["unknown_key" => true, "secure_invalid" => true])); +try { + session_set_cookie_params([]); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + session_set_cookie_params(["unknown_key" => true, "secure_invalid" => true]); +} catch (ValueError $exception) { + echo $exception->getMessage() . "\n"; +} var_dump(ini_get("session.cookie_secure")); var_dump(ini_get("session.cookie_samesite")); @@ -39,16 +48,12 @@ ob_end_flush(); ?> --EXPECTF-- *** Testing session_set_cookie_params() : array parameter variation *** +session_set_cookie_params(): Argument #1 ($lifetime_or_options) must contain at least 1 valid key -Warning: session_set_cookie_params(): No valid keys were found in the options array in %s -bool(false) - -Warning: session_set_cookie_params(): Unrecognized key 'unknown_key' found in the options array in %s +Warning: session_set_cookie_params(): Argument #1 ($lifetime_or_options) contains an unrecognized key "unknown_key" in %s on line %d -Warning: session_set_cookie_params(): Unrecognized key 'secure_invalid' found in the options array in %s - -Warning: session_set_cookie_params(): No valid keys were found in the options array in %s -bool(false) +Warning: session_set_cookie_params(): Argument #1 ($lifetime_or_options) contains an unrecognized key "secure_invalid" in %s on line %d +session_set_cookie_params(): Argument #1 ($lifetime_or_options) must contain at least 1 valid key string(1) "0" string(0) "" bool(true) @@ -59,7 +64,7 @@ bool(true) string(2) "42" string(1) "/" -Warning: session_set_cookie_params(): Cannot pass arguments after the options array in %s +Warning: session_set_cookie_params(): Cannot pass arguments after the options array in %s on line %d bool(false) string(1) "/" Done diff --git a/ext/session/tests/session_set_save_handler_basic.phpt b/ext/session/tests/session_set_save_handler_basic.phpt index 2a451c0644..459f03c825 100644 --- a/ext/session/tests/session_set_save_handler_basic.phpt +++ b/ext/session/tests/session_set_save_handler_basic.phpt @@ -60,13 +60,13 @@ ob_end_flush(); *** Testing session_set_save_handler() : basic functionality *** string(%d) "%s" -Warning: session_module_name(): Cannot find named PHP session module () in %s on line %d +Warning: session_module_name(): Session handler module "" cannot be found in %s on line %d bool(false) -Warning: session_module_name(): Cannot find named PHP session module (blah) in %s on line %d +Warning: session_module_name(): Session handler module "blah" cannot be found in %s on line %d bool(false) -Warning: session_module_name(): Cannot find named PHP session module (foo) in %s on line %d +Warning: session_module_name(): Session handler module "foo" cannot be found in %s on line %d bool(false) Open [%s,PHPSESSID] Read [%s,%s] diff --git a/ext/session/tests/session_set_save_handler_class_012.phpt b/ext/session/tests/session_set_save_handler_class_012.phpt index 601ca32b7f..0849013a8f 100644 --- a/ext/session/tests/session_set_save_handler_class_012.phpt +++ b/ext/session/tests/session_set_save_handler_class_012.phpt @@ -43,8 +43,6 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i --EXPECTF-- *** Testing session_set_save_handler() : incorrect arguments for existing handler open *** Open - -Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d SessionHandler::open() expects exactly 2 arguments, 0 given Warning: Undefined variable $_SESSION in %s on line %d diff --git a/ext/session/tests/session_set_save_handler_class_014.phpt b/ext/session/tests/session_set_save_handler_class_014.phpt index 6bb1fca533..6eee4f8b6a 100644 --- a/ext/session/tests/session_set_save_handler_class_014.phpt +++ b/ext/session/tests/session_set_save_handler_class_014.phpt @@ -21,5 +21,5 @@ session_set_save_handler($handler); session_start(); ?> --EXPECT-- -Recoverable fatal error: PHP Startup: Cannot set 'user' save handler by ini_set() or session_module_name() in Unknown on line 0 +Recoverable fatal error: PHP Startup: Session save handler "user" cannot be set by ini_set() or session_module_name() in Unknown on line 0 *** Testing session_set_save_handler() : calling default handler when save_handler=user *** diff --git a/ext/session/tests/session_set_save_handler_closures.phpt b/ext/session/tests/session_set_save_handler_closures.phpt index df5cfa6e76..535850ac37 100644 --- a/ext/session/tests/session_set_save_handler_closures.phpt +++ b/ext/session/tests/session_set_save_handler_closures.phpt @@ -47,13 +47,13 @@ ob_end_flush(); *** Testing session_set_save_handler() : using closures as callbacks *** string(%d) "%s" -Warning: session_module_name(): Cannot find named PHP session module () in %s on line %d +Warning: session_module_name(): Session handler module "" cannot be found in %s on line %d bool(false) -Warning: session_module_name(): Cannot find named PHP session module (blah) in %s on line %d +Warning: session_module_name(): Session handler module "blah" cannot be found in %s on line %d bool(false) -Warning: session_module_name(): Cannot find named PHP session module (foo) in %s on line %d +Warning: session_module_name(): Session handler module "foo" cannot be found in %s on line %d bool(false) Open [%s,PHPSESSID] Read [%s,%s] diff --git a/ext/session/tests/session_set_save_handler_error.phpt b/ext/session/tests/session_set_save_handler_error.phpt index e47523c872..34ee886012 100644 --- a/ext/session/tests/session_set_save_handler_error.phpt +++ b/ext/session/tests/session_set_save_handler_error.phpt @@ -78,9 +78,13 @@ $inputs = array( $iterator = 1; foreach($inputs as $input) { echo "\n-- Iteration $iterator --\n"; - var_dump(session_set_save_handler($input, NULL, NULL, NULL, NULL, NULL)); + try { + session_set_save_handler($input, NULL, NULL, NULL, NULL, NULL); + } catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; + } $iterator++; -}; +} fclose($fp); echo "Done"; @@ -90,122 +94,74 @@ ob_end_flush(); *** Testing session_set_save_handler() : error functionality *** -- Iteration 1 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "0" not found or invalid function name -- Iteration 2 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "1" not found or invalid function name -- Iteration 3 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "12345" not found or invalid function name -- Iteration 4 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "-2345" not found or invalid function name -- Iteration 5 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "10.5" not found or invalid function name -- Iteration 6 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "-10.5" not found or invalid function name -- Iteration 7 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "123456789000" not found or invalid function name -- Iteration 8 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "1.23456789E-9" not found or invalid function name -- Iteration 9 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "0.5" not found or invalid function name -- Iteration 10 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "" not found or invalid function name -- Iteration 11 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "" not found or invalid function name -- Iteration 12 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "1" not found or invalid function name -- Iteration 13 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "" not found or invalid function name -- Iteration 14 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "1" not found or invalid function name -- Iteration 15 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "" not found or invalid function name -- Iteration 16 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "" not found or invalid function name -- Iteration 17 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "" not found or invalid function name -- Iteration 18 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "Nothing" not found or invalid function name -- Iteration 19 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "Nothing" not found or invalid function name -- Iteration 20 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "Hello World!" not found or invalid function name -- Iteration 21 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "classA::__invoke" not found or invalid function name -- Iteration 22 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "" not found or invalid function name -- Iteration 23 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "" not found or invalid function name -- Iteration 24 -- - -Warning: session_set_save_handler(): Argument 1 is not a valid callback in %s on line %d -bool(false) +session_set_save_handler(): Argument #1 ($open) must be a valid callback, function "Resource id #%d" not found or invalid function name Done diff --git a/ext/session/tests/session_set_save_handler_error3.phpt b/ext/session/tests/session_set_save_handler_error3.phpt index a57734e411..bcf08fdc23 100644 --- a/ext/session/tests/session_set_save_handler_error3.phpt +++ b/ext/session/tests/session_set_save_handler_error3.phpt @@ -29,8 +29,6 @@ ob_end_flush(); --EXPECTF-- *** Testing session_set_save_handler() : error functionality *** -Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d - Fatal error: Uncaught Exception: Do something bad..! in %s:%d Stack trace: #0 [internal function]: open('', 'PHPSESSID') diff --git a/ext/session/tests/session_set_save_handler_error4.phpt b/ext/session/tests/session_set_save_handler_error4.phpt index 2b39cb5500..289a0712be 100644 --- a/ext/session/tests/session_set_save_handler_error4.phpt +++ b/ext/session/tests/session_set_save_handler_error4.phpt @@ -11,28 +11,54 @@ echo "*** Testing session_set_save_handler() : error functionality ***\n"; function callback() { return true; } +try { + session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback"); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + session_set_save_handler("callback", "echo", "callback", "callback", "callback", "callback"); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + session_set_save_handler("callback", "callback", "echo", "callback", "callback", "callback"); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + session_set_save_handler("callback", "callback", "callback", "echo", "callback", "callback"); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + session_set_save_handler("callback", "callback", "callback", "callback", "echo", "callback"); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + session_set_save_handler("callback", "callback", "callback", "callback", "callback", "echo"); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback"); -session_set_save_handler("callback", "echo", "callback", "callback", "callback", "callback"); -session_set_save_handler("callback", "callback", "echo", "callback", "callback", "callback"); -session_set_save_handler("callback", "callback", "callback", "echo", "callback", "callback"); -session_set_save_handler("callback", "callback", "callback", "callback", "echo", "callback"); -session_set_save_handler("callback", "callback", "callback", "callback", "callback", "echo"); -session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback"); + var_dump(session_start()); ob_end_flush(); ?> --EXPECTF-- *** Testing session_set_save_handler() : error functionality *** - -Warning: session_set_save_handler(): Argument 2 is not a valid callback in %s on line %d - -Warning: session_set_save_handler(): Argument 3 is not a valid callback in %s on line %d - -Warning: session_set_save_handler(): Argument 4 is not a valid callback in %s on line %d - -Warning: session_set_save_handler(): Argument 5 is not a valid callback in %s on line %d - -Warning: session_set_save_handler(): Argument 6 is not a valid callback in %s on line %d +session_set_save_handler(): Argument #2 ($close) must be a valid callback, function "echo" not found or invalid function name +session_set_save_handler(): Argument #3 ($read) must be a valid callback, function "echo" not found or invalid function name +session_set_save_handler(): Argument #4 ($write) must be a valid callback, function "echo" not found or invalid function name +session_set_save_handler(): Argument #5 ($destroy) must be a valid callback, function "echo" not found or invalid function name +session_set_save_handler(): Argument #6 ($gc) must be a valid callback, function "echo" not found or invalid function name Warning: session_start(): Failed to read session data: user (%s) in %s on line %d bool(false) diff --git a/ext/session/tests/session_set_save_handler_iface_002.phpt b/ext/session/tests/session_set_save_handler_iface_002.phpt index eed5ee2f8d..10971a2b5f 100644 --- a/ext/session/tests/session_set_save_handler_iface_002.phpt +++ b/ext/session/tests/session_set_save_handler_iface_002.phpt @@ -83,3 +83,5 @@ session_start(); bool(true) session_set_save_handler(): Argument #1 ($open) must be of type SessionHandlerInterface, MySession2 given good handler writing + +Deprecated: Unknown: Session callback must have a return value of type bool, int returned in Unknown on line 0 diff --git a/ext/session/tests/session_set_save_handler_sid_002.phpt b/ext/session/tests/session_set_save_handler_sid_002.phpt index 5f288fd826..6321c5a568 100644 --- a/ext/session/tests/session_set_save_handler_sid_002.phpt +++ b/ext/session/tests/session_set_save_handler_sid_002.phpt @@ -79,9 +79,4 @@ Fatal error: Uncaught Error: Session id must be a string in %s:%d Stack trace: #0 %s(%d): session_start() #1 {main} - -Next Error: Failed to create session ID: user (path: %s) in %s:%d -Stack trace: -#0 %s(%d): session_start() -#1 {main} thrown in %s on line %d diff --git a/ext/session/tests/session_set_save_handler_type_error.phpt b/ext/session/tests/session_set_save_handler_type_error.phpt new file mode 100644 index 0000000000..67c4753d86 --- /dev/null +++ b/ext/session/tests/session_set_save_handler_type_error.phpt @@ -0,0 +1,58 @@ +--TEST-- +Test session_set_save_handler() function: interface wrong +--SKIPIF-- +<?php include('skipif.inc'); ?> +--INI-- +session.name=PHPSESSID +session.save_handler=files +--FILE-- +<?php + +$validCallback = function () { return true; }; +$deprecatedCallback = function () { return 0; }; +$exceptionCallback = function () { return []; }; + +ob_start(); + +try { + $ret = session_set_save_handler($exceptionCallback, $validCallback, $validCallback, $validCallback, $validCallback, $validCallback); + session_start(); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + $ret = session_set_save_handler($deprecatedCallback, $validCallback, $validCallback, $validCallback, $validCallback, $validCallback); + session_start(); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + $ret = session_set_save_handler($validCallback, $exceptionCallback, $validCallback, $validCallback, $validCallback, $validCallback); + session_start(); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + +try { + $ret = session_set_save_handler($validCallback, $deprecatedCallback, $exceptionCallback, $validCallback, $validCallback, $validCallback); + session_start(); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + +ob_end_flush(); + +?> +--EXPECTF-- +Session callback must have a return value of type bool, array returned + +Deprecated: session_start(): Session callback must have a return value of type bool, int returned in %s on line %d + +Warning: session_start(): Failed to read session data: user (%s) in %s on line %d +Session callback must have a return value of type bool, array returned + +Deprecated: session_start(): Session callback must have a return value of type bool, int returned in %s on line %d + +Warning: session_start(): Failed to read session data: user (%s) in %s on line %d diff --git a/ext/session/tests/session_set_save_handler_variation1.phpt b/ext/session/tests/session_set_save_handler_variation1.phpt index e192ac8838..7e3a749aad 100644 --- a/ext/session/tests/session_set_save_handler_variation1.phpt +++ b/ext/session/tests/session_set_save_handler_variation1.phpt @@ -23,11 +23,11 @@ ob_end_flush(); *** Testing session_set_save_handler() : variation *** string(%d) "%s" -Warning: session_module_name(): Cannot find named PHP session module () in %s on line %d +Warning: session_module_name(): Session handler module "" cannot be found in %s on line %d bool(false) string(%d) "%s" -Warning: session_module_name(): Cannot find named PHP session module (blah) in %s on line %d +Warning: session_module_name(): Session handler module "blah" cannot be found in %s on line %d bool(false) string(%d) "%s" string(%d) "%s" diff --git a/ext/session/tests/session_set_save_handler_variation2.phpt b/ext/session/tests/session_set_save_handler_variation2.phpt index 394d85e7b1..224846466e 100644 --- a/ext/session/tests/session_set_save_handler_variation2.phpt +++ b/ext/session/tests/session_set_save_handler_variation2.phpt @@ -22,6 +22,6 @@ ob_end_flush(); *** Testing session_set_save_handler() : variation *** bool(true) -Warning: session_set_save_handler(): Cannot change save handler when session is active in %s on line %d +Warning: session_set_save_handler(): Session save handler cannot be changed when a session is active in %s on line %d bool(false) bool(true) diff --git a/ext/session/tests/session_set_save_handler_variation3.phpt b/ext/session/tests/session_set_save_handler_variation3.phpt index 50fa6f62e0..be825cbe72 100644 --- a/ext/session/tests/session_set_save_handler_variation3.phpt +++ b/ext/session/tests/session_set_save_handler_variation3.phpt @@ -24,8 +24,8 @@ ob_end_flush(); *** Testing session_set_save_handler() : variation *** int(2) -Warning: session_save_path(): Cannot change save path when session is active in %s on line %d +Warning: session_save_path(): Session save path cannot be changed when a session is active in %s on line %d -Warning: session_set_save_handler(): Cannot change save handler when session is active in %s on line %d +Warning: session_set_save_handler(): Session save handler cannot be changed when a session is active in %s on line %d bool(false) bool(true) diff --git a/ext/session/tests/session_start_error.phpt b/ext/session/tests/session_start_error.phpt new file mode 100644 index 0000000000..ccfdada6f6 --- /dev/null +++ b/ext/session/tests/session_start_error.phpt @@ -0,0 +1,25 @@ +--TEST-- +Test session_start() errors +--SKIPIF-- +<?php include('skipif.inc'); ?> +--FILE-- +<?php + +ob_start(); + +try { + session_start(['option' => new stdClass()]); +} catch (TypeError $exception) { + echo $exception->getMessage() . "\n"; +} + +var_dump(session_start(['option' => false])); + +ob_end_flush(); + +?> +--EXPECTF-- +session_start(): Option "option" must be of type string|int|bool, stdClass given + +Warning: session_start(): Setting option "option" failed in %s on line %d +bool(true) diff --git a/ext/session/tests/session_start_variation1.phpt b/ext/session/tests/session_start_variation1.phpt index b34abbacdd..aac1e51389 100644 --- a/ext/session/tests/session_start_variation1.phpt +++ b/ext/session/tests/session_start_variation1.phpt @@ -23,15 +23,15 @@ ob_end_flush(); *** Testing session_start() : variation *** bool(true) -Notice: session_start(): A session had already been started - ignoring in %s on line %d +Notice: session_start(): Ignoring session_start() because a session is already active in %s on line %d bool(true) -Notice: session_start(): A session had already been started - ignoring in %s on line %d +Notice: session_start(): Ignoring session_start() because a session is already active in %s on line %d bool(true) -Notice: session_start(): A session had already been started - ignoring in %s on line %d +Notice: session_start(): Ignoring session_start() because a session is already active in %s on line %d bool(true) -Notice: session_start(): A session had already been started - ignoring in %s on line %d +Notice: session_start(): Ignoring session_start() because a session is already active in %s on line %d bool(true) Done diff --git a/ext/session/tests/session_start_variation9.phpt b/ext/session/tests/session_start_variation9.phpt index 99740c0b92..7e5c465a35 100644 --- a/ext/session/tests/session_start_variation9.phpt +++ b/ext/session/tests/session_start_variation9.phpt @@ -24,7 +24,7 @@ ob_end_flush(); *** Testing session_start() : variation *** string(%d) "%s" -Notice: session_start(): A session had already been started - ignoring in %s on line %d +Notice: session_start(): Ignoring session_start() because a session is already active in %s on line %d bool(true) string(%d) "%s" bool(true) |
