diff options
-rw-r--r-- | tests/SessionManagerTest.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/SessionManagerTest.php b/tests/SessionManagerTest.php index 9fa60dc5..a92c3ccc 100644 --- a/tests/SessionManagerTest.php +++ b/tests/SessionManagerTest.php | |||
@@ -51,6 +51,29 @@ class SessionManagerTest extends TestCase | |||
51 | } | 51 | } |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Check a session token | ||
55 | */ | ||
56 | public function testCheckToken() | ||
57 | { | ||
58 | $token = '4dccc3a45ad9d03e5542b90c37d8db6d10f2b38b'; | ||
59 | $session = [ | ||
60 | 'tokens' => [ | ||
61 | $token => 1, | ||
62 | ], | ||
63 | ]; | ||
64 | $conf = new FakeConfigManager(); | ||
65 | $sessionManager = new SessionManager($session, $conf); | ||
66 | |||
67 | |||
68 | // check and destroy the token | ||
69 | $this->assertTrue($sessionManager->checkToken($token)); | ||
70 | $this->assertFalse(isset($session['tokens'][$token])); | ||
71 | |||
72 | // ensure the token has been destroyed | ||
73 | $this->assertFalse($sessionManager->checkToken($token)); | ||
74 | } | ||
75 | |||
76 | /** | ||
54 | * Generate and check a session token | 77 | * Generate and check a session token |
55 | */ | 78 | */ |
56 | public function testGenerateAndCheckToken() | 79 | public function testGenerateAndCheckToken() |