You are here

public function NativeSessionStorageTest::testRestart in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php \Symfony\Component\HttpFoundation\Tests\Session\Storage\NativeSessionStorageTest::testRestart()

File

vendor/symfony/http-foundation/Tests/Session/Storage/NativeSessionStorageTest.php, line 247

Class

NativeSessionStorageTest
Test class for NativeSessionStorage.

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage

Code

public function testRestart() {
  $storage = $this
    ->getStorage();
  $storage
    ->start();
  $id = $storage
    ->getId();
  $storage
    ->getBag('attributes')
    ->set('lucky', 7);
  $storage
    ->save();
  $storage
    ->start();
  $this
    ->assertSame($id, $storage
    ->getId(), 'Same session ID after restarting');
  $this
    ->assertSame(7, $storage
    ->getBag('attributes')
    ->get('lucky'), 'Data still available');
}