diff options
Diffstat (limited to 'tests/lib/Encryption')
-rw-r--r-- | tests/lib/Encryption/DecryptAllTest.php | 6 | ||||
-rw-r--r-- | tests/lib/Encryption/Keys/StorageTest.php | 2 | ||||
-rw-r--r-- | tests/lib/Encryption/ManagerTest.php | 6 | ||||
-rw-r--r-- | tests/lib/Encryption/UtilTest.php | 3 |
4 files changed, 10 insertions, 7 deletions
diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php index 7385ff03785..fc8600b9fc6 100644 --- a/tests/lib/Encryption/DecryptAllTest.php +++ b/tests/lib/Encryption/DecryptAllTest.php @@ -217,7 +217,7 @@ class DecryptAllTest extends TestCase { ]; $instance->expects($this->exactly(2)) ->method('decryptUsersFiles') - ->willReturnCallback(function ($user) use (&$calls) { + ->willReturnCallback(function ($user) use (&$calls): void { $expected = array_shift($calls); $this->assertEquals($expected, $user); }); @@ -297,7 +297,7 @@ class DecryptAllTest extends TestCase { ]; $instance->expects($this->exactly(2)) ->method('decryptFile') - ->willReturnCallback(function ($path) use (&$calls) { + ->willReturnCallback(function ($path) use (&$calls): void { $expected = array_shift($calls); $this->assertEquals($expected, $path); }); @@ -387,7 +387,7 @@ class DecryptAllTest extends TestCase { $this->view->expects($this->once()) ->method('copy') ->with($path, $path . '.decrypted.42') - ->willReturnCallback(function () { + ->willReturnCallback(function (): void { throw new DecryptionFailedException(); }); diff --git a/tests/lib/Encryption/Keys/StorageTest.php b/tests/lib/Encryption/Keys/StorageTest.php index bc79c5771ca..348b0ecf10d 100644 --- a/tests/lib/Encryption/Keys/StorageTest.php +++ b/tests/lib/Encryption/Keys/StorageTest.php @@ -589,7 +589,7 @@ class StorageTest extends TestCase { 'user1/files_encryption/backup/test.encryptionModule.1234567', ]; $this->view->expects($this->exactly(2))->method('mkdir') - ->willReturnCallback(function ($path) use (&$calls) { + ->willReturnCallback(function ($path) use (&$calls): void { $expected = array_shift($calls); $this->assertEquals($expected, $path); }); diff --git a/tests/lib/Encryption/ManagerTest.php b/tests/lib/Encryption/ManagerTest.php index 8dd602349b6..c268540d8cd 100644 --- a/tests/lib/Encryption/ManagerTest.php +++ b/tests/lib/Encryption/ManagerTest.php @@ -6,6 +6,8 @@ */ namespace Test\Encryption; +use OC\Encryption\Exceptions\ModuleAlreadyExistsException; +use OC\Encryption\Exceptions\ModuleDoesNotExistsException; use OC\Encryption\Manager; use OC\Encryption\Util; use OC\Files\View; @@ -88,7 +90,7 @@ class ManagerTest extends TestCase { * @depends testModuleRegistration */ public function testModuleReRegistration($manager): void { - $this->expectException(\OC\Encryption\Exceptions\ModuleAlreadyExistsException::class); + $this->expectException(ModuleAlreadyExistsException::class); $this->expectExceptionMessage('Id "ID0" already used by encryption module "TestDummyModule0"'); $this->addNewEncryptionModule($manager, 0); @@ -105,7 +107,7 @@ class ManagerTest extends TestCase { public function testGetEncryptionModuleUnknown(): void { - $this->expectException(\OC\Encryption\Exceptions\ModuleDoesNotExistsException::class); + $this->expectException(ModuleDoesNotExistsException::class); $this->expectExceptionMessage('Module with ID: unknown does not exist.'); $this->config->expects($this->any())->method('getAppValue')->willReturn(true); diff --git a/tests/lib/Encryption/UtilTest.php b/tests/lib/Encryption/UtilTest.php index 68989c55fb0..6f637bdac40 100644 --- a/tests/lib/Encryption/UtilTest.php +++ b/tests/lib/Encryption/UtilTest.php @@ -6,6 +6,7 @@ */ namespace Test\Encryption; +use OC\Encryption\Exceptions\EncryptionHeaderKeyExistsException; use OC\Encryption\Util; use OC\Files\View; use OCP\Encryption\IEncryptionModule; @@ -91,7 +92,7 @@ class UtilTest extends TestCase { public function testCreateHeaderFailed(): void { - $this->expectException(\OC\Encryption\Exceptions\EncryptionHeaderKeyExistsException::class); + $this->expectException(EncryptionHeaderKeyExistsException::class); $header = ['header1' => 1, 'header2' => 2, 'oc_encryption_module' => 'foo']; |