namespace Shaarli\Security;
require_once 'tests/utils/FakeConfigManager.php';
-use \PHPUnit\Framework\TestCase;
+
+use PHPUnit\Framework\TestCase;
/**
* Test coverage for LoginManager
);
}
+ /**
+ * Generate a token depending on the user credentials with session protected disabled
+ */
+ public function testGenerateStaySignedInTokenSessionProtectionDisabled()
+ {
+ $this->configManager->set('security.session_protection_disabled', true);
+ $this->loginManager->generateStaySignedInToken($this->clientIpAddress);
+
+ $this->assertEquals(
+ sha1($this->passwordHash . $this->salt),
+ $this->loginManager->getStaySignedInToken()
+ );
+ }
+
/**
* Check user login - Shaarli has not yet been configured
*/