Skip to content

Commit eb5409d

Browse files
committed
unique sessions for test cases
1 parent 7049556 commit eb5409d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/unit/CSRFTokenTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ class CSRFTokenTest extends TestCase
66
{
77
protected function setUp(): void
88
{
9-
if (session_status() === PHP_SESSION_NONE) {
10-
session_start();
11-
}
12-
CSRFToken::clear();
9+
session_id(uniqid());
10+
session_start();
11+
$_SESSION["csrf_tokens"] = [];
1312
}
1413

1514
protected function tearDown(): void
1615
{
1716
CSRFToken::clear();
17+
session_write_close();
18+
session_id(uniqid());
1819
}
1920

2021
public function testGenerateCreatesToken(): void

0 commit comments

Comments
 (0)