diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 15:19:56 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 15:19:56 +0300 |
commit | caff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch) | |
tree | 186d494c2aea5dea7255d3584ef5d595fc6e6194 /apps/files_external/tests | |
parent | edf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff) |
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/files_external/tests')
19 files changed, 6 insertions, 27 deletions
diff --git a/apps/files_external/tests/Auth/AuthMechanismTest.php b/apps/files_external/tests/Auth/AuthMechanismTest.php index dcdc8d42aec..8a4321466c8 100644 --- a/apps/files_external/tests/Auth/AuthMechanismTest.php +++ b/apps/files_external/tests/Auth/AuthMechanismTest.php @@ -28,7 +28,6 @@ use OCA\Files_External\Lib\Backend\Backend; use OCA\Files_External\Lib\StorageConfig; class AuthMechanismTest extends \Test\TestCase { - public function testJsonSerialization() { $mechanism = $this->getMockBuilder(AuthMechanism::class) ->setMethods(['jsonSerializeDefinition']) @@ -82,5 +81,4 @@ class AuthMechanismTest extends \Test\TestCase { $this->assertEquals($expectedSuccess, $mechanism->validateStorage($storageConfig)); } - } diff --git a/apps/files_external/tests/Auth/Password/GlobalAuth.php b/apps/files_external/tests/Auth/Password/GlobalAuth.php index f6e6b0b55ac..8edf7358ed8 100644 --- a/apps/files_external/tests/Auth/Password/GlobalAuth.php +++ b/apps/files_external/tests/Auth/Password/GlobalAuth.php @@ -118,5 +118,4 @@ class GlobalAuthTest extends TestCase { $this->instance->manipulateStorageConfig($storage); $this->assertEquals([], $storage->getBackendOptions()); } - } diff --git a/apps/files_external/tests/Backend/BackendTest.php b/apps/files_external/tests/Backend/BackendTest.php index 10853d9197c..ca7cc7d7b2c 100644 --- a/apps/files_external/tests/Backend/BackendTest.php +++ b/apps/files_external/tests/Backend/BackendTest.php @@ -28,7 +28,6 @@ use OCA\Files_External\Lib\Backend\Backend; use OCA\Files_External\Lib\StorageConfig; class BackendTest extends \Test\TestCase { - public function testJsonSerialization() { $backend = $this->getMockBuilder(Backend::class) ->setMethods(['jsonSerializeDefinition']) @@ -89,5 +88,4 @@ class BackendTest extends \Test\TestCase { $this->assertEquals('foobar', $backend->getLegacyAuthMechanism(['other' => true])); $this->assertEquals('foobar', $backend->getLegacyAuthMechanism()); } - } diff --git a/apps/files_external/tests/Backend/LegacyBackendTest.php b/apps/files_external/tests/Backend/LegacyBackendTest.php index 71957466c7d..c929058c2b5 100644 --- a/apps/files_external/tests/Backend/LegacyBackendTest.php +++ b/apps/files_external/tests/Backend/LegacyBackendTest.php @@ -111,5 +111,4 @@ class LegacyBackendTest extends \Test\TestCase { $dependencies = $backend->checkDependencies(); $this->assertCount(0, $dependencies); } - } diff --git a/apps/files_external/tests/Config/UserPlaceholderHandlerTest.php b/apps/files_external/tests/Config/UserPlaceholderHandlerTest.php index 443a13eccef..5fc03cad9e4 100644 --- a/apps/files_external/tests/Config/UserPlaceholderHandlerTest.php +++ b/apps/files_external/tests/Config/UserPlaceholderHandlerTest.php @@ -98,5 +98,4 @@ class UserPlaceholderHandlerTest extends \Test\TestCase { ->willThrowException(new ShareNotFound()); $this->assertSame($option, $this->handler->handle($option)); } - } diff --git a/apps/files_external/tests/Controller/StoragesControllerTest.php b/apps/files_external/tests/Controller/StoragesControllerTest.php index 4e07751fb3d..40d0154d992 100644 --- a/apps/files_external/tests/Controller/StoragesControllerTest.php +++ b/apps/files_external/tests/Controller/StoragesControllerTest.php @@ -403,5 +403,4 @@ abstract class StoragesControllerTest extends \Test\TestCase { $this->assertEquals(Http::STATUS_UNPROCESSABLE_ENTITY, $response->getStatus()); } } - } diff --git a/apps/files_external/tests/Controller/UserStoragesControllerTest.php b/apps/files_external/tests/Controller/UserStoragesControllerTest.php index 2c3da44b3b2..109a0335146 100644 --- a/apps/files_external/tests/Controller/UserStoragesControllerTest.php +++ b/apps/files_external/tests/Controller/UserStoragesControllerTest.php @@ -110,5 +110,4 @@ class UserStoragesControllerTest extends StoragesControllerTest { $this->assertEquals(Http::STATUS_UNPROCESSABLE_ENTITY, $response->getStatus()); } - } diff --git a/apps/files_external/tests/DefinitionParameterTest.php b/apps/files_external/tests/DefinitionParameterTest.php index 862d3deb557..b0a48509d65 100644 --- a/apps/files_external/tests/DefinitionParameterTest.php +++ b/apps/files_external/tests/DefinitionParameterTest.php @@ -27,7 +27,6 @@ namespace OCA\Files_External\Tests; use OCA\Files_External\Lib\DefinitionParameter as Param; class DefinitionParameterTest extends \Test\TestCase { - public function testJsonSerialization() { $param = new Param('foo', 'bar'); $this->assertEquals([ diff --git a/apps/files_external/tests/FrontendDefinitionTraitTest.php b/apps/files_external/tests/FrontendDefinitionTraitTest.php index ad5cb903214..c4eab6f0122 100644 --- a/apps/files_external/tests/FrontendDefinitionTraitTest.php +++ b/apps/files_external/tests/FrontendDefinitionTraitTest.php @@ -29,7 +29,6 @@ use OCA\Files_External\Lib\DefinitionParameter; use OCA\Files_External\Lib\StorageConfig; class FrontendDefinitionTraitTest extends \Test\TestCase { - public function testJsonSerialization() { $param = $this->getMockBuilder(DefinitionParameter::class) ->disableOriginalConstructor() diff --git a/apps/files_external/tests/LegacyDependencyCheckPolyfillTest.php b/apps/files_external/tests/LegacyDependencyCheckPolyfillTest.php index b5c8ae3b2c6..b873a18694d 100644 --- a/apps/files_external/tests/LegacyDependencyCheckPolyfillTest.php +++ b/apps/files_external/tests/LegacyDependencyCheckPolyfillTest.php @@ -50,5 +50,4 @@ class LegacyDependencyCheckPolyfillTest extends \Test\TestCase { $this->assertEquals('program', $dependencies[1]->getDependency()); $this->assertEquals('cannot find program', $dependencies[1]->getMessage()); } - } diff --git a/apps/files_external/tests/OwnCloudFunctionsTest.php b/apps/files_external/tests/OwnCloudFunctionsTest.php index 35c3637ecf7..7ce72ce62d6 100644 --- a/apps/files_external/tests/OwnCloudFunctionsTest.php +++ b/apps/files_external/tests/OwnCloudFunctionsTest.php @@ -35,7 +35,6 @@ namespace OCA\Files_External\Tests; * @package OCA\Files_External\Tests */ class OwnCloudFunctionsTest extends \Test\TestCase { - function configUrlProvider() { return [ [ diff --git a/apps/files_external/tests/Service/BackendServiceTest.php b/apps/files_external/tests/Service/BackendServiceTest.php index 2c4587923d8..0964f48572b 100644 --- a/apps/files_external/tests/Service/BackendServiceTest.php +++ b/apps/files_external/tests/Service/BackendServiceTest.php @@ -242,7 +242,9 @@ class BackendServiceTest extends \Test\TestCase { $service = new BackendService($this->config); $mock = $this->createMock(IConfigHandler::class); - $cb = function () use ($mock) { return $mock; }; + $cb = function () use ($mock) { + return $mock; + }; foreach ($placeholders as $placeholder) { $service->registerConfigHandler($placeholder, $cb); } @@ -253,7 +255,9 @@ class BackendServiceTest extends \Test\TestCase { $mock = $this->createMock(IConfigHandler::class); $mock->expects($this->exactly(3)) ->method('handle'); - $cb = function () use ($mock) { return $mock; }; + $cb = function () use ($mock) { + return $mock; + }; $service->registerConfigHandler('one', $cb); $service->registerConfigHandler('2', $cb); $service->registerConfigHandler('Three', $cb); @@ -265,5 +269,4 @@ class BackendServiceTest extends \Test\TestCase { $handler->handle('Something'); } } - } diff --git a/apps/files_external/tests/Service/GlobalStoragesServiceTest.php b/apps/files_external/tests/Service/GlobalStoragesServiceTest.php index bc831b1e95c..b977a4b3eb6 100644 --- a/apps/files_external/tests/Service/GlobalStoragesServiceTest.php +++ b/apps/files_external/tests/Service/GlobalStoragesServiceTest.php @@ -445,7 +445,6 @@ class GlobalStoragesServiceTest extends StoragesServiceTest { $updatedApplicableUsers, $updatedApplicableGroups, $expectedCalls) { - $storage = $this->makeTestStorageData(); $storage->setApplicableUsers($sourceApplicableUsers); $storage->setApplicableGroups($sourceApplicableGroups); @@ -603,7 +602,6 @@ class GlobalStoragesServiceTest extends StoragesServiceTest { $sourceApplicableUsers, $sourceApplicableGroups, $expectedCalls) { - $storage = $this->makeTestStorageData(); $storage->setApplicableUsers($sourceApplicableUsers); $storage->setApplicableGroups($sourceApplicableGroups); @@ -626,5 +624,4 @@ class GlobalStoragesServiceTest extends StoragesServiceTest { ); } } - } diff --git a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php index 633399197f2..c23d741b23d 100644 --- a/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php +++ b/apps/files_external/tests/Service/UserGlobalStoragesServiceTest.php @@ -153,10 +153,8 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { $this->service->getStorage($newStorage->getId()); $this->fail('Failed asserting that storage can\'t be accessed by id'); } catch (NotFoundException $e) { - } } - } diff --git a/apps/files_external/tests/Storage/Amazons3Test.php b/apps/files_external/tests/Storage/Amazons3Test.php index 0e9ec3dbaa6..2aaeede47c3 100644 --- a/apps/files_external/tests/Storage/Amazons3Test.php +++ b/apps/files_external/tests/Storage/Amazons3Test.php @@ -38,7 +38,6 @@ use OCA\Files_External\Lib\Storage\AmazonS3; * @package OCA\Files_External\Tests\Storage */ class Amazons3Test extends \Test\Files\Storage\Storage { - private $config; protected function setUp(): void { diff --git a/apps/files_external/tests/Storage/OwncloudTest.php b/apps/files_external/tests/Storage/OwncloudTest.php index 0f63709614d..6a07bcf498f 100644 --- a/apps/files_external/tests/Storage/OwncloudTest.php +++ b/apps/files_external/tests/Storage/OwncloudTest.php @@ -37,7 +37,6 @@ use OCA\Files_External\Lib\Storage\OwnCloud; * @package OCA\Files_External\Tests\Storage */ class OwncloudTest extends \Test\Files\Storage\Storage { - private $config; protected function setUp(): void { diff --git a/apps/files_external/tests/Storage/SwiftTest.php b/apps/files_external/tests/Storage/SwiftTest.php index 1300aa03038..d90608a2886 100644 --- a/apps/files_external/tests/Storage/SwiftTest.php +++ b/apps/files_external/tests/Storage/SwiftTest.php @@ -39,7 +39,6 @@ use OCA\Files_External\Lib\Storage\Swift; * @package OCA\Files_External\Tests\Storage */ class SwiftTest extends \Test\Files\Storage\Storage { - private $config; /** diff --git a/apps/files_external/tests/Storage/WebdavTest.php b/apps/files_external/tests/Storage/WebdavTest.php index 88e2d4a0181..03b1d41eae5 100644 --- a/apps/files_external/tests/Storage/WebdavTest.php +++ b/apps/files_external/tests/Storage/WebdavTest.php @@ -39,7 +39,6 @@ use OC\Files\Type\Detection; * @package OCA\Files_External\Tests\Storage */ class WebdavTest extends \Test\Files\Storage\Storage { - protected function setUp(): void { parent::setUp(); diff --git a/apps/files_external/tests/StorageConfigTest.php b/apps/files_external/tests/StorageConfigTest.php index 01dab4d95a0..2f0a8fdba50 100644 --- a/apps/files_external/tests/StorageConfigTest.php +++ b/apps/files_external/tests/StorageConfigTest.php @@ -32,7 +32,6 @@ use OCA\Files_External\Lib\DefinitionParameter; use OCA\Files_External\Lib\StorageConfig; class StorageConfigTest extends \Test\TestCase { - public function testJsonSerialization() { $backend = $this->getMockBuilder(Backend::class) ->disableOriginalConstructor() @@ -81,5 +80,4 @@ class StorageConfigTest extends \Test\TestCase { $this->assertSame(['group1', 'group2'], $json['applicableGroups']); $this->assertSame(['preview' => false], $json['mountOptions']); } - } |