Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
  • Loading branch information
solracsf authored Mar 28, 2023
1 parent cfd7a57 commit 346054f
Showing 1 changed file with 4 additions and 25 deletions.
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

0 comments on commit 346054f

Please sign in to comment.