mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Fix brittle test
This test fails occasionally due to timing issues, because the session file may have been unlinked by the first `session_start()`'s GC. We adapt the test expectation to this reality.
This commit is contained in:
parent
2c0a6977dd
commit
6b99a8be4d
1 changed files with 4 additions and 9 deletions
|
@ -29,10 +29,12 @@ $_SESSION["Blah"] = "Hello World!";
|
|||
$_SESSION["Foo"] = FALSE;
|
||||
$_SESSION["Guff"] = 1234567890;
|
||||
var_dump($_SESSION);
|
||||
$oldsession = $_SESSION;
|
||||
|
||||
var_dump(session_write_close());
|
||||
session_start();
|
||||
var_dump($_SESSION);
|
||||
// the session may have been GC'd or not; we accept either outcome
|
||||
var_dump($_SESSION === $oldsession || $_SESSION === []);
|
||||
var_dump(session_destroy());
|
||||
session_start();
|
||||
var_dump($_SESSION);
|
||||
|
@ -51,14 +53,7 @@ array(3) {
|
|||
int(1234567890)
|
||||
}
|
||||
bool(true)
|
||||
array(3) {
|
||||
["Blah"]=>
|
||||
string(12) "Hello World!"
|
||||
["Foo"]=>
|
||||
bool(false)
|
||||
["Guff"]=>
|
||||
int(1234567890)
|
||||
}
|
||||
bool(true)
|
||||
bool(true)
|
||||
array(0) {
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue