mirror of
https://github.com/Combodo/iTop.git
synced 2026-08-22 22:28:19 +02:00
N°9625 - Add Session::UnsetAll() method to ensure that even the "welcome" session value is correctly resetted (#970)
* N°9625 - Add Session::UnsetAll() method to ensure that even the "welcome" session value is correctly resetted * N°9625 - Add unit tests * N°9625 - Improve robustness * N°9625 - Code review updates * N°9625 - Fix logoff page to ensure all authentication plugins are called before emptying the session
This commit is contained in:
@@ -123,6 +123,23 @@ class SessionTest extends ItopTestCase
|
||||
$this->assertFalse(Session::IsSet(['test1', 'test2', 'test3']));
|
||||
}
|
||||
|
||||
public function testUnsetAll()
|
||||
{
|
||||
Session::Start();
|
||||
Session::Set('test', 'OK');
|
||||
Session::Set(['test1', 'test2', 'test3'], 'OK');
|
||||
Session::Set('another_test', ['foo' => 'bar']);
|
||||
$this->assertTrue(Session::IsSet('test'));
|
||||
$this->assertTrue(Session::IsSet(['test1', 'test2', 'test3']));
|
||||
$this->assertTrue(Session::IsSet('another_test'));
|
||||
|
||||
Session::UnsetAll();
|
||||
$this->assertEmpty($_SESSION);
|
||||
$this->assertFalse(Session::IsSet('test'));
|
||||
$this->assertFalse(Session::IsSet(['test1', 'test2', 'test3']));
|
||||
$this->assertFalse(Session::IsSet('another_test'));
|
||||
}
|
||||
|
||||
public function testRegenerateId()
|
||||
{
|
||||
Session::Start();
|
||||
|
||||
Reference in New Issue
Block a user