You are here

public function MockFileSessionStorageTest::testMultipleInstances in Zircon Profile 8

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

File

vendor/symfony/http-foundation/Tests/Session/Storage/MockFileSessionStorageTest.php, line 96

Class

MockFileSessionStorageTest
Test class for MockFileSessionStorage.

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage

Code

public function testMultipleInstances() {
  $storage1 = $this
    ->getStorage();
  $storage1
    ->start();
  $storage1
    ->getBag('attributes')
    ->set('foo', 'bar');
  $storage1
    ->save();
  $storage2 = $this
    ->getStorage();
  $storage2
    ->setId($storage1
    ->getId());
  $storage2
    ->start();
  $this
    ->assertEquals('bar', $storage2
    ->getBag('attributes')
    ->get('foo'), 'values persist between instances');
}