diff options
Diffstat (limited to 'tests/lib/Encryption/DecryptAllTest.php')
-rw-r--r-- | tests/lib/Encryption/DecryptAllTest.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php index e2c76db7ed9..3a16327ac18 100644 --- a/tests/lib/Encryption/DecryptAllTest.php +++ b/tests/lib/Encryption/DecryptAllTest.php @@ -21,7 +21,6 @@ namespace Test\Encryption; - use OC\Encryption\DecryptAll; use OC\Encryption\Exceptions\DecryptionFailedException; use OC\Encryption\Manager; @@ -33,7 +32,6 @@ use OCP\UserInterface; use Symfony\Component\Console\Formatter\OutputFormatterInterface; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; use Test\TestCase; @@ -109,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 { @@ -168,7 +165,6 @@ class DecryptAllTest extends TestCase { * @param bool $success */ public function testPrepareEncryptionModules($success) { - $user = 'user1'; $dummyEncryptionModule = $this->getMockBuilder('OCP\Encryption\IEncryptionModule') @@ -179,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', @@ -285,7 +283,7 @@ class DecryptAllTest extends TestCase { $this->view->expects($this->any())->method('is_dir') ->willReturnCallback( - function($path) { + function ($path) { if ($path === '/user1/files/foo') { return true; } @@ -307,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 */ @@ -381,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()) @@ -396,5 +394,4 @@ class DecryptAllTest extends TestCase { $this->invokePrivate($instance, 'decryptFile', [$path]) ); } - } |