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());
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function regenerate($destroy = false, $lifetime = null)
 {
     if (!$this->started) {
         $this->start();
     }
     if ($destroy) {
         $this->destroy();
     }
     return parent::regenerate($destroy, $lifetime);
 }