[TASK] Mitigate argon2i hash issues
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Authentication / AuthenticationServiceTest.php
index 9ac0e40..c12fdbf 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Core\Tests\Unit\Authentication;
 
 use TYPO3\CMS\Core\Authentication\AbstractUserAuthentication;
 use TYPO3\CMS\Core\Authentication\AuthenticationService;
+use TYPO3\CMS\Core\Crypto\PasswordHashing\InvalidPasswordHashException;
 use TYPO3\CMS\Core\Log\Logger;
 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
 
@@ -116,7 +117,7 @@ class AuthenticationServiceTest extends UnitTestCase
     /**
      * @test
      */
-    public function authUserReturns100IfPasswordInDbIsNotASaltedPassword(): void
+    public function authUserThrowsExceptionIfPasswordInDbDoesNotResolveToAValidHash(): void
     {
         $subject = new AuthenticationService();
         $pObjProphecy = $this->prophesize(AbstractUserAuthentication::class);
@@ -138,7 +139,9 @@ class AuthenticationServiceTest extends UnitTestCase
             'password' => 'aPlainTextPassword',
             'lockToDomain' => ''
         ];
-        $this->assertSame(100, $subject->authUser($dbUser));
+        $this->expectException(InvalidPasswordHashException::class);
+        $this->expectExceptionCode(1533818591);
+        $subject->authUser($dbUser);
     }
 
     /**