Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2019-07-31 12:02:20 +0300
committerGitHub <noreply@github.com>2019-07-31 12:02:20 +0300
commit436f7b92d59c9fc7a6a95077b254025fb99dba71 (patch)
tree645a0098cc51ac257d235b7b4b0dc91ae123de2f /tests
parent1d8b09aa8653d1278fa32355d144b135808d92a3 (diff)
parent3b0d13944a966930731d3cb9a0216236420796c5 (diff)
Merge pull request #16544 from nextcloud/bugfix/16540
Add missing password reset page to vue
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 41f3bb03f02..b7ab99e991f 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);
}