diff options
author | Morris Jobke <hey@morrisjobke.de> | 2021-01-20 21:55:16 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2021-01-20 21:55:16 +0100 |
commit | d84e1f1951ac593db4cf2d3da5d8dbe5fdccc26d (patch) | |
tree | 70e023c63486c3cc20aa1ae746c8574abd841fa2 /apps/files_sharing/tests | |
parent | 4c81f5c4ad3942cd8f4b8e9e67b956c0181ac435 (diff) | |
download | nextcloud-server-d84e1f1951ac593db4cf2d3da5d8dbe5fdccc26d.tar.gz nextcloud-server-d84e1f1951ac593db4cf2d3da5d8dbe5fdccc26d.zip |
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 <hey@morrisjobke.de>
Diffstat (limited to 'apps/files_sharing/tests')
-rw-r--r-- | apps/files_sharing/tests/DeleteOrphanedSharesJobTest.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/ExpireSharesJobTest.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/TestCase.php | 4 |
3 files changed, 4 insertions, 4 deletions
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(); |