aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption/tests/Crypto/EncryptionTest.php
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-10-10 12:40:31 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-10-15 10:40:25 +0200
commit1580c8612b01bfa780d1a7372080a27d182fb7dd (patch)
treeb2776d0cd254ac9d6e54828978ce18b702f550d5 /apps/encryption/tests/Crypto/EncryptionTest.php
parent4ff9b3e0ce53227e2be47c4c2dcb1fdc3e540b5f (diff)
downloadnextcloud-server-1580c8612b01bfa780d1a7372080a27d182fb7dd.tar.gz
nextcloud-server-1580c8612b01bfa780d1a7372080a27d182fb7dd.zip
chore(apps): Apply new rector configuration to autouse classes
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/encryption/tests/Crypto/EncryptionTest.php')
-rw-r--r--apps/encryption/tests/Crypto/EncryptionTest.php20
1 files changed, 11 insertions, 9 deletions
diff --git a/apps/encryption/tests/Crypto/EncryptionTest.php b/apps/encryption/tests/Crypto/EncryptionTest.php
index 70c9899cf81..2390012a97a 100644
--- a/apps/encryption/tests/Crypto/EncryptionTest.php
+++ b/apps/encryption/tests/Crypto/EncryptionTest.php
@@ -7,6 +7,8 @@
*/
namespace OCA\Encryption\Tests\Crypto;
+use OC\Encryption\Exceptions\DecryptionFailedException;
+use OC\Files\View;
use OCA\Encryption\Crypto\Crypt;
use OCA\Encryption\Crypto\DecryptAll;
use OCA\Encryption\Crypto\EncryptAll;
@@ -27,22 +29,22 @@ class EncryptionTest extends TestCase {
/** @var Encryption */
private $instance;
- /** @var \OCA\Encryption\KeyManager|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var KeyManager|\PHPUnit\Framework\MockObject\MockObject */
private $keyManagerMock;
- /** @var \OCA\Encryption\Crypto\EncryptAll|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var EncryptAll|\PHPUnit\Framework\MockObject\MockObject */
private $encryptAllMock;
- /** @var \OCA\Encryption\Crypto\DecryptAll|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var DecryptAll|\PHPUnit\Framework\MockObject\MockObject */
private $decryptAllMock;
- /** @var \OCA\Encryption\Session|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var Session|\PHPUnit\Framework\MockObject\MockObject */
private $sessionMock;
- /** @var \OCA\Encryption\Crypto\Crypt|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var Crypt|\PHPUnit\Framework\MockObject\MockObject */
private $cryptMock;
- /** @var \OCA\Encryption\Util|\PHPUnit\Framework\MockObject\MockObject */
+ /** @var Util|\PHPUnit\Framework\MockObject\MockObject */
private $utilMock;
/** @var LoggerInterface|\PHPUnit\Framework\MockObject\MockObject */
@@ -120,7 +122,7 @@ class EncryptionTest extends TestCase {
->method('decryptAllModeActivated')
->willReturn(false);
- $this->expectException(\OCA\Encryption\Exceptions\PublicKeyMissingException::class);
+ $this->expectException(PublicKeyMissingException::class);
$this->instance->begin('/foo/bar', 'user2', 'r', [], ['users' => ['user1', 'user2', 'user3']]);
$this->endTest();
@@ -320,7 +322,7 @@ class EncryptionTest extends TestCase {
->willReturnCallback(function ($path, $version, $view): void {
$this->assertSame('path', $path);
$this->assertSame(2, $version);
- $this->assertTrue($view instanceof \OC\Files\View);
+ $this->assertTrue($view instanceof View);
});
$this->instance->update('path', 'user1', []);
}
@@ -403,7 +405,7 @@ class EncryptionTest extends TestCase {
public function testDecrypt(): void {
- $this->expectException(\OC\Encryption\Exceptions\DecryptionFailedException::class);
+ $this->expectException(DecryptionFailedException::class);
$this->expectExceptionMessage('Cannot decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you.');
$this->instance->decrypt('abc');