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/TestCase.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/TestCase.php')
-rw-r--r-- | tests/lib/TestCase.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php index b5dcd76faf9..256fb95a85b 100644 --- a/tests/lib/TestCase.php +++ b/tests/lib/TestCase.php @@ -25,14 +25,21 @@ namespace Test; use DOMDocument; use DOMNode; use OC\Command\QueueBus; +use OC\Files\Config\MountProviderCollection; use OC\Files\Filesystem; +use OC\Files\Mount\CacheMountProvider; +use OC\Files\Mount\LocalHomeMountProvider; +use OC\Files\Mount\RootMountProvider; +use OC\Files\SetupManager; use OC\Template\Base; use OCP\Command\IBus; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Defaults; +use OCP\IConfig; use OCP\IDBConnection; use OCP\IL10N; use OCP\Security\ISecureRandom; +use Psr\Log\LoggerInterface; abstract class TestCase extends \PHPUnit\Framework\TestCase { /** @var \OC\Command\QueueBus */ @@ -276,6 +283,22 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase { self::tearDownAfterClassCleanStrayHooks(); self::tearDownAfterClassCleanStrayLocks(); + /** @var SetupManager $setupManager */ + $setupManager = \OC::$server->get(SetupManager::class); + $setupManager->tearDown(); + + /** @var MountProviderCollection $mountProviderCollection */ + $mountProviderCollection = \OC::$server->get(MountProviderCollection::class); + $mountProviderCollection->clearProviders(); + + /** @var IConfig $config */ + $config = \OC::$server->get(IConfig::class); + $mountProviderCollection->registerProvider(new CacheMountProvider($config)); + $mountProviderCollection->registerHomeProvider(new LocalHomeMountProvider()); + $mountProviderCollection->registerRootProvider(new RootMountProvider($config, \OC::$server->get(LoggerInterface::class))); + + $setupManager->setupRoot(); + parent::tearDownAfterClass(); } |