aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorAndrew Summers <18727110+summersab@users.noreply.github.com>2023-08-29 18:50:12 -0500
committerGit'Fellow <12234510+solracsf@users.noreply.github.com>2023-11-10 16:51:05 +0100
commit40edb426a3a6857598ff3f447a85e83e32ff0c32 (patch)
treef079cb61f5ae5d4d8eb127273512a4e8911fed01 /tests/lib
parent1d9c482e689a474be8f4010a9a898f16e7a5ae25 (diff)
downloadnextcloud-server-40edb426a3a6857598ff3f447a85e83e32ff0c32.tar.gz
nextcloud-server-40edb426a3a6857598ff3f447a85e83e32ff0c32.zip
Refactor `OC\Server::getRootFolder`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
Diffstat (limited to 'tests/lib')
-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 0ce96102a30..afa428014f8 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,