Skip to content

Commit eda5cb1

Browse files
committed
[HttpFoundation] Add a test case to confirm a bug in session migration
1 parent 6f8a37c commit eda5cb1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ public function testRegenerateDestroy()
119119
$this->assertEquals(11, $storage->getBag('attributes')->get('legs'));
120120
}
121121

122+
public function testSessionGlobalIsUpToDateAfterIdRegeneration()
123+
{
124+
$storage = $this->getStorage();
125+
$storage->start();
126+
$storage->getBag('attributes')->set('lucky', 7);
127+
$storage->regenerate();
128+
$storage->getBag('attributes')->set('lucky', 42);
129+
130+
$this->assertEquals(42, $_SESSION['_sf2_attributes']['lucky']);
131+
}
132+
122133
public function testDefaultSessionCacheLimiter()
123134
{
124135
$this->iniSet('session.cache_limiter', 'nocache');

0 commit comments

Comments
 (0)