You are here

public function MockArraySessionStorageTest::testRegenerate in Zircon Profile 8

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

File

vendor/symfony/http-foundation/Tests/Session/Storage/MockArraySessionStorageTest.php, line 76

Class

MockArraySessionStorageTest
Test class for MockArraySessionStorage.

Namespace

Symfony\Component\HttpFoundation\Tests\Session\Storage

Code

public function testRegenerate() {
  $this->storage
    ->start();
  $id = $this->storage
    ->getId();
  $this->storage
    ->regenerate();
  $this
    ->assertNotEquals($id, $this->storage
    ->getId());
  $this
    ->assertEquals(array(
    'foo' => 'bar',
  ), $this->storage
    ->getBag('attributes')
    ->all());
  $this
    ->assertEquals(array(
    'notice' => 'hello',
  ), $this->storage
    ->getBag('flashes')
    ->peekAll());
  $id = $this->storage
    ->getId();
  $this->storage
    ->regenerate(true);
  $this
    ->assertNotEquals($id, $this->storage
    ->getId());
  $this
    ->assertEquals(array(
    'foo' => 'bar',
  ), $this->storage
    ->getBag('attributes')
    ->all());
  $this
    ->assertEquals(array(
    'notice' => 'hello',
  ), $this->storage
    ->getBag('flashes')
    ->peekAll());
}