diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-12-06 08:23:53 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-12-06 08:23:53 -0500 |
commit | d0e809a32cd58c0d89b2425aeb245e04a94df7d6 (patch) | |
tree | 154070c7b7a99ca47ef21702d5c9498bfb920a16 /tests | |
parent | 9bd7985ba41b385c63213970b862ffc06f1096b0 (diff) |
Add new method to flush session variables
Diffstat (limited to 'tests')
-rw-r--r-- | tests/units/Core/Session/SessionStorageTest.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/units/Core/Session/SessionStorageTest.php b/tests/units/Core/Session/SessionStorageTest.php index 62495e5e..dd0040d5 100644 --- a/tests/units/Core/Session/SessionStorageTest.php +++ b/tests/units/Core/Session/SessionStorageTest.php @@ -35,4 +35,26 @@ class SessionStorageTest extends Base $storage = null; $this->assertEquals(array('something' => array('a' => 'c'), 'd' => 'e'), $session); } + + public function testFlush() + { + $session = array('d' => 'e'); + + $storage = new SessionStorage(); + $storage->setStorage($session); + $storage->something = array('a' => 'b'); + + $this->assertEquals(array('a' => 'b'), $storage->something); + $this->assertEquals('e', $storage->d); + + $storage->flush(); + + $this->assertFalse(isset($storage->d)); + $this->assertFalse(isset($storage->something)); + + $storage->foo = 'bar'; + + $storage = null; + $this->assertEquals(array('foo' => 'bar'), $session); + } } |