diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-03-15 14:49:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-15 14:49:59 +0100 |
commit | 6b4d918dec196d68de5b0aa932178490d8169bc1 (patch) | |
tree | 26e7db889e99b1ef0b5147725c04c8cf1e7ce2f0 /tests | |
parent | 490533188b2b73b219c363a6245e2764864de96f (diff) | |
parent | 3f560ae940a5648572104c1287929b66b196fa4c (diff) | |
download | nextcloud-server-6b4d918dec196d68de5b0aa932178490d8169bc1.tar.gz nextcloud-server-6b4d918dec196d68de5b0aa932178490d8169bc1.zip |
Merge pull request #40123 from summersab/refactor/OC-Server-getRootFolder
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Preview/BackgroundCleanupJobTest.php | 4 | ||||
-rw-r--r-- | tests/lib/Preview/Provider.php | 3 | ||||
-rw-r--r-- | tests/lib/Share20/DefaultShareProviderTest.php | 6 |
3 files changed, 7 insertions, 6 deletions
diff --git a/tests/lib/Preview/BackgroundCleanupJobTest.php b/tests/lib/Preview/BackgroundCleanupJobTest.php index aa15ea7f562..3b95676e470 100644 --- a/tests/lib/Preview/BackgroundCleanupJobTest.php +++ b/tests/lib/Preview/BackgroundCleanupJobTest.php @@ -84,7 +84,7 @@ class BackgroundCleanupJobTest extends \Test\TestCase { $this->connection = \OC::$server->getDatabaseConnection(); $this->previewManager = \OC::$server->getPreviewManager(); - $this->rootFolder = \OC::$server->getRootFolder(); + $this->rootFolder = \OC::$server->get(IRootFolder::class); $this->mimeTypeLoader = \OC::$server->getMimeTypeLoader(); $this->timeFactory = \OCP\Server::get(ITimeFactory::class); } @@ -102,7 +102,7 @@ class BackgroundCleanupJobTest extends \Test\TestCase { private function getRoot(): Root { return new Root( - \OC::$server->getRootFolder(), + \OC::$server->get(IRootFolder::class), \OC::$server->getSystemConfig() ); } diff --git a/tests/lib/Preview/Provider.php b/tests/lib/Preview/Provider.php index a2e5170c82c..b4b50c873a5 100644 --- a/tests/lib/Preview/Provider.php +++ b/tests/lib/Preview/Provider.php @@ -22,6 +22,7 @@ namespace Test\Preview; use OC\Files\Node\File; +use OCP\Files\IRootFolder; abstract class Provider extends \Test\TestCase { /** @var string */ @@ -137,7 +138,7 @@ abstract class Provider extends \Test\TestCase { * @return bool|\OCP\IImage */ private function getPreview($provider) { - $file = new File(\OC::$server->getRootFolder(), $this->rootView, $this->imgPath); + $file = new File(\OC::$server->get(IRootFolder::class), $this->rootView, $this->imgPath); $preview = $provider->getThumbnail($file, $this->maxWidth, $this->maxHeight, $this->scalingUp); if (get_class($this) === BitmapTest::class && $preview === null) { diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index b658e20d837..e1cdb8530c3 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -2514,7 +2514,7 @@ class DefaultShareProviderTest extends \Test\TestCase { public function testGetSharesInFolder() { $userManager = \OC::$server->getUserManager(); $groupManager = \OC::$server->getGroupManager(); - $rootFolder = \OC::$server->getRootFolder(); + $rootFolder = \OC::$server->get(IRootFolder::class); $provider = new DefaultShareProvider( $this->dbConn, @@ -2612,7 +2612,7 @@ class DefaultShareProviderTest extends \Test\TestCase { public function testGetAccessListNoCurrentAccessRequired() { $userManager = \OC::$server->getUserManager(); $groupManager = \OC::$server->getGroupManager(); - $rootFolder = \OC::$server->getRootFolder(); + $rootFolder = \OC::$server->get(IRootFolder::class); $provider = new DefaultShareProvider( $this->dbConn, @@ -2708,7 +2708,7 @@ class DefaultShareProviderTest extends \Test\TestCase { public function testGetAccessListCurrentAccessRequired() { $userManager = \OC::$server->getUserManager(); $groupManager = \OC::$server->getGroupManager(); - $rootFolder = \OC::$server->getRootFolder(); + $rootFolder = \OC::$server->get(IRootFolder::class); $provider = new DefaultShareProvider( $this->dbConn, |