Skip to content

Commit 02dc235

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: fix merge pass CSV escape characters explicitly move setting deprecation session options into a legacy group test
2 parents b65742d + bf8b09f commit 02dc235

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

Tests/Session/Storage/NativeSessionStorageTest.php

+23-3
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,39 @@ public function testCookieOptions()
203203
$this->assertEquals($options, $gco);
204204
}
205205

206-
public function testSessionOptions()
206+
public function testCacheExpireOption()
207207
{
208208
$options = [
209-
'trans_sid_tags' => 'a=href',
210209
'cache_expire' => '200',
211210
];
212211

213212
$this->getStorage($options);
214213

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

217+
/**
218+
* 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.
219+
*/
220+
public function testTransSidTagsOption()
221+
{
222+
$previousErrorHandler = set_error_handler(function ($errno, $errstr) use (&$previousErrorHandler) {
223+
if ('ini_set(): Usage of session.trans_sid_tags INI setting is deprecated' !== $errstr) {
224+
return $previousErrorHandler ? $previousErrorHandler(...\func_get_args()) : false;
225+
}
226+
});
227+
228+
try {
229+
$this->getStorage([
230+
'trans_sid_tags' => 'a=href',
231+
]);
232+
} finally {
233+
restore_error_handler();
234+
}
235+
236+
$this->assertSame('a=href', \ini_get('session.trans_sid_tags'));
237+
}
238+
219239
public function testSetSaveHandler()
220240
{
221241
$initialSaveHandler = ini_set('session.save_handler', 'files');

0 commit comments

Comments
 (0)