aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-07-25 17:04:33 +0200
committerJulius Härtl <jus@bitgrid.net>2019-07-31 09:19:07 +0200
commit3b0d13944a966930731d3cb9a0216236420796c5 (patch)
tree05b6e7a694b77568984fd7087a58935a68517942 /tests
parent57f2ea22c784d7b2c3bbabc6b616b9afc6c5ff3c (diff)
downloadnextcloud-server-3b0d13944a966930731d3cb9a0216236420796c5.tar.gz
nextcloud-server-3b0d13944a966930731d3cb9a0216236420796c5.zip
Move actual password reset to vue
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/Core/Controller/LostControllerTest.php20
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php
index 8500819a9ca..fbb916689f6 100644
--- a/tests/Core/Controller/LostControllerTest.php
+++ b/tests/Core/Controller/LostControllerTest.php
@@ -31,6 +31,7 @@ use OCP\Defaults;
use OCP\Encryption\IEncryptionModule;
use OCP\Encryption\IManager;
use OCP\IConfig;
+use OCP\IInitialStateService;
use OCP\IL10N;
use OCP\ILogger;
use OCP\IRequest;
@@ -80,6 +81,8 @@ class LostControllerTest extends \Test\TestCase {
private $logger;
/** @var Manager|\PHPUnit_Framework_MockObject_MockObject */
private $twofactorManager;
+ /** @var IInitialStateService|\PHPUnit_Framework_MockObject_MockObject */
+ private $initialStateService;
protected function setUp() {
parent::setUp();
@@ -132,6 +135,7 @@ class LostControllerTest extends \Test\TestCase {
$this->crypto = $this->createMock(ICrypto::class);
$this->logger = $this->createMock(ILogger::class);
$this->twofactorManager = $this->createMock(Manager::class);
+ $this->initialStateService = $this->createMock(IInitialStateService::class);
$this->lostController = new LostController(
'Core',
$this->request,
@@ -147,7 +151,8 @@ class LostControllerTest extends \Test\TestCase {
$this->timeFactory,
$this->crypto,
$this->logger,
- $this->twofactorManager
+ $this->twofactorManager,
+ $this->initialStateService
);
}
@@ -254,12 +259,17 @@ class LostControllerTest extends \Test\TestCase {
->with('core.lost.setPassword', array('userId' => 'ValidTokenUser', 'token' => 'TheOnlyAndOnlyOneTokenToResetThePassword'))
->will($this->returnValue('https://example.tld/index.php/lostpassword/'));
+ $this->initialStateService->expects($this->at(0))
+ ->method('provideInitialState')
+ ->with('core', 'resetPasswordUser', 'ValidTokenUser');
+ $this->initialStateService->expects($this->at(1))
+ ->method('provideInitialState')
+ ->with('core', 'resetPasswordTarget', 'https://example.tld/index.php/lostpassword/');
+
$response = $this->lostController->resetform('TheOnlyAndOnlyOneTokenToResetThePassword', 'ValidTokenUser');
$expectedResponse = new TemplateResponse('core',
- 'lostpassword/resetpassword',
- array(
- 'link' => 'https://example.tld/index.php/lostpassword/',
- ),
+ 'login',
+ [],
'guest');
$this->assertEquals($expectedResponse, $response);
}