summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2021-09-10 19:06:50 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2021-09-14 07:52:45 +0000
commit3f1e4a0b15d6fb70e1a63778a9efd2ea26e426af (patch)
treeb3578dea5111e9934950835e2ec4367e80b2b731 /tests
parent3f71dd2b8dd55158dac7798a1219ded69941663c (diff)
downloadnextcloud-server-3f1e4a0b15d6fb70e1a63778a9efd2ea26e426af.tar.gz
nextcloud-server-3f1e4a0b15d6fb70e1a63778a9efd2ea26e426af.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')
-rw-r--r--tests/Core/Controller/LostControllerTest.php7
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)