Procházet zdrojové kódy

Add test case for existing user with token null

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
tags/v17.0.0beta2
Daniel Kesselberg před 4 roky
rodič
revize
9c4c5ee818
Žádný účet není propojen s e-mailovou adresou tvůrce revize
1 změnil soubory, kde provedl 16 přidání a 0 odebrání
  1. 16
    0
      tests/Core/Controller/LostControllerTest.php

+ 16
- 0
tests/Core/Controller/LostControllerTest.php Zobrazit soubor

@@ -699,6 +699,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())

Načítá se…
Zrušit
Uložit