X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fsecurity%2FLoginManagerTest.php;h=7b0262b32c128871841cf9d98aaf83e129ffacca;hb=905f8675a728841b03b300d2c7dc909a1c4f7f03;hp=f26cd1eb8635c0bd21f8f4ab68043b7569562ddf;hpb=8edd7f15886620b07064aa889aea05c5acbc0e58;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/security/LoginManagerTest.php b/tests/security/LoginManagerTest.php index f26cd1eb..7b0262b3 100644 --- a/tests/security/LoginManagerTest.php +++ b/tests/security/LoginManagerTest.php @@ -2,7 +2,8 @@ namespace Shaarli\Security; require_once 'tests/utils/FakeConfigManager.php'; -use \PHPUnit\Framework\TestCase; + +use PHPUnit\Framework\TestCase; /** * Test coverage for LoginManager @@ -259,6 +260,20 @@ class LoginManagerTest extends TestCase ); } + /** + * 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 */