Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ext/session/tests/bug73100.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var_dump(session_destroy());
try {
session_module_name("user");
} catch (\ValueError $e) {
echo $e->getMessage() . \PHP_EOL;
echo $e::class, ': ', $e->getMessage(), PHP_EOL;
}
?>
===DONE===
Expand All @@ -24,5 +24,5 @@ bool(true)

Warning: session_module_name(): Session save handler module cannot be changed when a session is active (started from %s on line %d) in %s on line %d
bool(true)
session_module_name(): Argument #1 ($module) must not be "user"
ValueError: session_module_name(): Argument #1 ($module) must not be "user"
===DONE===
4 changes: 2 additions & 2 deletions ext/session/tests/session_create_id_invalid_prefix.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ var_dump(session_create_id('%'));
try {
var_dump(session_create_id('ABTgdPs68S3M4HMaqKwj33TzqLMv5PHpWQxJbfpeogEhrJRY7o9f33pKLCmhf0tXCtoBkIu0yxXYCSHfJhPd2miPUW4MIpd91dnEiOwWDfaBnfdJZOwgvgmYLSfDGaebqmnCAoyuzlcq2j59nNRhccgJIkr9ytY3RwFTTXszpcjpx6mlJuG9GksKAhPsnnaEwSEb0eFyqvn80gYI2roKSjaFSmJxg0xgXuCF4csMo8DxiSvovho5QTKx5u7h8VyQL'));
} catch (Throwable $e) {
echo $e::class . ': ' . $e->getMessage() . "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

try {
var_dump(session_create_id("AB\0CD"));
} catch (Throwable $e) {
echo $e::class . ': ' . $e->getMessage() . "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

?>
Expand Down
2 changes: 1 addition & 1 deletion ext/session/tests/session_encode_error2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ foreach($inputs as $input) {
try {
$_SESSION[$input] = "Hello World!";
} catch (Error $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(session_encode());
var_dump(session_destroy());
Expand Down
2 changes: 1 addition & 1 deletion ext/session/tests/session_gc_probability_ini.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ try {
session_start($gc_setting);
session_write_close();
} catch (Throwable $e) {
echo $e::class, ': '. $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
}
ob_end_flush();
Expand Down
4 changes: 2 additions & 2 deletions ext/session/tests/session_name_variation_null_byte.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ try {
var_dump(session_name("AB\0CD"));
var_dump(session_start());
} catch (ValueError $e) {
echo $e->getMessage(). "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

echo "Done";
?>
--EXPECT--
session_name(): Argument #1 ($name) must not contain any null bytes
ValueError: session_name(): Argument #1 ($name) must not contain any null bytes
Done
12 changes: 6 additions & 6 deletions ext/session/tests/session_set_cookie_params_variation7.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ echo "*** Testing session_set_cookie_params() : array parameter variation ***\n"
try {
session_set_cookie_params([]);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
session_set_cookie_params(["unknown_key" => true, "secure_invalid" => true]);
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

var_dump(ini_get("session.cookie_secure"));
Expand All @@ -46,7 +46,7 @@ var_dump(ini_get("session.cookie_path"));
try {
session_set_cookie_params(["path" => "newpath/"], "arg after options array");
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

var_dump(ini_get("session.cookie_path"));
Expand All @@ -56,12 +56,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
ValueError: session_set_cookie_params(): Argument #1 ($lifetime_or_options) must contain at least 1 valid key

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(): 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
ValueError: session_set_cookie_params(): Argument #1 ($lifetime_or_options) must contain at least 1 valid key
string(1) "0"
string(0) ""
bool(true)
Expand All @@ -71,6 +71,6 @@ string(1) "0"
bool(true)
string(2) "42"
string(1) "/"
session_set_cookie_params(): Argument #2 ($path) must be null when argument #1 ($lifetime_or_options) is an array
ValueError: session_set_cookie_params(): Argument #2 ($path) must be null when argument #1 ($lifetime_or_options) is an array
string(1) "/"
Done
6 changes: 3 additions & 3 deletions ext/session/tests/session_start_error.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ ob_start();
try {
session_start(['option' => new stdClass()]);
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

$read_and_close = "false";

try {
session_start([$read_and_close]);
} catch (ValueError $exception) {
echo $exception::class, ': ', $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

var_dump(session_start(['option' => false]));
Expand All @@ -29,7 +29,7 @@ ob_end_flush();

?>
--EXPECTF--
session_start(): Option "option" must be of type string|int|bool, stdClass given
TypeError: session_start(): Option "option" must be of type string|int|bool, stdClass given
ValueError: session_start(): Argument #1 ($options) must be of type array with keys as string

Warning: session_start(): Setting option "option" failed in %s on line %d
Expand Down
4 changes: 2 additions & 2 deletions ext/session/tests/user_session_module/bug31454.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ try {
array(&$arf, 'gc')
);
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

echo "Done\n";
?>
--EXPECTF--
Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
session_set_save_handler(): Argument #1 ($open) must be a valid callback, first array member is not a valid class name or object
TypeError: session_set_save_handler(): Argument #1 ($open) must be a valid callback, first array member is not a valid class name or object
Done
4 changes: 2 additions & 2 deletions ext/session/tests/user_session_module/bug55688.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ $x = new SessionHandler;
try {
$x->gc(1);
} catch (Error $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}
?>
--EXPECT--
Session is not active
Error: Session is not active
4 changes: 2 additions & 2 deletions ext/session/tests/user_session_module/bug67972.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ session
try {
(new SessionHandler)->create_sid();
} catch (Error $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

?>
--EXPECT--
Session is not active
Error: Session is not active
12 changes: 6 additions & 6 deletions ext/session/tests/user_session_module/bug69111.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ session_set_save_handler($sh);
try {
$sh->open('path', 'name');
} catch (Error $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
$sh->write("foo", "bar");
} catch (Error $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
$sh->read("");
} catch (Error $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

?>
--EXPECT--
Session is not active
Session is not active
Session is not active
Error: Session is not active
Error: Session is not active
Error: Session is not active
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ session_set_save_handler($handler);
try {
var_dump(session_start());
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i, $_SESSION);
?>
--EXPECTF--
*** Testing session_set_save_handler() : incorrect arguments for existing handler open ***
Open:
SessionHandler::open() expects exactly 2 arguments, 0 given
ArgumentCountError: SessionHandler::open() expects exactly 2 arguments, 0 given

Warning: Undefined global variable $_SESSION in %s on line %d
string(0) ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,37 @@ function callback() { return true; }
try {
session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback");
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
session_set_save_handler("callback", "echo", "callback", "callback", "callback", "callback");
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
session_set_save_handler("callback", "callback", "echo", "callback", "callback", "callback");
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
session_set_save_handler("callback", "callback", "callback", "echo", "callback", "callback");
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
session_set_save_handler("callback", "callback", "callback", "callback", "echo", "callback");
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
session_set_save_handler("callback", "callback", "callback", "callback", "callback", "echo");
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback");
Expand All @@ -58,19 +58,19 @@ ob_end_flush();
Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated 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
TypeError: session_set_save_handler(): Argument #2 ($close) must be a valid callback, function "echo" not found or invalid function name

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
session_set_save_handler(): Argument #3 ($read) must be a valid callback, function "echo" not found or invalid function name
TypeError: session_set_save_handler(): Argument #3 ($read) must be a valid callback, function "echo" not found or invalid function name

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
session_set_save_handler(): Argument #4 ($write) must be a valid callback, function "echo" not found or invalid function name
TypeError: session_set_save_handler(): Argument #4 ($write) must be a valid callback, function "echo" not found or invalid function name

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
session_set_save_handler(): Argument #5 ($destroy) must be a valid callback, function "echo" not found or invalid function name
TypeError: session_set_save_handler(): Argument #5 ($destroy) must be a valid callback, function "echo" not found or invalid function name

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
session_set_save_handler(): Argument #6 ($gc) must be a valid callback, function "echo" not found or invalid function name
TypeError: session_set_save_handler(): Argument #6 ($gc) must be a valid callback, function "echo" not found or invalid function name

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ try {
session_set_save_handler(new \SessionHandler(), true);
session_start();
} catch (Throwable $e) {
echo $e::class . ': ' . $e->getMessage() . "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "ok";
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var_dump($ret);
try {
$ret = session_set_save_handler($handler);
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
echo $e::class, ': ', $e->getMessage(), "\n";
}

session_start();
Expand All @@ -83,7 +83,7 @@ session_start();

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
bool(true)
session_set_save_handler(): Argument #1 ($open) must be of type SessionHandlerInterface, MySession2 given
TypeError: session_set_save_handler(): Argument #1 ($open) must be of type SessionHandlerInterface, MySession2 given
good handler writing

Deprecated: PHP Request Shutdown: Session callback must have a return value of type bool, int returned in Unknown on line 0
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,36 @@ try {
$ret = session_set_save_handler($exceptionCallback, $validCallback, $validCallback, $validCallback, $validCallback, $validCallback);
session_start();
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
$ret = session_set_save_handler($deprecatedCallback, $validCallback, $validCallback, $validCallback, $validCallback, $validCallback);
session_start();
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
$ret = session_set_save_handler($validCallback, $exceptionCallback, $validCallback, $validCallback, $validCallback, $validCallback);
session_start();
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

try {
$ret = session_set_save_handler($validCallback, $deprecatedCallback, $exceptionCallback, $validCallback, $validCallback, $validCallback);
session_start();
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

ob_end_flush();

?>
--EXPECTF--
Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
Session callback must have a return value of type bool, array returned
TypeError: Session callback must have a return value of type bool, array returned

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d

Expand All @@ -53,7 +53,7 @@ Deprecated: session_start(): Session callback must have a return value of type b
Warning: session_start(): Failed to read session data: user (%s) in %s on line %d

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
Session callback must have a return value of type bool, array returned
TypeError: Session callback must have a return value of type bool, array returned

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ try {
$ret = session_set_save_handler($nullCallback, $validCallback, $validCallback, $validCallback, $validCallback, $validCallback);
session_start();
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
$ret = session_set_save_handler($oneCallback, $validCallback, $validCallback, $validCallback, $validCallback, $validCallback);
session_start();
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
echo $exception::class, ': ', $exception->getMessage(), "\n";
}

ob_end_flush();

?>
--EXPECTF--
Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
Session callback must have a return value of type bool, null returned
TypeError: Session callback must have a return value of type bool, null returned

Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d
Session callback must have a return value of type bool, int returned
TypeError: Session callback must have a return value of type bool, int returned
Loading
Loading