diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2019-08-19 00:27:03 +0300 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-10-22 22:15:14 +0300 |
commit | 3a995a16568b1f505d6e82af9692af02a39e7edf (patch) | |
tree | 09d32f17d1a262b21274d705a3ac7c7b6a4fe10d /tests | |
parent | 7b4d5aa8a9689b5ffe6b90dcbdadba42f724caba (diff) |
Add test case for existing user with token null
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Core/Controller/LostControllerTest.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index e289d6e7b64..02683a543cc 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -687,6 +687,22 @@ class LostControllerTest extends \Test\TestCase { $this->assertSame($expectedResponse, $response); } + public function testIsSetPasswordTokenNullFailing() { + $this->config->method('getUserValue') + ->with('ValidTokenUser', 'core', 'lostpassword', null) + ->willReturn(null); + $this->userManager->method('get') + ->with('ValidTokenUser') + ->willReturn($this->existingUser); + + $response = $this->lostController->setPassword('', 'ValidTokenUser', 'NewPassword', true); + $expectedResponse = [ + 'status' => 'error', + 'msg' => 'Couldn\'t reset password because the token is invalid' + ]; + $this->assertSame($expectedResponse, $response); + } + public function testSetPasswordForDisabledUser() { $user = $this->createMock(IUser::class); $user->expects($this->any()) |