14 use PHPUnit\Framework\TestCase;
43 protected function setUp()
49 $this->attributes->getStorageKey() => array(
'foo' =>
'bar'),
50 $this->flashes->getStorageKey() => array(
'notice' =>
'hello'),
54 $this->storage->registerBag($this->flashes);
55 $this->storage->registerBag($this->attributes);
56 $this->storage->setSessionData($this->data);
62 $this->flashes =
null;
63 $this->attributes =
null;
64 $this->storage =
null;
69 $this->assertEquals(
'', $this->storage->getId());
70 $this->storage->start();
71 $id = $this->storage->getId();
72 $this->assertNotEquals(
'', $id);
73 $this->storage->start();
74 $this->assertEquals($id, $this->storage->getId());
79 $this->storage->start();
80 $id = $this->storage->getId();
81 $this->storage->regenerate();
82 $this->assertNotEquals($id, $this->storage->getId());
83 $this->assertEquals(array(
'foo' =>
'bar'), $this->storage->getBag(
'attributes')->all());
84 $this->assertEquals(array(
'notice' =>
'hello'), $this->storage->getBag(
'flashes')->peekAll());
86 $id = $this->storage->getId();
87 $this->storage->regenerate(
true);
88 $this->assertNotEquals($id, $this->storage->getId());
89 $this->assertEquals(array(
'foo' =>
'bar'), $this->storage->getBag(
'attributes')->all());
90 $this->assertEquals(array(
'notice' =>
'hello'), $this->storage->getBag(
'flashes')->peekAll());
95 $this->assertEquals(
'', $this->storage->getId());
96 $this->storage->start();
97 $this->assertNotEquals(
'', $this->storage->getId());
102 $this->storage->clear();
104 $this->assertSame(array(), $this->storage->getBag(
'attributes')->all());
105 $this->assertSame(array(), $this->storage->getBag(
'flashes')->peekAll());
110 $this->storage->clear();
112 $this->assertTrue($this->storage->isStarted());
121 $this->assertTrue($storage->isStarted());
129 $this->storage->save();