summaryrefslogtreecommitdiffstats
path: root/apps/settings/tests
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 14:19:56 +0200
commitcaff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch)
tree186d494c2aea5dea7255d3584ef5d595fc6e6194 /apps/settings/tests
parentedf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff)
downloadnextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz
nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/settings/tests')
-rw-r--r--apps/settings/tests/Activity/SecurityFilterTest.php1
-rw-r--r--apps/settings/tests/Activity/SecurityProviderTest.php1
-rw-r--r--apps/settings/tests/Activity/SecuritySettingTest.php2
-rw-r--r--apps/settings/tests/Controller/AuthSettingsControllerTest.php1
-rw-r--r--apps/settings/tests/Controller/CertificateControllerTest.php1
-rw-r--r--apps/settings/tests/Controller/CheckSetupControllerTest.php2
-rw-r--r--apps/settings/tests/Controller/MailSettingsControllerTest.php2
-rw-r--r--apps/settings/tests/Controller/TwoFactorSettingsControllerTest.php1
-rw-r--r--apps/settings/tests/Controller/UsersControllerTest.php18
-rw-r--r--apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php1
-rw-r--r--apps/settings/tests/Settings/Personal/Security/PasswordTest.php1
11 files changed, 10 insertions, 21 deletions
diff --git a/apps/settings/tests/Activity/SecurityFilterTest.php b/apps/settings/tests/Activity/SecurityFilterTest.php
index 750e242c889..4f9d9a87ef1 100644
--- a/apps/settings/tests/Activity/SecurityFilterTest.php
+++ b/apps/settings/tests/Activity/SecurityFilterTest.php
@@ -85,5 +85,4 @@ class SecurityFilterTest extends TestCase {
public function testGetPriority() {
$this->assertEquals(30, $this->filter->getPriority());
}
-
}
diff --git a/apps/settings/tests/Activity/SecurityProviderTest.php b/apps/settings/tests/Activity/SecurityProviderTest.php
index 7deac1f7ddb..174f6049b34 100644
--- a/apps/settings/tests/Activity/SecurityProviderTest.php
+++ b/apps/settings/tests/Activity/SecurityProviderTest.php
@@ -135,5 +135,4 @@ class SecurityProviderTest extends TestCase {
$this->expectException(InvalidArgumentException::class);
$this->provider->parse($lang, $event);
}
-
}
diff --git a/apps/settings/tests/Activity/SecuritySettingTest.php b/apps/settings/tests/Activity/SecuritySettingTest.php
index da53f8b38e9..e66d3e0dc10 100644
--- a/apps/settings/tests/Activity/SecuritySettingTest.php
+++ b/apps/settings/tests/Activity/SecuritySettingTest.php
@@ -29,7 +29,6 @@ use OCP\IL10N;
use Test\TestCase;
class SecuritySettingTest extends TestCase {
-
private $l10n;
/** @var SecuritySetting */
@@ -71,5 +70,4 @@ class SecuritySettingTest extends TestCase {
$this->assertTrue($this->setting->isDefaultEnabledMail());
$this->assertTrue($this->setting->isDefaultEnabledStream());
}
-
}
diff --git a/apps/settings/tests/Controller/AuthSettingsControllerTest.php b/apps/settings/tests/Controller/AuthSettingsControllerTest.php
index 1d24a90794f..b642b1c06c5 100644
--- a/apps/settings/tests/Controller/AuthSettingsControllerTest.php
+++ b/apps/settings/tests/Controller/AuthSettingsControllerTest.php
@@ -479,5 +479,4 @@ class AuthSettingsControllerTest extends TestCase {
$expected = new JSONResponse([]);
$this->assertEquals($expected, $response);
}
-
}
diff --git a/apps/settings/tests/Controller/CertificateControllerTest.php b/apps/settings/tests/Controller/CertificateControllerTest.php
index a04906a6811..0259868321d 100644
--- a/apps/settings/tests/Controller/CertificateControllerTest.php
+++ b/apps/settings/tests/Controller/CertificateControllerTest.php
@@ -193,5 +193,4 @@ class CertificateControllerTest extends \Test\TestCase {
$this->assertEquals(new DataResponse(), $this->certificateController->removePersonalRootCertificate('CertificateToRemove'));
}
-
}
diff --git a/apps/settings/tests/Controller/CheckSetupControllerTest.php b/apps/settings/tests/Controller/CheckSetupControllerTest.php
index 86acf8acced..ebbe9fd95b7 100644
--- a/apps/settings/tests/Controller/CheckSetupControllerTest.php
+++ b/apps/settings/tests/Controller/CheckSetupControllerTest.php
@@ -719,7 +719,7 @@ class CheckSetupControllerTest extends TestCase {
->expects($this->once())
->method('getCurlVersion')
->willReturn(['ssl_version' => 'OpenSSL/1.0.1d']);
- $this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
+ $this->assertSame('', $this->invokePrivate($this->checkSetupController, 'isUsedTlsLibOutdated'));
}
public function testIsUsedTlsLibOutdatedWithMatchingOpenSslVersion1() {
diff --git a/apps/settings/tests/Controller/MailSettingsControllerTest.php b/apps/settings/tests/Controller/MailSettingsControllerTest.php
index 7d17ac80407..7611d6bcf68 100644
--- a/apps/settings/tests/Controller/MailSettingsControllerTest.php
+++ b/apps/settings/tests/Controller/MailSettingsControllerTest.php
@@ -133,7 +133,6 @@ class MailSettingsControllerTest extends \Test\TestCase {
null
);
$this->assertSame(Http::STATUS_OK, $response->getStatus());
-
}
public function testStoreCredentials() {
@@ -189,5 +188,4 @@ class MailSettingsControllerTest extends \Test\TestCase {
$response = $this->mailController->sendTestMail();
$this->assertSame(Http::STATUS_OK, $response->getStatus());
}
-
}
diff --git a/apps/settings/tests/Controller/TwoFactorSettingsControllerTest.php b/apps/settings/tests/Controller/TwoFactorSettingsControllerTest.php
index d7da886c991..1d7c7db8924 100644
--- a/apps/settings/tests/Controller/TwoFactorSettingsControllerTest.php
+++ b/apps/settings/tests/Controller/TwoFactorSettingsControllerTest.php
@@ -82,5 +82,4 @@ class TwoFactorSettingsControllerTest extends TestCase {
$this->assertEquals($expected, $resp);
}
-
}
diff --git a/apps/settings/tests/Controller/UsersControllerTest.php b/apps/settings/tests/Controller/UsersControllerTest.php
index 65258252016..9029b1af396 100644
--- a/apps/settings/tests/Controller/UsersControllerTest.php
+++ b/apps/settings/tests/Controller/UsersControllerTest.php
@@ -113,8 +113,9 @@ class UsersControllerTest extends \Test\TestCase {
$this->encryptionModule = $this->createMock(IEncryptionModule::class);
$this->encryptionManager->expects($this->any())->method('getEncryptionModules')
- ->willReturn(['encryptionModule' => ['callback' => function () { return $this->encryptionModule;}]]);
-
+ ->willReturn(['encryptionModule' => ['callback' => function () {
+ return $this->encryptionModule;
+ }]]);
}
/**
@@ -444,12 +445,11 @@ class UsersControllerTest extends \Test\TestCase {
* @dataProvider dataTestGetVerificationCode
*/
public function testGetVerificationCode($account, $type, $dataBefore, $expectedData, $onlyVerificationCode) {
-
$message = 'Use my Federated Cloud ID to share with me: user@nextcloud.com';
$signature = 'theSignature';
$code = $message . ' ' . $signature;
- if($type === AccountManager::PROPERTY_TWITTER) {
+ if ($type === AccountManager::PROPERTY_TWITTER) {
$code = $message . ' ' . md5($signature);
}
@@ -485,7 +485,6 @@ class UsersControllerTest extends \Test\TestCase {
}
public function dataTestGetVerificationCode() {
-
$accountDataBefore = [
AccountManager::PROPERTY_WEBSITE => ['value' => 'https://nextcloud.com', 'verified' => AccountManager::NOT_VERIFIED],
AccountManager::PROPERTY_TWITTER => ['value' => '@nextclouders', 'verified' => AccountManager::NOT_VERIFIED, 'signature' => 'theSignature'],
@@ -513,7 +512,6 @@ class UsersControllerTest extends \Test\TestCase {
* test get verification code in case no valid user was given
*/
public function testGetVerificationCodeInvalidUser() {
-
$controller = $this->getController();
$this->userSession->expects($this->once())->method('getUser')->willReturn(null);
$result = $controller->getVerificationCode('account', false);
@@ -541,8 +539,11 @@ class UsersControllerTest extends \Test\TestCase {
$this->encryptionManager->expects($this->any())
->method('getEncryptionModule')
->willReturnCallback(function () use ($encryptionModuleLoaded) {
- if ($encryptionModuleLoaded) return $this->encryptionModule;
- else throw new ModuleDoesNotExistsException();
+ if ($encryptionModuleLoaded) {
+ return $this->encryptionModule;
+ } else {
+ throw new ModuleDoesNotExistsException();
+ }
});
$this->encryptionModule->expects($this->any())
->method('needDetailedAccessList')
@@ -565,5 +566,4 @@ class UsersControllerTest extends \Test\TestCase {
[false, false, false, true],
];
}
-
}
diff --git a/apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php b/apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php
index ad0b7108423..e03e05c149a 100644
--- a/apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php
+++ b/apps/settings/tests/Settings/Personal/Security/AuthtokensTest.php
@@ -130,5 +130,4 @@ class AuthtokensTest extends TestCase {
$expected = new TemplateResponse('settings', 'settings/personal/security/authtokens');
$this->assertEquals($expected, $form);
}
-
}
diff --git a/apps/settings/tests/Settings/Personal/Security/PasswordTest.php b/apps/settings/tests/Settings/Personal/Security/PasswordTest.php
index 7785338d86d..db766747fe7 100644
--- a/apps/settings/tests/Settings/Personal/Security/PasswordTest.php
+++ b/apps/settings/tests/Settings/Personal/Security/PasswordTest.php
@@ -74,5 +74,4 @@ class PasswordTest extends TestCase {
]);
$this->assertEquals($expected, $form);
}
-
}