aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-09-15 14:13:29 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2024-09-16 18:10:48 +0200
commit801733e5232620932dca14452b3b84dbdad14ed7 (patch)
tree6fcf0585d469710e56457a4a5240fc623b027628 /tests
parentdde0b48c9375ed4f5fd7bac3b03e2b1c75ce9926 (diff)
downloadnextcloud-server-801733e5232620932dca14452b3b84dbdad14ed7.tar.gz
nextcloud-server-801733e5232620932dca14452b3b84dbdad14ed7.zip
fix: Remove OCP\Files\Storage interface deprecated since version 9
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Encryption/DecryptAllTest.php6
-rw-r--r--tests/lib/Encryption/EncryptionWrapperTest.php4
-rw-r--r--tests/lib/Files/Mount/MountPointTest.php4
-rw-r--r--tests/lib/Files/Node/FolderTest.php18
-rw-r--r--tests/lib/Files/Node/NodeTest.php4
-rw-r--r--tests/lib/Lockdown/Filesystem/NullStorageTest.php6
-rw-r--r--tests/lib/Share20/ManagerTest.php26
7 files changed, 34 insertions, 34 deletions
diff --git a/tests/lib/Encryption/DecryptAllTest.php b/tests/lib/Encryption/DecryptAllTest.php
index d073efc8235..6a8453bcaf8 100644
--- a/tests/lib/Encryption/DecryptAllTest.php
+++ b/tests/lib/Encryption/DecryptAllTest.php
@@ -12,7 +12,7 @@ use OC\Encryption\Exceptions\DecryptionFailedException;
use OC\Encryption\Manager;
use OC\Files\FileInfo;
use OC\Files\View;
-use OCP\Files\Storage;
+use OCP\Files\Storage\IStorage;
use OCP\IUserManager;
use OCP\UserInterface;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
@@ -246,11 +246,11 @@ class DecryptAllTest extends TestCase {
->setMethods(['decryptFile'])
->getMock();
- $storage = $this->getMockBuilder(Storage::class)
+ $storage = $this->getMockBuilder(IStorage::class)
->disableOriginalConstructor()->getMock();
- $sharedStorage = $this->getMockBuilder(Storage::class)
+ $sharedStorage = $this->getMockBuilder(IStorage::class)
->disableOriginalConstructor()->getMock();
$sharedStorage->expects($this->once())->method('instanceOfStorage')
diff --git a/tests/lib/Encryption/EncryptionWrapperTest.php b/tests/lib/Encryption/EncryptionWrapperTest.php
index 1ecb9dc89c7..bda8597a9c4 100644
--- a/tests/lib/Encryption/EncryptionWrapperTest.php
+++ b/tests/lib/Encryption/EncryptionWrapperTest.php
@@ -10,7 +10,7 @@ namespace Test\Encryption;
use OC\Encryption\EncryptionWrapper;
use OC\Encryption\Manager;
use OC\Memcache\ArrayCache;
-use OCP\Files\Storage;
+use OCP\Files\Storage\IStorage;
use Psr\Log\LoggerInterface;
use Test\TestCase;
@@ -42,7 +42,7 @@ class EncryptionWrapperTest extends TestCase {
* @dataProvider provideWrapStorage
*/
public function testWrapStorage($expectedWrapped, $wrappedStorages): void {
- $storage = $this->getMockBuilder(Storage::class)
+ $storage = $this->getMockBuilder(IStorage::class)
->disableOriginalConstructor()
->getMock();
diff --git a/tests/lib/Files/Mount/MountPointTest.php b/tests/lib/Files/Mount/MountPointTest.php
index eda61feb249..3de54e315a1 100644
--- a/tests/lib/Files/Mount/MountPointTest.php
+++ b/tests/lib/Files/Mount/MountPointTest.php
@@ -8,14 +8,14 @@
namespace Test\Files\Mount;
use OC\Files\Storage\StorageFactory;
-use OCP\Files\Storage;
+use OCP\Files\Storage\IStorage;
class DummyStorage {
}
class MountPointTest extends \Test\TestCase {
public function testGetStorage(): void {
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$storage->expects($this->once())
->method('getId')
->willReturn(123);
diff --git a/tests/lib/Files/Node/FolderTest.php b/tests/lib/Files/Node/FolderTest.php
index 2e3b6e369d3..5af409a1a93 100644
--- a/tests/lib/Files/Node/FolderTest.php
+++ b/tests/lib/Files/Node/FolderTest.php
@@ -28,7 +28,7 @@ use OCP\Files\Mount\IMountPoint;
use OCP\Files\NotFoundException;
use OCP\Files\Search\ISearchComparison;
use OCP\Files\Search\ISearchOrder;
-use OCP\Files\Storage;
+use OCP\Files\Storage\IStorage;
use PHPUnit\Framework\MockObject\MockObject;
/**
@@ -292,7 +292,7 @@ class FolderTest extends NodeTest {
$root->method('getUser')
->willReturn($this->user);
/** @var Storage\IStorage&MockObject $storage */
- $storage = $this->createMock(Storage\IStorage::class);
+ $storage = $this->createMock(IStorage::class);
$storage->method('getId')->willReturn('test::1');
$cache = new Cache($storage);
@@ -341,7 +341,7 @@ class FolderTest extends NodeTest {
->method('getUser')
->willReturn($this->user);
/** @var \PHPUnit\Framework\MockObject\MockObject|Storage $storage */
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$storage->method('getId')->willReturn('test::2');
$cache = new Cache($storage);
@@ -379,7 +379,7 @@ class FolderTest extends NodeTest {
->getMock();
$root->method('getUser')
->willReturn($this->user);
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$storage->method('getId')->willReturn('test::1');
$cache = new Cache($storage);
@@ -420,10 +420,10 @@ class FolderTest extends NodeTest {
$root->expects($this->any())
->method('getUser')
->willReturn($this->user);
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$storage->method('getId')->willReturn('test::1');
$cache = new Cache($storage);
- $subStorage = $this->createMock(Storage::class);
+ $subStorage = $this->createMock(IStorage::class);
$subStorage->method('getId')->willReturn('test::2');
$subCache = new Cache($subStorage);
$subMount = $this->getMockBuilder(MountPoint::class)->setConstructorArgs([Temporary::class, ''])->getMock();
@@ -922,14 +922,14 @@ class FolderTest extends NodeTest {
$root->expects($this->any())
->method('getUser')
->willReturn($this->user);
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$storage->method('getId')->willReturn('test::1');
$cache = new Cache($storage);
- $subStorage1 = $this->createMock(Storage::class);
+ $subStorage1 = $this->createMock(IStorage::class);
$subStorage1->method('getId')->willReturn('test::2');
$subCache1 = new Cache($subStorage1);
$subMount1 = $this->getMockBuilder(MountPoint::class)->setConstructorArgs([Temporary::class, ''])->getMock();
- $subStorage2 = $this->createMock(Storage::class);
+ $subStorage2 = $this->createMock(IStorage::class);
$subStorage2->method('getId')->willReturn('test::3');
$subCache2 = new Cache($subStorage2);
$subMount2 = $this->getMockBuilder(MountPoint::class)->setConstructorArgs([Temporary::class, ''])->getMock();
diff --git a/tests/lib/Files/Node/NodeTest.php b/tests/lib/Files/Node/NodeTest.php
index d12448a2481..db87aa925d3 100644
--- a/tests/lib/Files/Node/NodeTest.php
+++ b/tests/lib/Files/Node/NodeTest.php
@@ -16,7 +16,7 @@ use OCP\Files\IRootFolder;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\Node;
use OCP\Files\NotFoundException;
-use OCP\Files\Storage;
+use OCP\Files\Storage\IStorage;
use OCP\ICacheFactory;
use OCP\IUser;
use OCP\IUserManager;
@@ -111,7 +111,7 @@ abstract class NodeTest extends \Test\TestCase {
abstract protected function getViewDeleteMethod();
protected function getMockStorage() {
- $storage = $this->getMockBuilder(Storage::class)
+ $storage = $this->getMockBuilder(IStorage::class)
->disableOriginalConstructor()
->getMock();
$storage->expects($this->any())
diff --git a/tests/lib/Lockdown/Filesystem/NullStorageTest.php b/tests/lib/Lockdown/Filesystem/NullStorageTest.php
index 331adeb8a54..cc65221d0a3 100644
--- a/tests/lib/Lockdown/Filesystem/NullStorageTest.php
+++ b/tests/lib/Lockdown/Filesystem/NullStorageTest.php
@@ -11,7 +11,7 @@ use OC\Files\FileInfo;
use OC\ForbiddenException;
use OC\Lockdown\Filesystem\NullCache;
use OC\Lockdown\Filesystem\NullStorage;
-use OCP\Files\Storage;
+use OCP\Files\Storage\IStorage;
use Test\TestCase;
class NullStorageTest extends TestCase {
@@ -196,7 +196,7 @@ class NullStorageTest extends TestCase {
}
public function testCopyFromStorage(): void {
- $sourceStorage = $this->createMock(Storage::class);
+ $sourceStorage = $this->createMock(IStorage::class);
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
@@ -205,7 +205,7 @@ class NullStorageTest extends TestCase {
}
public function testMoveFromStorage(): void {
- $sourceStorage = $this->createMock(Storage::class);
+ $sourceStorage = $this->createMock(IStorage::class);
$this->expectException(ForbiddenException::class);
$this->expectExceptionMessage('This request is not allowed to access the filesystem');
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php
index 2250e28bd13..d0c43b2862c 100644
--- a/tests/lib/Share20/ManagerTest.php
+++ b/tests/lib/Share20/ManagerTest.php
@@ -23,7 +23,7 @@ use OCP\Files\IRootFolder;
use OCP\Files\Mount\IMountManager;
use OCP\Files\Mount\IMountPoint;
use OCP\Files\Node;
-use OCP\Files\Storage;
+use OCP\Files\Storage\IStorage;
use OCP\HintException;
use OCP\IConfig;
use OCP\IDateTimeZone;
@@ -631,7 +631,7 @@ class ManagerTest extends \Test\TestCase {
$file = $this->createMock(File::class);
$node = $this->createMock(Node::class);
- $storage = $this->createMock(Storage\IStorage::class);
+ $storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->with('\OCA\Files_Sharing\External\Storage')
->willReturn(false);
@@ -706,7 +706,7 @@ class ManagerTest extends \Test\TestCase {
$data[] = [$this->createShare(null, IShare::TYPE_GROUP, $limitedPermssions, $group0, $user0, $user0, 17, null, null), 'Cannot increase permissions of path', true];
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $limitedPermssions, null, $user0, $user0, 3, null, null), 'Cannot increase permissions of path', true];
- $nonMovableStorage = $this->createMock(Storage\IStorage::class);
+ $nonMovableStorage = $this->createMock(IStorage::class);
$nonMovableStorage->method('instanceOfStorage')
->with('\OCA\Files_Sharing\External\Storage')
->willReturn(false);
@@ -752,7 +752,7 @@ class ManagerTest extends \Test\TestCase {
$data[] = [$this->createShare(null, IShare::TYPE_LINK, $allPermssions, null, $user0, $user0, 17, null, null), null, false];
- $remoteStorage = $this->createMock(Storage\IStorage::class);
+ $remoteStorage = $this->createMock(IStorage::class);
$remoteStorage->method('instanceOfStorage')
->with('\OCA\Files_Sharing\External\Storage')
->willReturn(true);
@@ -2059,7 +2059,7 @@ class ManagerTest extends \Test\TestCase {
$path->method('getPath')->willReturn('path');
$mount = $this->createMock(IMountPoint::class);
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$mount->method('getStorage')->willReturn($storage);
$storage->method('instanceOfStorage')->with('\OCA\Files_Sharing\ISharedStorage')->willReturn(true);
@@ -2073,7 +2073,7 @@ class ManagerTest extends \Test\TestCase {
$path->method('getPath')->willReturn('path');
$mount = $this->createMock(IMountPoint::class);
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$mount->method('getStorage')->willReturn($storage);
$storage->method('instanceOfStorage')->with('\OCA\Files_Sharing\ISharedStorage')->willReturn(false);
@@ -2221,7 +2221,7 @@ class ManagerTest extends \Test\TestCase {
$shareOwner = $this->createMock(IUser::class);
$shareOwner->method('getUID')->willReturn('shareOwner');
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$path = $this->createMock(File::class);
$path->method('getOwner')->willReturn($shareOwner);
$path->method('getName')->willReturn('target');
@@ -2276,7 +2276,7 @@ class ManagerTest extends \Test\TestCase {
$shareOwner = $this->createMock(IUser::class);
$shareOwner->method('getUID')->willReturn('shareOwner');
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$path = $this->createMock(File::class);
$path->method('getOwner')->willReturn($shareOwner);
$path->method('getName')->willReturn('target');
@@ -2339,7 +2339,7 @@ class ManagerTest extends \Test\TestCase {
$shareOwner = $this->createMock(IUser::class);
$shareOwner->method('getUID')->willReturn('shareOwner');
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$path = $this->createMock(File::class);
$path->method('getOwner')->willReturn($shareOwner);
$path->method('getName')->willReturn('target');
@@ -2459,7 +2459,7 @@ class ManagerTest extends \Test\TestCase {
$shareOwner = $this->createMock(IUser::class);
$shareOwner->method('getUID')->willReturn('shareOwner');
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$path = $this->createMock(File::class);
$path->method('getOwner')->willReturn($shareOwner);
$path->method('getName')->willReturn('target');
@@ -2563,7 +2563,7 @@ class ManagerTest extends \Test\TestCase {
$shareOwner = $this->createMock(IUser::class);
$shareOwner->method('getUID')->willReturn('shareOwner');
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$path = $this->createMock(File::class);
$path->method('getOwner')->willReturn($shareOwner);
$path->method('getName')->willReturn('target');
@@ -2623,12 +2623,12 @@ class ManagerTest extends \Test\TestCase {
$shareOwner = $this->createMock(IUser::class);
$shareOwner->method('getUID')->willReturn('shareOwner');
- $storage = $this->createMock(Storage::class);
+ $storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage')
->willReturn(true);
- $storage2 = $this->createMock(Storage::class);
+ $storage2 = $this->createMock(IStorage::class);
$storage2->method('instanceOfStorage')
->with('OCA\Files_Sharing\External\Storage')
->willReturn(false);