8000 [HttpFoundation] move setting deprecation session options into a legacy group test by xabbuh · Pull Request #58262 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpFoundation] move setting deprecation session options into a legacy group test #58262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 15, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,39 @@ public function testCookieOptions()
$this->assertEquals($options, $gco);
}

public function testSessionOptions()
public function testCacheExpireOption()
{
8000 $options = [
'trans_sid_tags' => 'a=href',
'cache_expire' => '200',
];

$this->getStorage($options);

$this->assertSame('a=href', \ini_get('session.trans_sid_tags'));
$this->assertSame('200', \ini_get('session.cache_expire'));
}

/**
* The test must only be removed when the "session.trans_sid_tags" option is removed from PHP or when the "trans_sid_tags" option is no longer supported by the native session storage.
*/
public function testTransSidTagsOption()
{
$previousErrorHandler = set_error_handler(function ($errno, $errstr) use (&$previousErrorHandler) {
if ('ini_set(): Usage of session.trans_sid_tags INI setting is deprecated' !== $errstr) {
return $previousErrorHandler ? $previousErrorHandler(...\func_get_args()) : false;
}
});

try {
$this->getStorage([
'trans_sid_tags' => 'a=href',
]);
} finally {
restore_error_handler();
}

$this->assertSame('a=href', \ini_get('session.trans_sid_tags'));
}

public function testSetSaveHandler()
{
$initialSaveHandler = ini_set('session.save_handler', 'files');
Expand Down
Loading
0