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 /tests/Core/Controller | |
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 'tests/Core/Controller')
-rw-r--r-- | tests/Core/Controller/AvatarControllerTest.php | 1 | ||||
-rw-r--r-- | tests/Core/Controller/CSRFTokenControllerTest.php | 1 | ||||
-rw-r--r-- | tests/Core/Controller/CssControllerTest.php | 1 | ||||
-rw-r--r-- | tests/Core/Controller/JsControllerTest.php | 1 | ||||
-rw-r--r-- | tests/Core/Controller/LostControllerTest.php | 8 | ||||
-rw-r--r-- | tests/Core/Controller/NavigationControllerTest.php | 10 | ||||
-rw-r--r-- | tests/Core/Controller/SvgControllerTest.php | 3 | ||||
-rw-r--r-- | tests/Core/Controller/TwoFactorChallengeControllerTest.php | 1 |
8 files changed, 10 insertions, 16 deletions
diff --git a/tests/Core/Controller/AvatarControllerTest.php b/tests/Core/Controller/AvatarControllerTest.php index d2ae9b036b9..38876f02681 100644 --- a/tests/Core/Controller/AvatarControllerTest.php +++ b/tests/Core/Controller/AvatarControllerTest.php @@ -564,5 +564,4 @@ class AvatarControllerTest extends \Test\TestCase { $this->assertEquals('File is too big', $response->getData()['data']['message']); } - } diff --git a/tests/Core/Controller/CSRFTokenControllerTest.php b/tests/Core/Controller/CSRFTokenControllerTest.php index 88e54ee864a..557a6c5f6f0 100644 --- a/tests/Core/Controller/CSRFTokenControllerTest.php +++ b/tests/Core/Controller/CSRFTokenControllerTest.php @@ -78,5 +78,4 @@ class CSRFTokenControllerTest extends TestCase { $this->assertInstanceOf(JSONResponse::class, $response); $this->assertSame(Http::STATUS_FORBIDDEN, $response->getStatus()); } - } diff --git a/tests/Core/Controller/CssControllerTest.php b/tests/Core/Controller/CssControllerTest.php index d1d3ae7eb47..93151065b3c 100644 --- a/tests/Core/Controller/CssControllerTest.php +++ b/tests/Core/Controller/CssControllerTest.php @@ -182,5 +182,4 @@ class CssControllerTest extends TestCase { $result = $this->controller->getCss('file.css', 'myapp'); $this->assertEquals($expected, $result); } - } diff --git a/tests/Core/Controller/JsControllerTest.php b/tests/Core/Controller/JsControllerTest.php index 0b2c6a28f5b..99f58d7e9d8 100644 --- a/tests/Core/Controller/JsControllerTest.php +++ b/tests/Core/Controller/JsControllerTest.php @@ -182,5 +182,4 @@ class JsControllerTest extends TestCase { $result = $this->controller->getJs('file.js', 'myapp'); $this->assertEquals($expected, $result); } - } diff --git a/tests/Core/Controller/LostControllerTest.php b/tests/Core/Controller/LostControllerTest.php index ffd8a5a8c02..09f224131f5 100644 --- a/tests/Core/Controller/LostControllerTest.php +++ b/tests/Core/Controller/LostControllerTest.php @@ -766,7 +766,9 @@ class LostControllerTest extends \Test\TestCase { $encryptionModule = $this->createMock(IEncryptionModule::class); $encryptionModule->expects($this->once())->method('needDetailedAccessList')->willReturn(true); $this->encryptionManager->expects($this->once())->method('getEncryptionModules') - ->willReturn([0 => ['callback' => function () use ($encryptionModule) { return $encryptionModule; }]]); + ->willReturn([0 => ['callback' => function () use ($encryptionModule) { + return $encryptionModule; + }]]); $response = $this->lostController->setPassword('myToken', 'user', 'newpass', false); $expectedResponse = ['status' => 'error', 'msg' => '', 'encryption' => true]; $this->assertSame($expectedResponse, $response); @@ -776,7 +778,9 @@ class LostControllerTest extends \Test\TestCase { $encryptionModule = $this->createMock(IEncryptionModule::class); $encryptionModule->expects($this->once())->method('needDetailedAccessList')->willReturn(false); $this->encryptionManager->expects($this->once())->method('getEncryptionModules') - ->willReturn([0 => ['callback' => function () use ($encryptionModule) { return $encryptionModule; }]]); + ->willReturn([0 => ['callback' => function () use ($encryptionModule) { + return $encryptionModule; + }]]); $this->config->method('getUserValue') ->with('ValidTokenUser', 'core', 'lostpassword', null) ->willReturn('encryptedData'); diff --git a/tests/Core/Controller/NavigationControllerTest.php b/tests/Core/Controller/NavigationControllerTest.php index 4a4ad4b49e3..254013a7350 100644 --- a/tests/Core/Controller/NavigationControllerTest.php +++ b/tests/Core/Controller/NavigationControllerTest.php @@ -87,14 +87,11 @@ class NavigationControllerTest extends TestCase { $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('http://localhost/index.php/apps/files', $actual->getData()[0]['href']); $this->assertEquals('http://localhost/icon', $actual->getData()[0]['icon']); - - } else { $actual = $this->controller->getAppsNavigation($absolute); $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals('/index.php/apps/files', $actual->getData()[0]['href']); $this->assertEquals('icon', $actual->getData()[0]['icon']); - } } @@ -138,9 +135,9 @@ class NavigationControllerTest extends TestCase { ->method('getAll') ->with('link') ->willReturn($navigation); - $actual = $this->controller->getAppsNavigation(); - $this->assertInstanceOf(DataResponse::class, $actual); - $this->assertEquals(Http::STATUS_NOT_MODIFIED, $actual->getStatus()); + $actual = $this->controller->getAppsNavigation(); + $this->assertInstanceOf(DataResponse::class, $actual); + $this->assertEquals(Http::STATUS_NOT_MODIFIED, $actual->getStatus()); } public function testGetSettingsNavigationEtagMatch() { @@ -157,5 +154,4 @@ class NavigationControllerTest extends TestCase { $this->assertInstanceOf(DataResponse::class, $actual); $this->assertEquals(Http::STATUS_NOT_MODIFIED, $actual->getStatus()); } - } diff --git a/tests/Core/Controller/SvgControllerTest.php b/tests/Core/Controller/SvgControllerTest.php index 4413fbb9ae5..684199f5cb6 100644 --- a/tests/Core/Controller/SvgControllerTest.php +++ b/tests/Core/Controller/SvgControllerTest.php @@ -1,6 +1,6 @@ <?php -declare (strict_types = 1); +declare(strict_types = 1); /** * @copyright Copyright (c) 2018 Michael Weimann <mail@michael-weimann.eu> * @@ -37,7 +37,6 @@ use Test\TestCase; * This class provides test cases for the svg controller */ class SvgControllerTest extends TestCase { - const TEST_IMAGES_SOURCE_PATH = __DIR__ . '/../../data/svg'; const TEST_IMAGES_PATH = __DIR__ . '/../../../core/img/testImages'; const TEST_IMAGE_MIXED = 'mixed-source.svg'; diff --git a/tests/Core/Controller/TwoFactorChallengeControllerTest.php b/tests/Core/Controller/TwoFactorChallengeControllerTest.php index fa155500567..a7907343c24 100644 --- a/tests/Core/Controller/TwoFactorChallengeControllerTest.php +++ b/tests/Core/Controller/TwoFactorChallengeControllerTest.php @@ -443,5 +443,4 @@ class TwoFactorChallengeControllerTest extends TestCase { $this->assertEquals($expected, $response); } - } |