<?php
-require_once 'tests/utils/FakeConfigManager.php';
-// Initialize reference data _before_ PHPUnit starts a session
-require_once 'tests/utils/ReferenceSessionIdHashes.php';
-ReferenceSessionIdHashes::genAllHashes();
+namespace Shaarli\Security;
use PHPUnit\Framework\TestCase;
-use Shaarli\Security\SessionManager;
/**
* Test coverage for SessionManager
*/
public static function setUpBeforeClass()
{
- self::$sidHashes = ReferenceSessionIdHashes::getHashes();
+ self::$sidHashes = \ReferenceSessionIdHashes::getHashes();
}
/**
*/
public function setUp()
{
- $this->conf = new FakeConfigManager([
+ $this->conf = new \FakeConfigManager([
'credentials.login' => 'johndoe',
'credentials.salt' => 'salt',
'security.session_protection_disabled' => false,
]);
$this->session = [];
- $this->sessionManager = new SessionManager($this->session, $this->conf);
+ $this->sessionManager = new SessionManager($this->session, $this->conf, 'session_path');
}
/**
$token => 1,
],
];
- $sessionManager = new SessionManager($session, $this->conf);
+ $sessionManager = new SessionManager($session, $this->conf, 'session_path');
// check and destroy the token
$this->assertTrue($sessionManager->checkToken($token));