-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
- Loading branch information
1 parent
a5b7249
commit 70425ba
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PhpMyAdmin\Tests; | ||
|
||
use PhpMyAdmin\Session; | ||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\PreserveGlobalState; | ||
use PHPUnit\Framework\Attributes\RunInSeparateProcess; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
#[CoversClass(Session::class)] | ||
final class SessionTest extends TestCase | ||
{ | ||
#[RunInSeparateProcess] | ||
#[PreserveGlobalState(false)] | ||
public function testSecure(): void | ||
{ | ||
$_SESSION[' PMA_token '] = null; | ||
$_SESSION[' HMAC_secret '] = null; | ||
|
||
Session::secure(); | ||
|
||
/** @psalm-suppress TypeDoesNotContainType */ | ||
self::assertIsString($_SESSION[' PMA_token ']); | ||
self::assertNotEmpty($_SESSION[' PMA_token ']); | ||
/** @psalm-suppress TypeDoesNotContainType */ | ||
self::assertIsString($_SESSION[' HMAC_secret ']); | ||
self::assertNotEmpty($_SESSION[' HMAC_secret ']); | ||
} | ||
} |