aboutsummaryrefslogtreecommitdiffstats
path: root/tests/Core/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Core/Controller')
-rw-r--r--tests/Core/Controller/AppPasswordControllerTest.php14
-rw-r--r--tests/Core/Controller/AutoCompleteControllerTest.php2
-rw-r--r--tests/Core/Controller/AvatarControllerTest.php46
-rw-r--r--tests/Core/Controller/ChangePasswordControllerTest.php10
-rw-r--r--tests/Core/Controller/ClientFlowLoginControllerTest.php20
-rw-r--r--tests/Core/Controller/ClientFlowLoginV2ControllerTest.php26
-rw-r--r--tests/Core/Controller/ContactsMenuControllerTest.php6
-rw-r--r--tests/Core/Controller/CssControllerTest.php10
-rw-r--r--tests/Core/Controller/GuestAvatarControllerTest.php2
-rw-r--r--tests/Core/Controller/JsControllerTest.php10
-rw-r--r--tests/Core/Controller/LoginControllerTest.php24
-rw-r--r--tests/Core/Controller/LostControllerTest.php36
-rw-r--r--tests/Core/Controller/NavigationControllerTest.php8
-rw-r--r--tests/Core/Controller/OCSControllerTest.php14
-rw-r--r--tests/Core/Controller/PreviewControllerTest.php18
-rw-r--r--tests/Core/Controller/TwoFactorChallengeControllerTest.php18
-rw-r--r--tests/Core/Controller/UserControllerTest.php2
-rw-r--r--tests/Core/Controller/WipeControllerTest.php4
18 files changed, 135 insertions, 135 deletions
diff --git a/tests/Core/Controller/AppPasswordControllerTest.php b/tests/Core/Controller/AppPasswordControllerTest.php
index 6b7b023ab2e..f0246561145 100644
--- a/tests/Core/Controller/AppPasswordControllerTest.php
+++ b/tests/Core/Controller/AppPasswordControllerTest.php
@@ -86,7 +86,7 @@ class AppPasswordControllerTest extends TestCase {
);
}
- public function testGetAppPasswordWithAppPassword() {
+ public function testGetAppPasswordWithAppPassword(): void {
$this->session->method('exists')
->with('app_password')
->willReturn(true);
@@ -96,7 +96,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->getAppPassword();
}
- public function testGetAppPasswordNoLoginCreds() {
+ public function testGetAppPasswordNoLoginCreds(): void {
$this->session->method('exists')
->with('app_password')
->willReturn(false);
@@ -108,7 +108,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->getAppPassword();
}
- public function testGetAppPassword() {
+ public function testGetAppPassword(): void {
$credentials = $this->createMock(ICredentials::class);
$this->session->method('exists')
@@ -149,7 +149,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->getAppPassword();
}
- public function testGetAppPasswordNoPassword() {
+ public function testGetAppPasswordNoPassword(): void {
$credentials = $this->createMock(ICredentials::class);
$this->session->method('exists')
@@ -190,7 +190,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->getAppPassword();
}
- public function testDeleteAppPasswordNoAppPassword() {
+ public function testDeleteAppPasswordNoAppPassword(): void {
$this->session->method('exists')
->with('app_password')
->willReturn(false);
@@ -200,7 +200,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->deleteAppPassword();
}
- public function testDeleteAppPasswordFails() {
+ public function testDeleteAppPasswordFails(): void {
$this->session->method('exists')
->with('app_password')
->willReturn(true);
@@ -217,7 +217,7 @@ class AppPasswordControllerTest extends TestCase {
$this->controller->deleteAppPassword();
}
- public function testDeleteAppPasswordSuccess() {
+ public function testDeleteAppPasswordSuccess(): void {
$this->session->method('exists')
->with('app_password')
->willReturn(true);
diff --git a/tests/Core/Controller/AutoCompleteControllerTest.php b/tests/Core/Controller/AutoCompleteControllerTest.php
index 2b82342276b..23bd03be7af 100644
--- a/tests/Core/Controller/AutoCompleteControllerTest.php
+++ b/tests/Core/Controller/AutoCompleteControllerTest.php
@@ -156,7 +156,7 @@ class AutoCompleteControllerTest extends TestCase {
/**
* @dataProvider searchDataProvider
*/
- public function testGet(array $searchResults, array $expected, string $searchTerm, ?string $itemType, ?string $itemId, ?string $sorter) {
+ public function testGet(array $searchResults, array $expected, string $searchTerm, ?string $itemType, ?string $itemId, ?string $sorter): void {
$this->collaboratorSearch->expects($this->once())
->method('search')
->willReturn([$searchResults, false]);
diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php
index 41c16bc4c3f..3a1123c940b 100644
--- a/tests/Core/Controller/AvatarControllerTest.php
+++ b/tests/Core/Controller/AvatarControllerTest.php
@@ -128,7 +128,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Fetch an avatar if a user has no avatar
*/
- public function testGetAvatarNoAvatar() {
+ public function testGetAvatarNoAvatar(): void {
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
$this->avatarMock->method('getFile')->will($this->throwException(new NotFoundException()));
$response = $this->avatarController->getAvatar('userId', 32);
@@ -140,7 +140,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Fetch the user's avatar
*/
- public function testGetAvatar() {
+ public function testGetAvatar(): void {
$this->avatarMock->method('getFile')->willReturn($this->avatarFile);
$this->avatarManager->method('getAvatar')->with('userId')->willReturn($this->avatarMock);
$this->avatarMock->expects($this->once())
@@ -161,7 +161,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Fetch the user's avatar
*/
- public function testGetGeneratedAvatar() {
+ public function testGetGeneratedAvatar(): void {
$this->avatarMock->method('getFile')->willReturn($this->avatarFile);
$this->avatarManager->method('getAvatar')->with('userId')->willReturn($this->avatarMock);
@@ -179,7 +179,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Fetch the avatar of a non-existing user
*/
- public function testGetAvatarNoUser() {
+ public function testGetAvatarNoUser(): void {
$this->avatarManager
->method('getAvatar')
->with('userDoesNotExist')
@@ -276,7 +276,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Remove an avatar
*/
- public function testDeleteAvatar() {
+ public function testDeleteAvatar(): void {
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
$response = $this->avatarController->deleteAvatar();
@@ -286,7 +286,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test what happens if the removing of the avatar fails
*/
- public function testDeleteAvatarException() {
+ public function testDeleteAvatarException(): void {
$this->avatarMock->method('remove')->will($this->throwException(new \Exception('foo')));
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
@@ -300,7 +300,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Trying to get a tmp avatar when it is not available. 404
*/
- public function testTmpAvatarNoTmp() {
+ public function testTmpAvatarNoTmp(): void {
$response = $this->avatarController->getTmpAvatar();
$this->assertEquals(Http::STATUS_NOT_FOUND, $response->getStatus());
}
@@ -308,7 +308,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Fetch tmp avatar
*/
- public function testTmpAvatarValid() {
+ public function testTmpAvatarValid(): void {
$this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$response = $this->avatarController->getTmpAvatar();
@@ -319,7 +319,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* When trying to post a new avatar a path or image should be posted.
*/
- public function testPostAvatarNoPathOrImage() {
+ public function testPostAvatarNoPathOrImage(): void {
$response = $this->avatarController->postAvatar(null);
$this->assertEquals(Http::STATUS_BAD_REQUEST, $response->getStatus());
@@ -328,7 +328,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test a correct post of an avatar using POST
*/
- public function testPostAvatarFile() {
+ public function testPostAvatarFile(): void {
//Create temp file
$fileName = tempnam('', 'avatarTest');
$copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.jpg', $fileName);
@@ -353,7 +353,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test invalid post os an avatar using POST
*/
- public function testPostAvatarInvalidFile() {
+ public function testPostAvatarInvalidFile(): void {
//Create request return
$reqRet = ['error' => [1], 'tmp_name' => ['foo']];
$this->request->method('getUploadedFile')->willReturn($reqRet);
@@ -366,7 +366,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Check what happens when we upload a GIF
*/
- public function testPostAvatarFileGif() {
+ public function testPostAvatarFileGif(): void {
//Create temp file
$fileName = tempnam('', 'avatarTest');
$copyRes = copy(\OC::$SERVERROOT.'/tests/data/testimage.gif', $fileName);
@@ -390,7 +390,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test posting avatar from existing file
*/
- public function testPostAvatarFromFile() {
+ public function testPostAvatarFromFile(): void {
//Mock node API call
$file = $this->getMockBuilder('OCP\Files\File')
->disableOriginalConstructor()->getMock();
@@ -414,7 +414,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test posting avatar from existing folder
*/
- public function testPostAvatarFromNoFile() {
+ public function testPostAvatarFromNoFile(): void {
$file = $this->getMockBuilder('OCP\Files\Node')->getMock();
$userFolder = $this->getMockBuilder('OCP\Files\Folder')->getMock();
$this->rootFolder->method('getUserFolder')->with('userid')->willReturn($userFolder);
@@ -430,7 +430,7 @@ class AvatarControllerTest extends \Test\TestCase {
$this->assertEquals(['data' => ['message' => 'Please select a file.']], $response->getData());
}
- public function testPostAvatarInvalidType() {
+ public function testPostAvatarInvalidType(): void {
$file = $this->getMockBuilder('OCP\Files\File')
->disableOriginalConstructor()->getMock();
$file->expects($this->never())
@@ -446,7 +446,7 @@ class AvatarControllerTest extends \Test\TestCase {
$this->assertEquals($expectedResponse, $this->avatarController->postAvatar('avatar.jpg'));
}
- public function testPostAvatarNotPermittedException() {
+ public function testPostAvatarNotPermittedException(): void {
$file = $this->getMockBuilder('OCP\Files\File')
->disableOriginalConstructor()->getMock();
$file->expects($this->once())
@@ -466,7 +466,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test what happens if the upload of the avatar fails
*/
- public function testPostAvatarException() {
+ public function testPostAvatarException(): void {
$this->cache->expects($this->once())
->method('set')
->will($this->throwException(new \Exception('foo')));
@@ -493,7 +493,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test invalid crop argument
*/
- public function testPostCroppedAvatarInvalidCrop() {
+ public function testPostCroppedAvatarInvalidCrop(): void {
$response = $this->avatarController->postCroppedAvatar([]);
$this->assertEquals(Http::STATUS_BAD_REQUEST, $response->getStatus());
@@ -502,7 +502,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test no tmp avatar to crop
*/
- public function testPostCroppedAvatarNoTmpAvatar() {
+ public function testPostCroppedAvatarNoTmpAvatar(): void {
$response = $this->avatarController->postCroppedAvatar(['x' => 0, 'y' => 0, 'w' => 10, 'h' => 10]);
$this->assertEquals(Http::STATUS_BAD_REQUEST, $response->getStatus());
@@ -511,7 +511,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test with non square crop
*/
- public function testPostCroppedAvatarNoSquareCrop() {
+ public function testPostCroppedAvatarNoSquareCrop(): void {
$this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->avatarMock->method('set')->will($this->throwException(new \OC\NotSquareException));
@@ -524,7 +524,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Check for proper reply on proper crop argument
*/
- public function testPostCroppedAvatarValidCrop() {
+ public function testPostCroppedAvatarValidCrop(): void {
$this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->avatarManager->method('getAvatar')->willReturn($this->avatarMock);
$response = $this->avatarController->postCroppedAvatar(['x' => 0, 'y' => 0, 'w' => 10, 'h' => 10]);
@@ -536,7 +536,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Test what happens if the cropping of the avatar fails
*/
- public function testPostCroppedAvatarException() {
+ public function testPostCroppedAvatarException(): void {
$this->cache->method('get')->willReturn(file_get_contents(\OC::$SERVERROOT.'/tests/data/testimage.jpg'));
$this->avatarMock->method('set')->will($this->throwException(new \Exception('foo')));
@@ -553,7 +553,7 @@ class AvatarControllerTest extends \Test\TestCase {
/**
* Check for proper reply on proper crop argument
*/
- public function testFileTooBig() {
+ public function testFileTooBig(): void {
$fileName = \OC::$SERVERROOT.'/tests/data/testimage.jpg';
//Create request return
$reqRet = ['error' => [0], 'tmp_name' => [$fileName], 'size' => [21 * 1024 * 1024]];
diff --git a/tests/Core/Controller/ChangePasswordControllerTest.php b/tests/Core/Controller/ChangePasswordControllerTest.php
index 93fb4196d35..a806b091477 100644
--- a/tests/Core/Controller/ChangePasswordControllerTest.php
+++ b/tests/Core/Controller/ChangePasswordControllerTest.php
@@ -60,7 +60,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
);
}
- public function testChangePersonalPasswordWrongPassword() {
+ public function testChangePersonalPasswordWrongPassword(): void {
$this->userSession->expects($this->once())
->method('getLoginName')
->willReturn($this->loginName);
@@ -82,7 +82,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
$this->assertEquals($expects, $actual);
}
- public function testChangePersonalPasswordCommonPassword() {
+ public function testChangePersonalPasswordCommonPassword(): void {
$this->userSession->expects($this->once())
->method('getLoginName')
->willReturn($this->loginName);
@@ -109,7 +109,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
$this->assertEquals($expects, $actual);
}
- public function testChangePersonalPasswordNoNewPassword() {
+ public function testChangePersonalPasswordNoNewPassword(): void {
$this->userSession->expects($this->once())
->method('getLoginName')
->willReturn($this->loginName);
@@ -132,7 +132,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
$this->assertEquals($expects, $res->getData());
}
- public function testChangePersonalPasswordCantSetPassword() {
+ public function testChangePersonalPasswordCantSetPassword(): void {
$this->userSession->expects($this->once())
->method('getLoginName')
->willReturn($this->loginName);
@@ -159,7 +159,7 @@ class ChangePasswordControllerTest extends \Test\TestCase {
$this->assertEquals($expects, $actual);
}
- public function testChangePersonalPassword() {
+ public function testChangePersonalPassword(): void {
$this->userSession->expects($this->once())
->method('getLoginName')
->willReturn($this->loginName);
diff --git a/tests/Core/Controller/ClientFlowLoginControllerTest.php b/tests/Core/Controller/ClientFlowLoginControllerTest.php
index 98f09f0f18c..a38f73c85a6 100644
--- a/tests/Core/Controller/ClientFlowLoginControllerTest.php
+++ b/tests/Core/Controller/ClientFlowLoginControllerTest.php
@@ -102,7 +102,7 @@ class ClientFlowLoginControllerTest extends TestCase {
);
}
- public function testShowAuthPickerPageNoClientOrOauthRequest() {
+ public function testShowAuthPickerPageNoClientOrOauthRequest(): void {
$expected = new StandaloneTemplateResponse(
'core',
'error',
@@ -121,7 +121,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->showAuthPickerPage());
}
- public function testShowAuthPickerPageWithOcsHeader() {
+ public function testShowAuthPickerPageWithOcsHeader(): void {
$this->request
->method('getHeader')
->withConsecutive(
@@ -183,7 +183,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->showAuthPickerPage());
}
- public function testShowAuthPickerPageWithOauth() {
+ public function testShowAuthPickerPageWithOauth(): void {
$this->request
->method('getHeader')
->withConsecutive(
@@ -253,7 +253,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->showAuthPickerPage('MyClientIdentifier'));
}
- public function testGenerateAppPasswordWithInvalidToken() {
+ public function testGenerateAppPasswordWithInvalidToken(): void {
$this->session
->expects($this->once())
->method('get')
@@ -276,7 +276,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken'));
}
- public function testGenerateAppPasswordWithSessionNotAvailableException() {
+ public function testGenerateAppPasswordWithSessionNotAvailableException(): void {
$this->session
->expects($this->once())
->method('get')
@@ -296,7 +296,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken'));
}
- public function testGenerateAppPasswordWithInvalidTokenException() {
+ public function testGenerateAppPasswordWithInvalidTokenException(): void {
$this->session
->expects($this->once())
->method('get')
@@ -321,7 +321,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken'));
}
- public function testGeneratePasswordWithPassword() {
+ public function testGeneratePasswordWithPassword(): void {
$this->session
->expects($this->once())
->method('get')
@@ -405,7 +405,7 @@ class ClientFlowLoginControllerTest extends TestCase {
* ["https://example.com/redirect.php?hello=world", "https://example.com/redirect.php?hello=world&state=MyOauthState&code=MyAccessCode"]
*
*/
- public function testGeneratePasswordWithPasswordForOauthClient($redirectUri, $redirectUrl) {
+ public function testGeneratePasswordWithPasswordForOauthClient($redirectUri, $redirectUrl): void {
$this->session
->method('get')
->withConsecutive(
@@ -490,7 +490,7 @@ class ClientFlowLoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->clientFlowLoginController->generateAppPassword('MyStateToken', 'MyClientIdentifier'));
}
- public function testGeneratePasswordWithoutPassword() {
+ public function testGeneratePasswordWithoutPassword(): void {
$this->session
->expects($this->once())
->method('get')
@@ -621,7 +621,7 @@ class ClientFlowLoginControllerTest extends TestCase {
* @param string $protocol
* @param string $expected
*/
- public function testGeneratePasswordWithHttpsProxy(array $headers, $protocol, $expected) {
+ public function testGeneratePasswordWithHttpsProxy(array $headers, $protocol, $expected): void {
$this->session
->expects($this->once())
->method('get')
diff --git a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php
index eefa2982c74..093b8a3442d 100644
--- a/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php
+++ b/tests/Core/Controller/ClientFlowLoginV2ControllerTest.php
@@ -70,7 +70,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
);
}
- public function testPollInvalid() {
+ public function testPollInvalid(): void {
$this->loginFlowV2Service->method('poll')
->with('token')
->willThrowException(new LoginFlowV2NotFoundException());
@@ -81,7 +81,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_NOT_FOUND, $result->getStatus());
}
- public function testPollValid() {
+ public function testPollValid(): void {
$creds = new LoginFlowV2Credentials('server', 'login', 'pass');
$this->loginFlowV2Service->method('poll')
->with('token')
@@ -93,7 +93,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_OK, $result->getStatus());
}
- public function testLandingInvalid() {
+ public function testLandingInvalid(): void {
$this->session->expects($this->never())
->method($this->anything());
@@ -107,7 +107,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertInstanceOf(Http\StandaloneTemplateResponse::class, $result);
}
- public function testLandingValid() {
+ public function testLandingValid(): void {
$this->session->expects($this->once())
->method('set')
->with('client.flow.v2.login.token', 'token');
@@ -127,7 +127,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame('https://server/path', $result->getRedirectURL());
}
- public function testShowAuthPickerNoLoginToken() {
+ public function testShowAuthPickerNoLoginToken(): void {
$this->session->method('get')
->willReturn(null);
@@ -136,7 +136,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testShowAuthPickerInvalidLoginToken() {
+ public function testShowAuthPickerInvalidLoginToken(): void {
$this->session->method('get')
->with('client.flow.v2.login.token')
->willReturn('loginToken');
@@ -150,7 +150,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testShowAuthPickerValidLoginToken() {
+ public function testShowAuthPickerValidLoginToken(): void {
$this->session->method('get')
->with('client.flow.v2.login.token')
->willReturn('loginToken');
@@ -176,7 +176,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testGrantPageInvalidStateToken() {
+ public function testGrantPageInvalidStateToken(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
return null;
@@ -186,7 +186,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testGrantPageInvalidLoginToken() {
+ public function testGrantPageInvalidLoginToken(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
if ($name === 'client.flow.v2.state.token') {
@@ -206,7 +206,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testGrantPageValid() {
+ public function testGrantPageValid(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
if ($name === 'client.flow.v2.state.token') {
@@ -236,7 +236,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
}
- public function testGenerateAppPasswordInvalidStateToken() {
+ public function testGenerateAppPasswordInvalidStateToken(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
return null;
@@ -246,7 +246,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testGenerateAppPassworInvalidLoginToken() {
+ public function testGenerateAppPassworInvalidLoginToken(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
if ($name === 'client.flow.v2.state.token') {
@@ -266,7 +266,7 @@ class ClientFlowLoginV2ControllerTest extends TestCase {
$this->assertSame(Http::STATUS_FORBIDDEN, $result->getStatus());
}
- public function testGenerateAppPassworValid() {
+ public function testGenerateAppPassworValid(): void {
$this->session->method('get')
->willReturnCallback(function ($name) {
if ($name === 'client.flow.v2.state.token') {
diff --git a/tests/Core/Controller/ContactsMenuControllerTest.php b/tests/Core/Controller/ContactsMenuControllerTest.php
index d688ea6682f..aa20e6726e2 100644
--- a/tests/Core/Controller/ContactsMenuControllerTest.php
+++ b/tests/Core/Controller/ContactsMenuControllerTest.php
@@ -35,7 +35,7 @@ class ContactsMenuControllerTest extends TestCase {
$this->controller = new ContactsMenuController($request, $this->userSession, $this->contactsManager);
}
- public function testIndex() {
+ public function testIndex(): void {
$user = $this->createMock(IUser::class);
$entries = [
$this->createMock(IEntry::class),
@@ -54,7 +54,7 @@ class ContactsMenuControllerTest extends TestCase {
$this->assertEquals($entries, $response);
}
- public function testFindOne() {
+ public function testFindOne(): void {
$user = $this->createMock(IUser::class);
$entry = $this->createMock(IEntry::class);
$this->userSession->expects($this->once())
@@ -70,7 +70,7 @@ class ContactsMenuControllerTest extends TestCase {
$this->assertEquals($entry, $response);
}
- public function testFindOne404() {
+ public function testFindOne404(): void {
$user = $this->createMock(IUser::class);
$this->userSession->expects($this->once())
->method('getUser')
diff --git a/tests/Core/Controller/CssControllerTest.php b/tests/Core/Controller/CssControllerTest.php
index 8064f36cddb..cae6f7989c4 100644
--- a/tests/Core/Controller/CssControllerTest.php
+++ b/tests/Core/Controller/CssControllerTest.php
@@ -56,7 +56,7 @@ class CssControllerTest extends TestCase {
);
}
- public function testNoCssFolderForApp() {
+ public function testNoCssFolderForApp(): void {
$this->appData->method('getFolder')
->with('myapp')
->willThrowException(new NotFoundException());
@@ -67,7 +67,7 @@ class CssControllerTest extends TestCase {
}
- public function testNoCssFile() {
+ public function testNoCssFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$this->appData->method('getFolder')
->with('myapp')
@@ -81,7 +81,7 @@ class CssControllerTest extends TestCase {
$this->assertInstanceOf(NotFoundResponse::class, $result);
}
- public function testGetFile() {
+ public function testGetFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$file->method('getName')->willReturn('my name');
@@ -105,7 +105,7 @@ class CssControllerTest extends TestCase {
$this->assertEquals($expected, $result);
}
- public function testGetGzipFile() {
+ public function testGetGzipFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$gzipFile = $this->createMock(ISimpleFile::class);
$gzipFile->method('getName')->willReturn('my name');
@@ -134,7 +134,7 @@ class CssControllerTest extends TestCase {
$this->assertEquals($expected, $result);
}
- public function testGetGzipFileNotFound() {
+ public function testGetGzipFileNotFound(): void {
$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$file->method('getName')->willReturn('my name');
diff --git a/tests/Core/Controller/GuestAvatarControllerTest.php b/tests/Core/Controller/GuestAvatarControllerTest.php
index b2f60665948..1ad9e49f858 100644
--- a/tests/Core/Controller/GuestAvatarControllerTest.php
+++ b/tests/Core/Controller/GuestAvatarControllerTest.php
@@ -71,7 +71,7 @@ class GuestAvatarControllerTest extends \Test\TestCase {
/**
* Tests getAvatar returns the guest avatar.
*/
- public function testGetAvatar() {
+ public function testGetAvatar(): void {
$this->avatarManager->expects($this->once())
->method('getGuestAvatar')
->with('Peter')
diff --git a/tests/Core/Controller/JsControllerTest.php b/tests/Core/Controller/JsControllerTest.php
index 5aa853e4ed0..1500ed6eacf 100644
--- a/tests/Core/Controller/JsControllerTest.php
+++ b/tests/Core/Controller/JsControllerTest.php
@@ -56,7 +56,7 @@ class JsControllerTest extends TestCase {
);
}
- public function testNoCssFolderForApp() {
+ public function testNoCssFolderForApp(): void {
$this->appData->method('getFolder')
->with('myapp')
->willThrowException(new NotFoundException());
@@ -67,7 +67,7 @@ class JsControllerTest extends TestCase {
}
- public function testNoCssFile() {
+ public function testNoCssFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$this->appData->method('getFolder')
->with('myapp')
@@ -81,7 +81,7 @@ class JsControllerTest extends TestCase {
$this->assertInstanceOf(NotFoundResponse::class, $result);
}
- public function testGetFile() {
+ public function testGetFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$file->method('getName')->willReturn('my name');
@@ -105,7 +105,7 @@ class JsControllerTest extends TestCase {
$this->assertEquals($expected, $result);
}
- public function testGetGzipFile() {
+ public function testGetGzipFile(): void {
$folder = $this->createMock(ISimpleFolder::class);
$gzipFile = $this->createMock(ISimpleFile::class);
$gzipFile->method('getName')->willReturn('my name');
@@ -134,7 +134,7 @@ class JsControllerTest extends TestCase {
$this->assertEquals($expected, $result);
}
- public function testGetGzipFileNotFound() {
+ public function testGetGzipFileNotFound(): void {
$folder = $this->createMock(ISimpleFolder::class);
$file = $this->createMock(ISimpleFile::class);
$file->method('getName')->willReturn('my name');
diff --git a/tests/Core/Controller/LoginControllerTest.php b/tests/Core/Controller/LoginControllerTest.php
index 50ecbe5e19c..a5ff6fd61a5 100644
--- a/tests/Core/Controller/LoginControllerTest.php
+++ b/tests/Core/Controller/LoginControllerTest.php
@@ -129,7 +129,7 @@ class LoginControllerTest extends TestCase {
);
}
- public function testLogoutWithoutToken() {
+ public function testLogoutWithoutToken(): void {
$this->request
->expects($this->once())
->method('getCookie')
@@ -156,7 +156,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->loginController->logout());
}
- public function testLogoutNoClearSiteData() {
+ public function testLogoutNoClearSiteData(): void {
$this->request
->expects($this->once())
->method('getCookie')
@@ -179,7 +179,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->loginController->logout());
}
- public function testLogoutWithToken() {
+ public function testLogoutWithToken(): void {
$this->request
->expects($this->once())
->method('getCookie')
@@ -216,7 +216,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $this->loginController->logout());
}
- public function testShowLoginFormForLoggedInUsers() {
+ public function testShowLoginFormForLoggedInUsers(): void {
$this->userSession
->expects($this->once())
->method('isLoggedIn')
@@ -230,7 +230,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', ''));
}
- public function testShowLoginFormWithErrorsInSession() {
+ public function testShowLoginFormWithErrorsInSession(): void {
$this->userSession
->expects($this->once())
->method('isLoggedIn')
@@ -285,7 +285,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $this->loginController->showLoginForm('', ''));
}
- public function testShowLoginFormForFlowAuth() {
+ public function testShowLoginFormForFlowAuth(): void {
$this->userSession
->expects($this->once())
->method('isLoggedIn')
@@ -332,7 +332,7 @@ class LoginControllerTest extends TestCase {
* @dataProvider passwordResetDataProvider
*/
public function testShowLoginFormWithPasswordResetOption($canChangePassword,
- $expectedResult) {
+ $expectedResult): void {
$this->userSession
->expects($this->once())
->method('isLoggedIn')
@@ -381,7 +381,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $this->loginController->showLoginForm('LdapUser', ''));
}
- public function testShowLoginFormForUserNamed0() {
+ public function testShowLoginFormForUserNamed0(): void {
$this->userSession
->expects($this->once())
->method('isLoggedIn')
@@ -468,7 +468,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $response);
}
- public function testLoginWithValidCredentials() {
+ public function testLoginWithValidCredentials(): void {
$user = 'MyUserName';
$password = 'secret';
$loginChain = $this->createMock(LoginChain::class);
@@ -523,7 +523,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $response);
}
- public function testLoginWithoutPassedCsrfCheckAndLoggedIn() {
+ public function testLoginWithoutPassedCsrfCheckAndLoggedIn(): void {
/** @var IUser|MockObject $user */
$user = $this->createMock(IUser::class);
$user->expects($this->any())
@@ -560,7 +560,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $response);
}
- public function testLoginWithValidCredentialsAndRedirectUrl() {
+ public function testLoginWithValidCredentialsAndRedirectUrl(): void {
$user = 'MyUserName';
$password = 'secret';
$redirectUrl = 'https://next.cloud/apps/mail';
@@ -594,7 +594,7 @@ class LoginControllerTest extends TestCase {
$this->assertEquals($expected, $response);
}
- public function testToNotLeakLoginName() {
+ public function testToNotLeakLoginName(): void {
$loginChain = $this->createMock(LoginChain::class);
$this->request
->expects($this->once())
diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php
index 7e9d085a291..2a99c9f9d16 100644
--- a/tests/Core/Controller/LostControllerTest.php
+++ b/tests/Core/Controller/LostControllerTest.php
@@ -138,7 +138,7 @@ class LostControllerTest extends TestCase {
);
}
- public function testResetFormTokenError() {
+ public function testResetFormTokenError(): void {
$this->userManager->method('get')
->with('ValidTokenUser')
->willReturn($this->existingUser);
@@ -160,7 +160,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testResetFormValidToken() {
+ public function testResetFormValidToken(): void {
$this->userManager->method('get')
->with('ValidTokenUser')
->willReturn($this->existingUser);
@@ -188,7 +188,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testEmailUnsuccessful() {
+ public function testEmailUnsuccessful(): void {
$existingUser = 'ExistingUser';
$nonExistingUser = 'NonExistingUser';
$this->userManager
@@ -230,7 +230,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testEmailSuccessful() {
+ public function testEmailSuccessful(): void {
$this->userManager
->expects($this->any())
->method('get')
@@ -287,7 +287,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testEmailWithMailSuccessful() {
+ public function testEmailWithMailSuccessful(): void {
$this->userManager
->expects($this->any())
->method('get')
@@ -349,7 +349,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testEmailCantSendException() {
+ public function testEmailCantSendException(): void {
$this->userManager
->expects($this->any())
->method('get')
@@ -409,7 +409,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testSetPasswordUnsuccessful() {
+ public function testSetPasswordUnsuccessful(): void {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('encryptedData');
@@ -435,7 +435,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSetPasswordSuccessful() {
+ public function testSetPasswordSuccessful(): void {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('encryptedData');
@@ -463,7 +463,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSetPasswordExpiredToken() {
+ public function testSetPasswordExpiredToken(): void {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('encryptedData');
@@ -482,7 +482,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSetPasswordInvalidDataInDb() {
+ public function testSetPasswordInvalidDataInDb(): void {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('invalidEncryptedData');
@@ -502,7 +502,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testIsSetPasswordWithoutTokenFailing() {
+ public function testIsSetPasswordWithoutTokenFailing(): void {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('aValidtoken');
@@ -521,7 +521,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSetPasswordForDisabledUser() {
+ public function testSetPasswordForDisabledUser(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->any())
->method('isEnabled')
@@ -551,7 +551,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSendEmailNoEmail() {
+ public function testSendEmailNoEmail(): void {
$user = $this->createMock(IUser::class);
$user->expects($this->any())
->method('isEnabled')
@@ -574,7 +574,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testSetPasswordEncryptionDontProceedPerUserKey() {
+ public function testSetPasswordEncryptionDontProceedPerUserKey(): void {
/** @var IEncryptionModule|MockObject $encryptionModule */
$encryptionModule = $this->createMock(IEncryptionModule::class);
$encryptionModule->expects($this->once())->method('needDetailedAccessList')->willReturn(true);
@@ -587,7 +587,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testSetPasswordDontProceedMasterKey() {
+ public function testSetPasswordDontProceedMasterKey(): void {
$encryptionModule = $this->createMock(IEncryptionModule::class);
$encryptionModule->expects($this->once())->method('needDetailedAccessList')->willReturn(false);
$this->encryptionManager->expects($this->once())->method('getEncryptionModules')
@@ -615,7 +615,7 @@ class LostControllerTest extends TestCase {
$this->assertSame($expectedResponse, $response->getData());
}
- public function testTwoUsersWithSameEmail() {
+ public function testTwoUsersWithSameEmail(): void {
$user1 = $this->createMock(IUser::class);
$user1->expects($this->any())
->method('getEMailAddress')
@@ -707,7 +707,7 @@ class LostControllerTest extends TestCase {
$this->assertInstanceOf(IUser::class, $result);
}
- public function testTrimEmailInput() {
+ public function testTrimEmailInput(): void {
$this->userManager
->expects($this->once())
->method('getByEmail')
@@ -724,7 +724,7 @@ class LostControllerTest extends TestCase {
$this->assertEquals($expectedResponse, $response);
}
- public function testUsernameInput() {
+ public function testUsernameInput(): void {
$this->userManager
->expects($this->once())
->method('get')
diff --git a/tests/Core/Controller/NavigationControllerTest.php b/tests/Core/Controller/NavigationControllerTest.php
index 0d7c91d3034..4995bd2fed0 100644
--- a/tests/Core/Controller/NavigationControllerTest.php
+++ b/tests/Core/Controller/NavigationControllerTest.php
@@ -48,7 +48,7 @@ class NavigationControllerTest extends TestCase {
];
}
/** @dataProvider dataGetNavigation */
- public function testGetAppNavigation($absolute) {
+ public function testGetAppNavigation($absolute): void {
$this->navigationManager->expects($this->once())
->method('getAll')
->with('link')
@@ -77,7 +77,7 @@ class NavigationControllerTest extends TestCase {
}
/** @dataProvider dataGetNavigation */
- public function testGetSettingsNavigation($absolute) {
+ public function testGetSettingsNavigation($absolute): void {
$this->navigationManager->expects($this->once())
->method('getAll')
->with('settings')
@@ -108,7 +108,7 @@ class NavigationControllerTest extends TestCase {
}
}
- public function testGetAppNavigationEtagMatch() {
+ public function testGetAppNavigationEtagMatch(): void {
$navigation = [ ['id' => 'files', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ];
$this->request->expects($this->once())
->method('getHeader')
@@ -123,7 +123,7 @@ class NavigationControllerTest extends TestCase {
$this->assertEquals(Http::STATUS_NOT_MODIFIED, $actual->getStatus());
}
- public function testGetSettingsNavigationEtagMatch() {
+ public function testGetSettingsNavigationEtagMatch(): void {
$navigation = [ ['id' => 'logout', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ];
$this->request->expects($this->once())
->method('getHeader')
diff --git a/tests/Core/Controller/OCSControllerTest.php b/tests/Core/Controller/OCSControllerTest.php
index 19b87a97359..6fc5f54b8ef 100644
--- a/tests/Core/Controller/OCSControllerTest.php
+++ b/tests/Core/Controller/OCSControllerTest.php
@@ -68,7 +68,7 @@ class OCSControllerTest extends TestCase {
return new DataResponse($data);
}
- public function testGetCapabilities() {
+ public function testGetCapabilities(): void {
$this->userSession->expects($this->once())
->method('isLoggedIn')
->willReturn(true);
@@ -101,7 +101,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->getCapabilities());
}
- public function testGetCapabilitiesPublic() {
+ public function testGetCapabilitiesPublic(): void {
$this->userSession->expects($this->once())
->method('isLoggedIn')
->willReturn(false);
@@ -135,7 +135,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->getCapabilities());
}
- public function testPersonCheckValid() {
+ public function testPersonCheckValid(): void {
$this->userManager->method('checkPassword')
->with(
$this->equalTo('user'),
@@ -150,7 +150,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->personCheck('user', 'pass'));
}
- public function testPersonInvalid() {
+ public function testPersonInvalid(): void {
$this->userManager->method('checkPassword')
->with(
$this->equalTo('user'),
@@ -162,7 +162,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->personCheck('user', 'wrongpass'));
}
- public function testPersonNoLogin() {
+ public function testPersonNoLogin(): void {
$this->userManager->method('checkPassword')
->with(
$this->equalTo('user'),
@@ -173,7 +173,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->personCheck('', ''));
}
- public function testGetIdentityProofWithNotExistingUser() {
+ public function testGetIdentityProofWithNotExistingUser(): void {
$this->userManager
->expects($this->once())
->method('get')
@@ -184,7 +184,7 @@ class OCSControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->getIdentityProof('NotExistingUser'));
}
- public function testGetIdentityProof() {
+ public function testGetIdentityProof(): void {
$user = $this->createMock(IUser::class);
$key = $this->createMock(Key::class);
$this->userManager
diff --git a/tests/Core/Controller/PreviewControllerTest.php b/tests/Core/Controller/PreviewControllerTest.php
index 7c9a32eae38..4274f15e8ed 100644
--- a/tests/Core/Controller/PreviewControllerTest.php
+++ b/tests/Core/Controller/PreviewControllerTest.php
@@ -49,28 +49,28 @@ class PreviewControllerTest extends \Test\TestCase {
);
}
- public function testInvalidFile() {
+ public function testInvalidFile(): void {
$res = $this->controller->getPreview('');
$expected = new DataResponse([], Http::STATUS_BAD_REQUEST);
$this->assertEquals($expected, $res);
}
- public function testInvalidWidth() {
+ public function testInvalidWidth(): void {
$res = $this->controller->getPreview('file', 0);
$expected = new DataResponse([], Http::STATUS_BAD_REQUEST);
$this->assertEquals($expected, $res);
}
- public function testInvalidHeight() {
+ public function testInvalidHeight(): void {
$res = $this->controller->getPreview('file', 10, 0);
$expected = new DataResponse([], Http::STATUS_BAD_REQUEST);
$this->assertEquals($expected, $res);
}
- public function testFileNotFound() {
+ public function testFileNotFound(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
@@ -86,7 +86,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $res);
}
- public function testNotAFile() {
+ public function testNotAFile(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
@@ -103,7 +103,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $res);
}
- public function testNoPreviewAndNoIcon() {
+ public function testNoPreviewAndNoIcon(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
@@ -124,7 +124,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $res);
}
- public function testForbiddenFile() {
+ public function testForbiddenFile(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
@@ -148,7 +148,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $res);
}
- public function testNoPreview() {
+ public function testNoPreview(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
@@ -180,7 +180,7 @@ class PreviewControllerTest extends \Test\TestCase {
$this->assertEquals($expected, $res);
}
- public function testValidPreview() {
+ public function testValidPreview(): void {
$userFolder = $this->createMock(Folder::class);
$this->rootFolder->method('getUserFolder')
->with($this->equalTo($this->userId))
diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php
index 3e99c2cad14..11e18bd622a 100644
--- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php
+++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php
@@ -75,7 +75,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
->willReturn('logoutAttribute');
}
- public function testSelectChallenge() {
+ public function testSelectChallenge(): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$p1 = $this->createMock(IActivatableAtLogin::class);
$p1->method('getId')->willReturn('p1');
@@ -109,7 +109,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->selectChallenge('/some/url'));
}
- public function testShowChallenge() {
+ public function testShowChallenge(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
$provider->method('getId')->willReturn('myprovider');
@@ -160,7 +160,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->showChallenge('myprovider', '/re/dir/ect/url'));
}
- public function testShowInvalidChallenge() {
+ public function testShowInvalidChallenge(): void {
$user = $this->createMock(IUser::class);
$providerSet = new ProviderSet([], false);
@@ -181,7 +181,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->showChallenge('myprovider', 'redirect/url'));
}
- public function testSolveChallenge() {
+ public function testSolveChallenge(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
@@ -206,7 +206,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->solveChallenge('myprovider', 'token'));
}
- public function testSolveValidChallengeAndRedirect() {
+ public function testSolveValidChallengeAndRedirect(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
@@ -231,7 +231,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->solveChallenge('myprovider', 'token', 'redirect%20url'));
}
- public function testSolveChallengeInvalidProvider() {
+ public function testSolveChallengeInvalidProvider(): void {
$user = $this->getMockBuilder(IUser::class)->getMock();
$this->userSession->expects($this->once())
@@ -251,7 +251,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->solveChallenge('myprovider', 'token'));
}
- public function testSolveInvalidChallenge() {
+ public function testSolveInvalidChallenge(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
@@ -285,7 +285,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $this->controller->solveChallenge('myprovider', 'token', '/url'));
}
- public function testSolveChallengeTwoFactorException() {
+ public function testSolveChallengeTwoFactorException(): void {
$user = $this->createMock(IUser::class);
$provider = $this->createMock(IProvider::class);
$exception = new TwoFactorException('2FA failed');
@@ -353,7 +353,7 @@ class TwoFactorChallengeControllerTest extends TestCase {
$this->assertEquals($expected, $response);
}
- public function testSetUpInvalidProvider() {
+ public function testSetUpInvalidProvider(): void {
$user = $this->createMock(IUser::class);
$this->userSession->expects($this->once())
->method('getUser')
diff --git a/tests/Core/Controller/UserControllerTest.php b/tests/Core/Controller/UserControllerTest.php
index 09a22913fdc..979c723dd85 100644
--- a/tests/Core/Controller/UserControllerTest.php
+++ b/tests/Core/Controller/UserControllerTest.php
@@ -31,7 +31,7 @@ class UserControllerTest extends TestCase {
);
}
- public function testGetDisplayNames() {
+ public function testGetDisplayNames(): void {
$user = $this->createMock(IUser::class);
$user->method('getDisplayName')
->willReturn('FooDisplay Name');
diff --git a/tests/Core/Controller/WipeControllerTest.php b/tests/Core/Controller/WipeControllerTest.php
index f07fe4c9282..2cd315db5bf 100644
--- a/tests/Core/Controller/WipeControllerTest.php
+++ b/tests/Core/Controller/WipeControllerTest.php
@@ -50,7 +50,7 @@ class WipeControllerTest extends TestCase {
*
* @dataProvider dataTest
*/
- public function testCheckWipe(bool $valid, bool $couldPerform, bool $result) {
+ public function testCheckWipe(bool $valid, bool $couldPerform, bool $result): void {
if (!$valid) {
$this->remoteWipe->method('start')
->with('mytoken')
@@ -79,7 +79,7 @@ class WipeControllerTest extends TestCase {
*
* @dataProvider dataTest
*/
- public function testWipeDone(bool $valid, bool $couldPerform, bool $result) {
+ public function testWipeDone(bool $valid, bool $couldPerform, bool $result): void {
if (!$valid) {
$this->remoteWipe->method('finish')
->with('mytoken')