aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-03-15 14:49:59 +0100
committerGitHub <noreply@github.com>2024-03-15 14:49:59 +0100
commit6b4d918dec196d68de5b0aa932178490d8169bc1 (patch)
tree26e7db889e99b1ef0b5147725c04c8cf1e7ce2f0 /tests
parent490533188b2b73b219c363a6245e2764864de96f (diff)
parent3f560ae940a5648572104c1287929b66b196fa4c (diff)
downloadnextcloud-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.php4
-rw-r--r--tests/lib/Preview/Provider.php3
-rw-r--r--tests/lib/Share20/DefaultShareProviderTest.php6
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,