From e35a8ed0634a7383c90604fc22b56a674014e08a Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Tue, 26 Nov 2024 13:57:55 +0100 Subject: fix(tests): Disable encryption wrapper when it makes sense MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- tests/lib/Files/ViewTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/lib') diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index 0b67826b603..b790c9ed6e8 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -25,6 +25,7 @@ use OCP\Files\ForbiddenException; use OCP\Files\GenericFileException; use OCP\Files\Mount\IMountManager; use OCP\Files\Storage\IStorage; +use OCP\Files\Storage\IStorageFactory; use OCP\IDBConnection; use OCP\IUserManager; use OCP\Lock\ILockingProvider; @@ -1949,6 +1950,8 @@ class ViewTest extends \Test\TestCase { /* Pause trash to avoid the trashbin intercepting rmdir and unlink calls */ Server::get(ITrashManager::class)->pauseTrash(); + /* Same thing with encryption wrapper */ + Server::get(IStorageFactory::class)->removeStorageWrapper('oc_encryption'); Filesystem::mount($storage, [], $this->user . '/'); @@ -2099,6 +2102,8 @@ class ViewTest extends \Test\TestCase { /* Pause trash to avoid the trashbin intercepting rmdir and unlink calls */ Server::get(ITrashManager::class)->pauseTrash(); + /* Same thing with encryption wrapper */ + Server::get(IStorageFactory::class)->removeStorageWrapper('oc_encryption'); Filesystem::mount($storage, [], $this->user . '/'); @@ -2240,6 +2245,9 @@ class ViewTest extends \Test\TestCase { $sourcePath = 'original.txt'; $targetPath = 'target.txt'; + /* Disable encryption wrapper to avoid it intercepting mocked call */ + Server::get(IStorageFactory::class)->removeStorageWrapper('oc_encryption'); + Filesystem::mount($storage, [], $this->user . '/'); $storage->mkdir('files'); $view->file_put_contents($sourcePath, 'meh'); @@ -2293,6 +2301,9 @@ class ViewTest extends \Test\TestCase { $sourcePath = 'original.txt'; $targetPath = 'target.txt'; + /* Disable encryption wrapper to avoid it intercepting mocked call */ + Server::get(IStorageFactory::class)->removeStorageWrapper('oc_encryption'); + Filesystem::mount($storage, [], $this->user . '/'); $storage->mkdir('files'); $view->file_put_contents($sourcePath, 'meh'); @@ -2429,6 +2440,9 @@ class ViewTest extends \Test\TestCase { $sourcePath = 'original.txt'; $targetPath = 'substorage/target.txt'; + /* Disable encryption wrapper to avoid it intercepting mocked call */ + Server::get(IStorageFactory::class)->removeStorageWrapper('oc_encryption'); + Filesystem::mount($storage, [], $this->user . '/'); Filesystem::mount($storage2, [], $this->user . '/files/substorage'); $storage->mkdir('files'); -- cgit v1.2.3