diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
commit | caff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch) | |
tree | 186d494c2aea5dea7255d3584ef5d595fc6e6194 /apps/settings/tests/Controller/UsersControllerTest.php | |
parent | edf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff) | |
download | nextcloud-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/UsersControllerTest.php')
-rw-r--r-- | apps/settings/tests/Controller/UsersControllerTest.php | 18 |
1 files changed, 9 insertions, 9 deletions
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], ]; } - } |