diff options
author | Robin Appelman <robin@icewind.nl> | 2022-02-23 18:29:08 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-03-04 16:29:59 +0100 |
commit | 1c468129afa2b2ec4a370a879f8eaffd22768baf (patch) | |
tree | 1c096e8c0a62371965104684e1f1bf2ef55eb2d4 /tests/lib/Cache | |
parent | 5c0fe934988960ece3ac71d5a1dfc8df405413aa (diff) | |
download | nextcloud-server-1c468129afa2b2ec4a370a879f8eaffd22768baf.tar.gz nextcloud-server-1c468129afa2b2ec4a370a879f8eaffd22768baf.zip |
adjust tests to new fs setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/Cache')
-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(); } |