diff options
author | Robin Appelman <robin@icewind.nl> | 2022-03-08 14:50:25 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-08 14:50:25 +0000 |
commit | e8872f01ae850bcbf66220beba44463f68e3d673 (patch) | |
tree | 9b2b1d01992d26368ff456af0440d0a2965308a6 /tests/lib/Cache/FileCacheTest.php | |
parent | 23e8ae15aaea30359a927492155de13c97b311ce (diff) | |
parent | 917c74e214094e321ff96e1aa067ae60d22e2c58 (diff) | |
download | nextcloud-server-e8872f01ae850bcbf66220beba44463f68e3d673.tar.gz nextcloud-server-e8872f01ae850bcbf66220beba44463f68e3d673.zip |
Merge pull request #31431 from nextcloud/fs-setup-manager
Unify/cleanup filesystem setup
Diffstat (limited to 'tests/lib/Cache/FileCacheTest.php')
-rw-r--r-- | tests/lib/Cache/FileCacheTest.php | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tests/lib/Cache/FileCacheTest.php b/tests/lib/Cache/FileCacheTest.php index a800fd005d9..41675b7c461 100644 --- a/tests/lib/Cache/FileCacheTest.php +++ b/tests/lib/Cache/FileCacheTest.php @@ -23,6 +23,7 @@ namespace Test\Cache; use OC\Files\Storage\Local; +use OCP\Files\Mount\IMountManager; use Test\Traits\UserTrait; /** @@ -68,15 +69,12 @@ class FileCacheTest extends TestCache { //clear all proxies and hooks so we can do clean testing \OC_Hook::clear('OC_Filesystem'); - //set up temporary storage - $this->storage = \OC\Files\Filesystem::getStorage('/'); - \OC\Files\Filesystem::clearMounts(); + /** @var IMountManager $manager */ + $manager = \OC::$server->get(IMountManager::class); + $manager->removeMount('/test'); + $storage = new \OC\Files\Storage\Temporary([]); - \OC\Files\Filesystem::mount($storage, [], '/'); - $datadir = str_replace('local::', '', $storage->getId()); - $config = \OC::$server->getConfig(); - $this->datadir = $config->getSystemValue('cachedirectory', \OC::$SERVERROOT.'/data/cache'); - $config->setSystemValue('cachedirectory', $datadir); + \OC\Files\Filesystem::mount($storage, [], '/test/cache'); //set up the users dir $this->rootView = new \OC\Files\View(''); @@ -94,17 +92,12 @@ class FileCacheTest extends TestCache { } \OC_User::setUserId($this->user); - \OC::$server->getConfig()->setSystemValue('cachedirectory', $this->datadir); if ($this->instance) { $this->instance->clear(); $this->instance = null; } - // Restore the original mount point - \OC\Files\Filesystem::clearMounts(); - \OC\Files\Filesystem::mount($this->storage, [], '/'); - parent::tearDown(); } |