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/HelperStorageTest.php | |
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/HelperStorageTest.php')
-rw-r--r-- | tests/lib/HelperStorageTest.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/lib/HelperStorageTest.php b/tests/lib/HelperStorageTest.php index 4166d606366..6d7ea513d3f 100644 --- a/tests/lib/HelperStorageTest.php +++ b/tests/lib/HelperStorageTest.php @@ -9,6 +9,8 @@ namespace Test; use OC\Files\Storage\Temporary; +use OCP\Files\Mount\IMountManager; +use Test\Traits\UserTrait; /** * Test the storage functions of OC_Helper @@ -16,6 +18,8 @@ use OC\Files\Storage\Temporary; * @group DB */ class HelperStorageTest extends \Test\TestCase { + use UserTrait; + /** @var string */ private $user; /** @var \OC\Files\Storage\Storage */ @@ -27,14 +31,15 @@ class HelperStorageTest extends \Test\TestCase { parent::setUp(); $this->user = $this->getUniqueID('user_'); - \OC_User::useBackend('dummy'); - \OC::$server->getUserManager()->createUser($this->user, $this->user); + $this->createUser($this->user, $this->user); - $this->storage = \OC\Files\Filesystem::getStorage('/'); \OC\Files\Filesystem::tearDown(); \OC_User::setUserId($this->user); \OC\Files\Filesystem::init($this->user, '/' . $this->user . '/files'); - \OC\Files\Filesystem::clearMounts(); + + /** @var IMountManager $manager */ + $manager = \OC::$server->get(IMountManager::class); + $manager->removeMount('/' . $this->user); $this->storageMock = null; } @@ -47,13 +52,8 @@ class HelperStorageTest extends \Test\TestCase { $this->storageMock = null; } \OC\Files\Filesystem::tearDown(); - \OC\Files\Filesystem::mount($this->storage, [], '/'); \OC_User::setUserId(''); - $user = \OC::$server->getUserManager()->get($this->user); - if ($user !== null) { - $user->delete(); - } \OC::$server->getConfig()->deleteAllUserValues($this->user); parent::tearDown(); |