diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2024-11-26 13:57:55 +0100 |
---|---|---|
committer | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2025-05-13 23:37:52 +0200 |
commit | e35a8ed0634a7383c90604fc22b56a674014e08a (patch) | |
tree | cfc6153af497005eb4d33b5d3a513db242acbb6d /tests/lib/Files/ViewTest.php | |
parent | 9bb0721d66c03b42c461aee6b9e45c4a294bb561 (diff) | |
download | nextcloud-server-e35a8ed0634a7383c90604fc22b56a674014e08a.tar.gz nextcloud-server-e35a8ed0634a7383c90604fc22b56a674014e08a.zip |
fix(tests): Disable encryption wrapper when it makes sense
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'tests/lib/Files/ViewTest.php')
-rw-r--r-- | tests/lib/Files/ViewTest.php | 14 |
1 files changed, 14 insertions, 0 deletions
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'); |