Skip to content
Merged
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
Fix tests
Signed-off-by: Git'Fellow <[email protected]>
  • Loading branch information
solracsf authored Mar 28, 2023
commit 346054f85402bcf6a2ccd9d672abf6d9194ea793
29 changes: 4 additions & 25 deletions tests/Core/Controller/LoginControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ public function testLogoutWithoutToken() {
->with('nc_token')
->willReturn(null);
$this->request
->expects($this->once())
->method('isUserAgent')
->willReturn(false);
->method('getServerProtocol')
->willReturn('https');
$this->config
->expects($this->never())
->method('deleteUserValue');
Expand All @@ -160,26 +159,6 @@ public function testLogoutWithoutToken() {
$this->assertEquals($expected, $this->loginController->logout());
}

public function testLogoutNoClearSiteData() {
$this->request
->expects($this->once())
->method('getCookie')
->with('nc_token')
->willReturn(null);
$this->request
->expects($this->once())
->method('isUserAgent')
->willReturn(true);
$this->urlGenerator
->expects($this->once())
->method('linkToRouteAbsolute')
->with('core.login.showLoginForm')
->willReturn('/login');

$expected = new RedirectResponse('/login');
$this->assertEquals($expected, $this->loginController->logout());
}

public function testLogoutWithToken() {
$this->request
->expects($this->once())
Expand All @@ -188,8 +167,8 @@ public function testLogoutWithToken() {
->willReturn('MyLoginToken');
$this->request
->expects($this->once())
->method('isUserAgent')
->willReturn(false);
->method('getServerProtocol')
->willReturn('https');
$user = $this->createMock(IUser::class);
$user
->expects($this->once())
Expand Down