summaryrefslogtreecommitdiffstats
path: root/apps/settings/tests/Controller
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/Controller
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/Controller')
-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
6 files changed, 10 insertions, 15 deletions
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],
];
}
-
}