diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-04-10 16:38:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-10 16:38:23 +0200 |
commit | 1762a409f954fd9a66e7572704ea9ba7813601b4 (patch) | |
tree | 554d8f6bc93f397755d0a7c050041a9973e25396 /tests/Core/Controller | |
parent | eba3726e1e1b7ce0a98df4552cfdecfe05e0d63a (diff) | |
parent | caff1023ea72bb2ea94130e18a2a6e2ccf819e5f (diff) | |
download | nextcloud-server-1762a409f954fd9a66e7572704ea9ba7813601b4.tar.gz nextcloud-server-1762a409f954fd9a66e7572704ea9ba7813601b4.zip |
Merge pull request #20422 from nextcloud/techdebt/format-control-structs-classes-methods
Format control structures, classes, methods and function
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); } - } |