diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-09-10 19:06:50 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2021-09-10 19:06:50 +0200 |
commit | 6857136f06190acad26a4dfc541c9c688aa75014 (patch) | |
tree | a6eef94a3dababa542bd055d16ea2e5d924f2fce /tests/Core | |
parent | 43fcd28ea05824b4a69d676ca8934812555f3705 (diff) | |
download | nextcloud-server-6857136f06190acad26a4dfc541c9c688aa75014.tar.gz nextcloud-server-6857136f06190acad26a4dfc541c9c688aa75014.zip |
fixes missing prefix to validate password reset token
- also fixes the test which missed asserting the presence of it
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'tests/Core')
-rw-r--r-- | tests/Core/Controller/LostControllerTest.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index a9dd4c1797b..e860c808014 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -153,7 +153,7 @@ class LostControllerTest extends \Test\TestCase { ->willReturn($this->existingUser); $this->verificationToken->expects($this->once()) ->method('check') - ->with('12345:MySecretToken', $this->existingUser, 'lostpassword') + ->with('12345:MySecretToken', $this->existingUser, 'lostpassword', 'test@example.com') ->willThrowException(new InvalidTokenException(InvalidTokenException::TOKEN_DECRYPTION_ERROR)); $response = $this->lostController->resetform('12345:MySecretToken', 'ValidTokenUser'); @@ -174,7 +174,7 @@ class LostControllerTest extends \Test\TestCase { ->willReturn($this->existingUser); $this->verificationToken->expects($this->once()) ->method('check') - ->with('MySecretToken', $this->existingUser, 'lostpassword'); + ->with('MySecretToken', $this->existingUser, 'lostpassword', 'test@example.com'); $response = $this->lostController->resetform('MySecretToken', 'ValidTokenUser'); $expectedResponse = new TemplateResponse('core', @@ -513,6 +513,9 @@ class LostControllerTest extends \Test\TestCase { ->willReturn(false); $user->expects($this->never()) ->method('setPassword'); + $user->expects($this->any()) + ->method('getEMailAddress') + ->willReturn('random@example.org'); $this->config->method('getUserValue') ->with('ValidTokenUser', 'core', 'lostpassword', null) |