Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: update logincontroller tests
Signed-off-by: Eduardo Morales <[email protected]>
  • Loading branch information
emoral435 committed Mar 11, 2024
commit 3d9ed5e4694185840c8405aa7a900a584d42323f
2 changes: 1 addition & 1 deletion core/src/components/login/LoginForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<h2 class="login-form__headline" data-login-form-headline v-html="headline" />
<NcTextField id="user"
ref="user"
:label="t('core', 'Account name or email')"
:label="loginText"
name="user"
:value.sync="user"
:class="{shake: invalidPassword}"
Expand Down
17 changes: 12 additions & 5 deletions tests/Core/Controller/LoginControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use OC\Authentication\TwoFactorAuth\Manager;
use OC\Core\Controller\LoginController;
use OC\User\Session;
use OCP\App\IAppManager;
use OCP\AppFramework\Http\RedirectResponse;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Defaults;
Expand Down Expand Up @@ -89,6 +90,9 @@ class LoginControllerTest extends TestCase {
/** @var IL10N|MockObject */
private $l;

/** @var IAppManager|MockObject */
private $appManager;

protected function setUp(): void {
parent::setUp();
$this->request = $this->createMock(IRequest::class);
Expand All @@ -104,6 +108,8 @@ protected function setUp(): void {
$this->webAuthnManager = $this->createMock(\OC\Authentication\WebAuthn\Manager::class);
$this->notificationManager = $this->createMock(IManager::class);
$this->l = $this->createMock(IL10N::class);
$this->appManager = $this->createMock(IAppManager::class);

$this->l->expects($this->any())
->method('t')
->willReturnCallback(function ($text, $parameters = []) {
Expand Down Expand Up @@ -132,7 +138,8 @@ protected function setUp(): void {
$this->initialStateService,
$this->webAuthnManager,
$this->notificationManager,
$this->l
$this->l,
$this->appManager,
);
}

Expand Down Expand Up @@ -258,7 +265,7 @@ public function testShowLoginFormWithErrorsInSession() {
],
]
);
$this->initialStateService->expects($this->exactly(11))
$this->initialStateService->expects($this->exactly(12))
->method('provideInitialState')
->withConsecutive([
'core',
Expand Down Expand Up @@ -300,7 +307,7 @@ public function testShowLoginFormForFlowAuth() {
->expects($this->once())
->method('isLoggedIn')
->willReturn(false);
$this->initialStateService->expects($this->exactly(12))
$this->initialStateService->expects($this->exactly(13))
->method('provideInitialState')
->withConsecutive([], [], [], [
'core',
Expand Down Expand Up @@ -371,7 +378,7 @@ public function testShowLoginFormWithPasswordResetOption($canChangePassword,
->method('get')
->with('LdapUser')
->willReturn($user);
$this->initialStateService->expects($this->exactly(11))
$this->initialStateService->expects($this->exactly(12))
->method('provideInitialState')
->withConsecutive([], [], [
'core',
Expand Down Expand Up @@ -421,7 +428,7 @@ public function testShowLoginFormForUserNamed0() {
->method('get')
->with('0')
->willReturn($user);
$this->initialStateService->expects($this->exactly(11))
$this->initialStateService->expects($this->exactly(12))
->method('provideInitialState')
->withConsecutive([], [], [], [
'core',
Expand Down