From d84e1f1951ac593db4cf2d3da5d8dbe5fdccc26d Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 20 Jan 2021 21:55:16 +0100 Subject: Re-use fetched dependencies in lib/base.php Reduces calls to DI container by reusing already fetched dependencies. For status.php it went from 355 to 344. Signed-off-by: Morris Jobke --- apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php | 2 +- apps/files_sharing/tests/ExpireSharesJobTest.php | 2 +- apps/files_sharing/tests/TestCase.php | 4 ++-- apps/files_trashbin/tests/TrashbinTest.php | 2 +- apps/files_versions/tests/VersioningTest.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'apps') diff --git a/apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php b/apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php index 40efb20e25d..ceec8eee67e 100644 --- a/apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php +++ b/apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php @@ -92,7 +92,7 @@ class DeleteOrphanedSharesJobTest extends \Test\TestCase { $userManager->createUser($this->user1, 'pass'); $userManager->createUser($this->user2, 'pass'); - \OC::registerShareHooks(); + \OC::registerShareHooks(\OC::$server->getSystemConfig()); $this->job = new DeleteOrphanedSharesJob(); } diff --git a/apps/files_sharing/tests/ExpireSharesJobTest.php b/apps/files_sharing/tests/ExpireSharesJobTest.php index 116cc2a27dd..781f58a2c31 100644 --- a/apps/files_sharing/tests/ExpireSharesJobTest.php +++ b/apps/files_sharing/tests/ExpireSharesJobTest.php @@ -65,7 +65,7 @@ class ExpireSharesJobTest extends \Test\TestCase { $userManager->createUser($this->user1, 'longrandompassword'); $userManager->createUser($this->user2, 'longrandompassword'); - \OC::registerShareHooks(); + \OC::registerShareHooks(\OC::$server->getSystemConfig()); $this->job = new ExpireSharesJob(\OC::$server->get(ITimeFactory::class), \OC::$server->get(IManager::class), $this->connection); } diff --git a/apps/files_sharing/tests/TestCase.php b/apps/files_sharing/tests/TestCase.php index 7f09cde0ca8..f8966e3a83f 100644 --- a/apps/files_sharing/tests/TestCase.php +++ b/apps/files_sharing/tests/TestCase.php @@ -73,14 +73,14 @@ abstract class TestCase extends \Test\TestCase { parent::setUpBeforeClass(); new Application(); - + // reset backend \OC_User::clearBackends(); \OC::$server->getGroupManager()->clearBackends(); // clear share hooks \OC_Hook::clear('OCP\\Share'); - \OC::registerShareHooks(); + \OC::registerShareHooks(\OC::$server->getSystemConfig()); // create users $backend = new \Test\Util\User\Dummy(); diff --git a/apps/files_trashbin/tests/TrashbinTest.php b/apps/files_trashbin/tests/TrashbinTest.php index 9265f5ec06a..76da2841e97 100644 --- a/apps/files_trashbin/tests/TrashbinTest.php +++ b/apps/files_trashbin/tests/TrashbinTest.php @@ -72,7 +72,7 @@ class TrashbinTest extends \Test\TestCase { // clear share hooks \OC_Hook::clear('OCP\\Share'); - \OC::registerShareHooks(); + \OC::registerShareHooks(\OC::$server->getSystemConfig()); // init files sharing new Application(); diff --git a/apps/files_versions/tests/VersioningTest.php b/apps/files_versions/tests/VersioningTest.php index d18a7767707..7a6802a1d0d 100644 --- a/apps/files_versions/tests/VersioningTest.php +++ b/apps/files_versions/tests/VersioningTest.php @@ -100,7 +100,7 @@ class VersioningTest extends \Test\TestCase { // clear hooks \OC_Hook::clear(); - \OC::registerShareHooks(); + \OC::registerShareHooks(\OC::$server->getSystemConfig()); \OCA\Files_Versions\Hooks::connectHooks(); self::loginHelper(self::TEST_VERSIONS_USER); -- cgit v1.2.3