diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php index 2fb722ba62..8d395760e8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php @@ -42,7 +42,7 @@ class SessionController extends ContainerAware public function logoutAction() { - $request = $this->container->get('request')->getSession('session')->clear(); + $request = $this->container->get('request')->getSession('session')->invalidate(); return new Response('Session cleared.'); } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php index adb84f2d83..23b86b3b7f 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php @@ -93,6 +93,11 @@ class MockFileSessionStorage extends MockArraySessionStorage public function save() { $this->handler->write($this->id, serialize($this->data)); + + // this is needed for Silex, where the session object is re-used across requests + // in functional tests. In Symfony, the container is rebooted, so we don't have + // this issue + $this->started = false; } /** diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php index 2ff05f367d..7bfe6a779d 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MockFileSessionStorageTest.php @@ -111,8 +111,8 @@ class MockFileSessionStorageTest extends \PHPUnit_Framework_TestCase private function getStorage() { $storage = new MockFileSessionStorage($this->sessionDir); - $storage->registerBag(new FlashBag); - $storage->registerBag(new AttributeBag); + $storage->registerBag(new FlashBag()); + $storage->registerBag(new AttributeBag()); return $storage; }