From eda5cb1c271ff7be919d8311a9032a6558436676 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Wed, 8 Jul 2015 18:59:03 +0100 Subject: [PATCH] [HttpFoundation] Add a test case to confirm a bug in session migration --- .../Session/Storage/NativeSessionStorageTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php index 851e6752b0..c8743aba94 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php @@ -119,6 +119,17 @@ class NativeSessionStorageTest extends \PHPUnit_Framework_TestCase $this->assertEquals(11, $storage->getBag('attributes')->get('legs')); } + public function testSessionGlobalIsUpToDateAfterIdRegeneration() + { + $storage = $this->getStorage(); + $storage->start(); + $storage->getBag('attributes')->set('lucky', 7); + $storage->regenerate(); + $storage->getBag('attributes')->set('lucky', 42); + + $this->assertEquals(42, $_SESSION['_sf2_attributes']['lucky']); + } + public function testDefaultSessionCacheLimiter() { $this->iniSet('session.cache_limiter', 'nocache');