mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
fix(tests): Disable encryption wrapper when it makes sense
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
9bb0721d66
commit
e35a8ed063
1 changed files with 14 additions and 0 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Reference in a new issue