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/lib/Security | |
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/lib/Security')
-rw-r--r-- | tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php | 1 | ||||
-rw-r--r-- | tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php | 2 | ||||
-rw-r--r-- | tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php | 1 | ||||
-rw-r--r-- | tests/lib/Security/CertificateManagerTest.php | 3 | ||||
-rw-r--r-- | tests/lib/Security/CredentialsManagerTest.php | 1 | ||||
-rw-r--r-- | tests/lib/Security/CryptoTest.php | 4 | ||||
-rw-r--r-- | tests/lib/Security/FeaturePolicy/FeaturePolicyManagerTest.php | 1 | ||||
-rw-r--r-- | tests/lib/Security/HasherTest.php | 9 | ||||
-rw-r--r-- | tests/lib/Security/IdentityProof/ManagerTest.php | 3 | ||||
-rw-r--r-- | tests/lib/Security/IdentityProof/SignerTest.php | 2 | ||||
-rw-r--r-- | tests/lib/Security/Normalizer/IpAddressTest.php | 1 | ||||
-rw-r--r-- | tests/lib/Security/SecureRandomTest.php | 1 |
12 files changed, 6 insertions, 23 deletions
diff --git a/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php b/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php index 21e29c910c4..2fc7a53e78d 100644 --- a/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php +++ b/tests/lib/Security/CSP/ContentSecurityPolicyManagerTest.php @@ -119,5 +119,4 @@ class ContentSecurityPolicyManagerTest extends TestCase { $this->assertEquals($expected, $this->contentSecurityPolicyManager->getDefaultPolicy()); $this->assertSame($expectedStringPolicy, $this->contentSecurityPolicyManager->getDefaultPolicy()->buildPolicy()); } - } diff --git a/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php b/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php index 346ace943d9..783eb35eef9 100644 --- a/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php +++ b/tests/lib/Security/CSP/ContentSecurityPolicyNonceManagerTest.php @@ -27,7 +27,7 @@ use OC\Security\CSRF\CsrfToken; use OC\Security\CSRF\CsrfTokenManager; use Test\TestCase; -class ContentSecurityPolicyNonceManagerTest extends TestCase { +class ContentSecurityPolicyNonceManagerTest extends TestCase { /** @var CsrfTokenManager */ private $csrfTokenManager; /** @var Request */ diff --git a/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php b/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php index 5ab15c73bf2..10ab0f00c94 100644 --- a/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php +++ b/tests/lib/Security/CSRF/CsrfTokenGeneratorTest.php @@ -32,7 +32,6 @@ class CsrfTokenGeneratorTest extends \Test\TestCase { $this->random = $this->getMockBuilder('\OCP\Security\ISecureRandom') ->disableOriginalConstructor()->getMock(); $this->csrfTokenGenerator = new \OC\Security\CSRF\CsrfTokenGenerator($this->random); - } public function testGenerateTokenWithCustomNumber() { diff --git a/tests/lib/Security/CertificateManagerTest.php b/tests/lib/Security/CertificateManagerTest.php index 579a15f483a..6a93657f8c8 100644 --- a/tests/lib/Security/CertificateManagerTest.php +++ b/tests/lib/Security/CertificateManagerTest.php @@ -152,7 +152,6 @@ class CertificateManagerTest extends \Test\TestCase { $targetBundleExists, $expected ) { - $view = $this->getMockBuilder(View::class) ->disableOriginalConstructor()->getMock(); $config = $this->createMock(IConfig::class); @@ -177,7 +176,6 @@ class CertificateManagerTest extends \Test\TestCase { if ($uid !== null && $targetBundleExists) { $certificateManager->expects($this->at(2))->method('getCertificateBundle') ->with(null)->willReturn('SystemBundlePath'); - } $view->expects($this->any())->method('filemtime') @@ -194,7 +192,6 @@ class CertificateManagerTest extends \Test\TestCase { $this->assertSame($expected, $this->invokePrivate($certificateManager, 'needsRebundling', [$uid]) ); - } function dataTestNeedRebundling() { diff --git a/tests/lib/Security/CredentialsManagerTest.php b/tests/lib/Security/CredentialsManagerTest.php index 5ebcac7756a..8b58542f8c3 100644 --- a/tests/lib/Security/CredentialsManagerTest.php +++ b/tests/lib/Security/CredentialsManagerTest.php @@ -106,5 +106,4 @@ class CredentialsManagerTest extends \Test\TestCase { $this->manager->retrieve($userId, $identifier); } - } diff --git a/tests/lib/Security/CryptoTest.php b/tests/lib/Security/CryptoTest.php index 5e079c8018f..2a2e6adac3e 100644 --- a/tests/lib/Security/CryptoTest.php +++ b/tests/lib/Security/CryptoTest.php @@ -11,9 +11,7 @@ namespace Test\Security; use OC\Security\Crypto; class CryptoTest extends \Test\TestCase { - - public function defaultEncryptionProvider() - { + public function defaultEncryptionProvider() { return [ ['Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt.'], [''], diff --git a/tests/lib/Security/FeaturePolicy/FeaturePolicyManagerTest.php b/tests/lib/Security/FeaturePolicy/FeaturePolicyManagerTest.php index 15bbc803f5a..b8f558719dc 100644 --- a/tests/lib/Security/FeaturePolicy/FeaturePolicyManagerTest.php +++ b/tests/lib/Security/FeaturePolicy/FeaturePolicyManagerTest.php @@ -86,5 +86,4 @@ class FeaturePolicyManagerTest extends TestCase { $this->assertEquals($expected, $this->manager->getDefaultPolicy()); $this->assertSame($expectedStringPolicy, $this->manager->getDefaultPolicy()->buildPolicy()); } - } diff --git a/tests/lib/Security/HasherTest.php b/tests/lib/Security/HasherTest.php index 76f880c1c12..cc5cb786088 100644 --- a/tests/lib/Security/HasherTest.php +++ b/tests/lib/Security/HasherTest.php @@ -19,8 +19,7 @@ class HasherTest extends \Test\TestCase { /** * @return array */ - public function versionHashProvider() - { + public function versionHashProvider() { return [ ['asf32äà$$a.|3', null], ['asf32äà$$a.|3|5', null], @@ -30,8 +29,7 @@ class HasherTest extends \Test\TestCase { ]; } - public function hashProviders70_71(): array - { + public function hashProviders70_71(): array { return [ // Valid SHA1 strings ['password', '5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8', true], @@ -140,7 +138,7 @@ class HasherTest extends \Test\TestCase { ->expects($this->any()) ->method('getSystemValue') ->willReturnCallback(function ($key, $default) { - if($key === 'passwordsalt') { + if ($key === 'passwordsalt') { return '6Wow67q1wZQZpUUeI6G2LsWUu4XKx'; } return $default; @@ -259,6 +257,5 @@ class HasherTest extends \Test\TestCase { $info = password_get_info($relativePath['hash']); $this->assertEquals(PASSWORD_BCRYPT, $info['algo']); - } } diff --git a/tests/lib/Security/IdentityProof/ManagerTest.php b/tests/lib/Security/IdentityProof/ManagerTest.php index 5f96782bae8..5fd1d709c2f 100644 --- a/tests/lib/Security/IdentityProof/ManagerTest.php +++ b/tests/lib/Security/IdentityProof/ManagerTest.php @@ -35,7 +35,7 @@ use OCP\Security\ICrypto; use PHPUnit\Framework\MockObject\MockObject; use Test\TestCase; -class ManagerTest extends TestCase { +class ManagerTest extends TestCase { /** @var Factory|MockObject */ private $factory; /** @var IAppData|MockObject */ @@ -214,7 +214,6 @@ class ManagerTest extends TestCase { ->willReturn($key); $this->assertSame($key, $manager->getSystemKey()); - } diff --git a/tests/lib/Security/IdentityProof/SignerTest.php b/tests/lib/Security/IdentityProof/SignerTest.php index 884065e6a1a..913ab7c15f5 100644 --- a/tests/lib/Security/IdentityProof/SignerTest.php +++ b/tests/lib/Security/IdentityProof/SignerTest.php @@ -200,6 +200,4 @@ gQIDAQAB $this->assertFalse($this->signer->verify($data)); } - - } diff --git a/tests/lib/Security/Normalizer/IpAddressTest.php b/tests/lib/Security/Normalizer/IpAddressTest.php index 97a8737ea9e..16be71cb225 100644 --- a/tests/lib/Security/Normalizer/IpAddressTest.php +++ b/tests/lib/Security/Normalizer/IpAddressTest.php @@ -25,7 +25,6 @@ use OC\Security\Normalizer\IpAddress; use Test\TestCase; class IpAddressTest extends TestCase { - public function subnetDataProvider() { return [ [ diff --git a/tests/lib/Security/SecureRandomTest.php b/tests/lib/Security/SecureRandomTest.php index 6898c1d8b0f..4075a1c7109 100644 --- a/tests/lib/Security/SecureRandomTest.php +++ b/tests/lib/Security/SecureRandomTest.php @@ -11,7 +11,6 @@ namespace Test\Security; use OC\Security\SecureRandom; class SecureRandomTest extends \Test\TestCase { - public function stringGenerationProvider() { return [ [0, 0], |