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/Encryption/DecryptAllTest.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 'tests/lib/Encryption/DecryptAllTest.php')
-rw-r--r-- | tests/lib/Encryption/DecryptAllTest.php | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php index 8e53c4a92e1..3a16327ac18 100644 --- a/tests/lib/Encryption/DecryptAllTest.php +++ b/tests/lib/Encryption/DecryptAllTest.php @@ -107,7 +107,6 @@ class DecryptAllTest extends TestCase { * @param bool $userExistsChecked */ public function testDecryptAll($prepareResult, $user, $userExistsChecked) { - if ($userExistsChecked) { $this->userManager->expects($this->once())->method('userExists')->willReturn(true); } else { @@ -166,7 +165,6 @@ class DecryptAllTest extends TestCase { * @param bool $success */ public function testPrepareEncryptionModules($success) { - $user = 'user1'; $dummyEncryptionModule = $this->getMockBuilder('OCP\Encryption\IEncryptionModule') @@ -177,7 +175,9 @@ class DecryptAllTest extends TestCase { ->with($this->inputInterface, $this->outputInterface, $user) ->willReturn($success); - $callback = function () use ($dummyEncryptionModule) {return $dummyEncryptionModule;}; + $callback = function () use ($dummyEncryptionModule) { + return $dummyEncryptionModule; + }; $moduleDescription = [ 'id' => 'id', 'displayName' => 'displayName', @@ -305,14 +305,12 @@ class DecryptAllTest extends TestCase { $progressBar = new ProgressBar($output); $this->invokePrivate($instance, 'decryptUsersFiles', ['user1', $progressBar, '']); - } /** * @dataProvider dataTrueFalse */ public function testDecryptFile($isEncrypted) { - $path = 'test.txt'; /** @var DecryptAll | \PHPUnit_Framework_MockObject_MockObject $instance */ @@ -379,7 +377,9 @@ class DecryptAllTest extends TestCase { $this->view->expects($this->once()) ->method('copy') ->with($path, $path . '.decrypted.42') - ->willReturnCallback(function () { throw new DecryptionFailedException();}); + ->willReturnCallback(function () { + throw new DecryptionFailedException(); + }); $this->view->expects($this->never())->method('rename'); $this->view->expects($this->once()) @@ -394,5 +394,4 @@ class DecryptAllTest extends TestCase { $this->invokePrivate($instance, 'decryptFile', [$path]) ); } - } |