diff options
Diffstat (limited to 'apps/files_sharing/tests/UpdaterTest.php')
-rw-r--r-- | apps/files_sharing/tests/UpdaterTest.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/apps/files_sharing/tests/UpdaterTest.php b/apps/files_sharing/tests/UpdaterTest.php index 62dd7315591..23044e0b2f3 100644 --- a/apps/files_sharing/tests/UpdaterTest.php +++ b/apps/files_sharing/tests/UpdaterTest.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -11,8 +12,11 @@ use OC\Files\Filesystem; use OC\Files\View; use OCA\Files_Sharing\Helper; use OCA\Files_Trashbin\AppInfo\Application; +use OCP\App\IAppManager; use OCP\AppFramework\Bootstrap\IBootContext; use OCP\Constants; +use OCP\IConfig; +use OCP\Server; use OCP\Share\IShare; /** @@ -56,8 +60,9 @@ class UpdaterTest extends TestCase { * that the mount point doesn't end up at the trash bin */ public function testDeleteParentFolder(): void { - $status = \OC::$server->getAppManager()->isEnabledForUser('files_trashbin'); - (new \OC_App())->enable('files_trashbin'); + $appManager = Server::get(IAppManager::class); + $status = $appManager->isEnabledForUser('files_trashbin'); + $appManager->enableApp('files_trashbin'); // register trashbin hooks $trashbinApp = new Application(); @@ -113,13 +118,13 @@ class UpdaterTest extends TestCase { $rootView->deleteAll('files_trashin'); if ($status === false) { - \OC::$server->getAppManager()->disableApp('files_trashbin'); + $appManager->disableApp('files_trashbin'); } Filesystem::getLoader()->removeStorageWrapper('oc_trashbin'); } - public function shareFolderProvider() { + public static function shareFolderProvider() { return [ ['/'], ['/my_shares'], @@ -129,12 +134,12 @@ class UpdaterTest extends TestCase { /** * if a file gets shared the etag for the recipients root should change * - * @dataProvider shareFolderProvider * * @param string $shareFolder share folder to use */ + #[\PHPUnit\Framework\Attributes\DataProvider('shareFolderProvider')] public function testShareFile($shareFolder): void { - $config = \OC::$server->getConfig(); + $config = Server::get(IConfig::class); $oldShareFolder = $config->getSystemValue('share_folder'); $config->setSystemValue('share_folder', $shareFolder); |