aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/Controller/DeletedShareAPIController.php2
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php6
-rw-r--r--apps/files_sharing/lib/Controller/ShareesAPIController.php4
-rw-r--r--apps/files_sharing/lib/Helper.php6
-rw-r--r--apps/files_sharing/lib/Listener/LoadAdditionalListener.php2
-rw-r--r--apps/files_sharing/lib/MountProvider.php2
-rw-r--r--apps/files_sharing/lib/Scanner.php2
-rw-r--r--apps/files_sharing/lib/SharedStorage.php4
-rw-r--r--apps/files_sharing/tests/ApiTest.php2
-rw-r--r--apps/files_sharing/tests/Controller/ShareAPIControllerTest.php72
-rw-r--r--apps/files_sharing/tests/Controller/ShareControllerTest.php2
-rw-r--r--apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php2
-rw-r--r--apps/files_sharing/tests/EncryptedSizePropagationTest.php2
-rw-r--r--apps/files_sharing/tests/External/CacheTest.php2
-rw-r--r--apps/files_sharing/tests/External/ManagerTest.php16
-rw-r--r--apps/files_sharing/tests/External/ScannerTest.php4
-rw-r--r--apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php2
-rw-r--r--apps/files_sharing/tests/MountProviderTest.php12
-rw-r--r--apps/files_sharing/tests/PropagationTestCase.php2
-rw-r--r--apps/files_sharing/tests/SharedStorageTest.php6
-rw-r--r--apps/files_sharing/tests/SizePropagationTest.php2
-rw-r--r--apps/files_sharing/tests/TestCase.php2
-rw-r--r--apps/files_sharing/tests/UnshareChildrenTest.php2
23 files changed, 79 insertions, 79 deletions
diff --git a/apps/files_sharing/lib/Controller/DeletedShareAPIController.php b/apps/files_sharing/lib/Controller/DeletedShareAPIController.php
index b61f9995c02..0741342cf6d 100644
--- a/apps/files_sharing/lib/Controller/DeletedShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/DeletedShareAPIController.php
@@ -226,7 +226,7 @@ class DeletedShareAPIController extends OCSController {
throw new QueryException();
}
- return $this->serverContainer->get('\OCA\Talk\Share\Helper\DeletedShareAPIController');
+ return $this->serverContainer->get(\OCA\Talk\Share\Helper\DeletedShareAPIController::class);
}
/**
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index cf835874677..680bba1c574 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -762,7 +762,7 @@ class ShareAPIController extends OCSController {
$share->setSharedWith($shareWith);
$share->setPermissions($permissions);
} elseif ($shareType === IShare::TYPE_CIRCLE) {
- if (!\OC::$server->getAppManager()->isEnabledForUser('circles') || !class_exists('\OCA\Circles\ShareByCircleProvider')) {
+ if (!\OC::$server->getAppManager()->isEnabledForUser('circles') || !class_exists(\OCA\Circles\ShareByCircleProvider::class)) {
throw new OCSNotFoundException($this->l->t('You cannot share to a Team if the app is not enabled'));
}
@@ -1775,7 +1775,7 @@ class ShareAPIController extends OCSController {
throw new QueryException();
}
- return $this->serverContainer->get('\OCA\Talk\Share\Helper\ShareAPIController');
+ return $this->serverContainer->get(\OCA\Talk\Share\Helper\ShareAPIController::class);
}
/**
@@ -1936,7 +1936,7 @@ class ShareAPIController extends OCSController {
}
if ($share->getShareType() === IShare::TYPE_CIRCLE && \OC::$server->getAppManager()->isEnabledForUser('circles')
- && class_exists('\OCA\Circles\Api\v1\Circles')) {
+ && class_exists(\OCA\Circles\Api\v1\Circles::class)) {
$hasCircleId = (str_ends_with($share->getSharedWith(), ']'));
$shareWithStart = ($hasCircleId ? strrpos($share->getSharedWith(), '[') + 1 : 0);
$shareWithLength = ($hasCircleId ? -1 : strpos($share->getSharedWith(), ' '));
diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php
index f177cb9d1ee..82fa49fef4e 100644
--- a/apps/files_sharing/lib/Controller/ShareesAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php
@@ -163,7 +163,7 @@ class ShareesAPIController extends OCSController {
}
// FIXME: DI
- if (\OC::$server->getAppManager()->isEnabledForUser('circles') && class_exists('\OCA\Circles\ShareByCircleProvider')) {
+ if (\OC::$server->getAppManager()->isEnabledForUser('circles') && class_exists(\OCA\Circles\ShareByCircleProvider::class)) {
$shareTypes[] = IShare::TYPE_CIRCLE;
}
@@ -336,7 +336,7 @@ class ShareesAPIController extends OCSController {
}
// FIXME: DI
- if (\OC::$server->getAppManager()->isEnabledForUser('circles') && class_exists('\OCA\Circles\ShareByCircleProvider')) {
+ if (\OC::$server->getAppManager()->isEnabledForUser('circles') && class_exists(\OCA\Circles\ShareByCircleProvider::class)) {
$shareTypes[] = IShare::TYPE_CIRCLE;
}
diff --git a/apps/files_sharing/lib/Helper.php b/apps/files_sharing/lib/Helper.php
index 8efcb7cae7b..d20d0ffa399 100644
--- a/apps/files_sharing/lib/Helper.php
+++ b/apps/files_sharing/lib/Helper.php
@@ -12,10 +12,10 @@ use OCA\Files_Sharing\AppInfo\Application;
class Helper {
public static function registerHooks() {
- \OCP\Util::connectHook('OC_Filesystem', 'post_rename', '\OCA\Files_Sharing\Updater', 'renameHook');
- \OCP\Util::connectHook('OC_Filesystem', 'post_delete', '\OCA\Files_Sharing\Hooks', 'unshareChildren');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_rename', \OCA\Files_Sharing\Updater::class, 'renameHook');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_delete', \OCA\Files_Sharing\Hooks::class, 'unshareChildren');
- \OCP\Util::connectHook('OC_User', 'post_deleteUser', '\OCA\Files_Sharing\Hooks', 'deleteUser');
+ \OCP\Util::connectHook('OC_User', 'post_deleteUser', \OCA\Files_Sharing\Hooks::class, 'deleteUser');
}
/**
diff --git a/apps/files_sharing/lib/Listener/LoadAdditionalListener.php b/apps/files_sharing/lib/Listener/LoadAdditionalListener.php
index fc6516a83e2..ccd60ec6dfc 100644
--- a/apps/files_sharing/lib/Listener/LoadAdditionalListener.php
+++ b/apps/files_sharing/lib/Listener/LoadAdditionalListener.php
@@ -27,7 +27,7 @@ class LoadAdditionalListener implements IEventListener {
Util::addStyle(Application::APP_ID, 'icons');
$shareManager = \OC::$server->get(IManager::class);
- if ($shareManager->shareApiEnabled() && class_exists('\OCA\Files\App')) {
+ if ($shareManager->shareApiEnabled() && class_exists(\OCA\Files\App::class)) {
Util::addInitScript(Application::APP_ID, 'init');
}
}
diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php
index 5313f40ff6b..368a44afdb0 100644
--- a/apps/files_sharing/lib/MountProvider.php
+++ b/apps/files_sharing/lib/MountProvider.php
@@ -80,7 +80,7 @@ class MountProvider implements IMountProvider {
$ownerViews[$owner] = new View('/' . $parentShare->getShareOwner() . '/files');
}
$mount = new SharedMount(
- '\OCA\Files_Sharing\SharedStorage',
+ \OCA\Files_Sharing\SharedStorage::class,
$mounts,
[
'user' => $user->getUID(),
diff --git a/apps/files_sharing/lib/Scanner.php b/apps/files_sharing/lib/Scanner.php
index 1ff1046bce7..43fd5f0babf 100644
--- a/apps/files_sharing/lib/Scanner.php
+++ b/apps/files_sharing/lib/Scanner.php
@@ -42,7 +42,7 @@ class Scanner extends \OC\Files\Cache\Scanner {
if ($this->sourceScanner) {
return $this->sourceScanner;
}
- if ($this->storage->instanceOfStorage('\OCA\Files_Sharing\SharedStorage')) {
+ if ($this->storage->instanceOfStorage(\OCA\Files_Sharing\SharedStorage::class)) {
/** @var \OC\Files\Storage\Storage $storage */
[$storage] = $this->storage->resolvePath('');
$this->sourceScanner = $storage->getScanner();
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php
index 0a6a068c441..dd383ab45c6 100644
--- a/apps/files_sharing/lib/SharedStorage.php
+++ b/apps/files_sharing/lib/SharedStorage.php
@@ -203,13 +203,13 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements LegacyISha
* @inheritdoc
*/
public function instanceOfStorage($class): bool {
- if ($class === '\OC\Files\Storage\Common' || $class == Common::class) {
+ if ($class === \OC\Files\Storage\Common::class || $class == Common::class) {
return true;
}
if (in_array($class, [
'\OC\Files\Storage\Home',
'\OC\Files\ObjectStore\HomeObjectStoreStorage',
- '\OCP\Files\IHomeStorage',
+ \OCP\Files\IHomeStorage::class,
Home::class,
HomeObjectStoreStorage::class,
IHomeStorage::class
diff --git a/apps/files_sharing/tests/ApiTest.php b/apps/files_sharing/tests/ApiTest.php
index 4d50fb4065e..07ee623c040 100644
--- a/apps/files_sharing/tests/ApiTest.php
+++ b/apps/files_sharing/tests/ApiTest.php
@@ -1264,7 +1264,7 @@ class ApiTest extends TestCase {
$this->shareManager->deleteShare($share);
\OC_Hook::clear('OC_Filesystem', 'post_initMountPoints');
- \OC_Hook::clear('\OCA\Files_Sharing\Tests\ApiTest', 'initTestMountPointsHook');
+ \OC_Hook::clear(\OCA\Files_Sharing\Tests\ApiTest::class, 'initTestMountPointsHook');
}
public function datesProvider() {
diff --git a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
index b45e17eefdc..7e27d40549a 100644
--- a/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareAPIControllerTest.php
@@ -521,7 +521,7 @@ class ShareAPIControllerTest extends TestCase {
public function dataGetShare() {
$data = [];
- $cache = $this->getMockBuilder('OC\Files\Cache\Cache')
+ $cache = $this->getMockBuilder(\OC\Files\Cache\Cache::class)
->disableOriginalConstructor()
->getMock();
$cache->method('getNumericStorageId')->willReturn(101);
@@ -537,7 +537,7 @@ class ShareAPIControllerTest extends TestCase {
$mountPoint = $this->createMock(IMountPoint::class);
$mountPoint->method('getMountType')->willReturn('');
- $file = $this->getMockBuilder('OCP\Files\File')->getMock();
+ $file = $this->getMockBuilder(\OCP\Files\File::class)->getMock();
$file->method('getId')->willReturn(1);
$file->method('getPath')->willReturn('file');
$file->method('getStorage')->willReturn($storage);
@@ -1588,7 +1588,7 @@ class ShareAPIControllerTest extends TestCase {
->with('spreed')
->willReturn(true);
- $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
+ $helper = $this->getMockBuilder(\OCA\Talk\Share\Helper\ShareAPIController::class)
->setMethods(['canAccessShare'])
->getMock();
$helper->method('canAccessShare')
@@ -1596,7 +1596,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn($canAccessShareByHelper);
$this->serverContainer->method('get')
- ->with('\OCA\Talk\Share\Helper\ShareAPIController')
+ ->with(\OCA\Talk\Share\Helper\ShareAPIController::class)
->willReturn($helper);
}
@@ -1939,8 +1939,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$path->method('getStorage')->willReturn($storage);
$this->rootFolder->method('getUserFolder')->with($this->currentUser)->willReturnSelf();
@@ -1963,8 +1963,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$path->method('getStorage')->willReturn($storage);
$this->rootFolder->method('getUserFolder')->with($this->currentUser)->willReturnSelf();
@@ -1988,8 +1988,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$path->method('getStorage')->willReturn($storage);
$this->rootFolder->method('getUserFolder')->with($this->currentUser)->willReturnSelf();
@@ -2012,8 +2012,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$path->method('getStorage')->willReturn($storage);
$this->rootFolder->method('getUserFolder')->with($this->currentUser)->willReturnSelf();
@@ -2051,8 +2051,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$path->method('getStorage')->willReturn($storage);
$this->rootFolder->method('getUserFolder')->with($this->currentUser)->willReturnSelf();
@@ -2090,8 +2090,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$path->method('getStorage')->willReturn($storage);
$this->rootFolder->method('getUserFolder')->with($this->currentUser)->willReturnSelf();
@@ -2136,8 +2136,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$path->method('getStorage')->willReturn($storage);
$path->method('getPath')->willReturn('valid-path');
@@ -2175,8 +2175,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$path->method('getStorage')->willReturn($storage);
$this->rootFolder->method('getUserFolder')->with($this->currentUser)->willReturnSelf();
@@ -2221,8 +2221,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$path->method('getStorage')->willReturn($storage);
$this->rootFolder->method('getUserFolder')->with($this->currentUser)->willReturnSelf();
@@ -2404,7 +2404,7 @@ class ShareAPIControllerTest extends TestCase {
->with('spreed')
->willReturn(true);
- $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
+ $helper = $this->getMockBuilder(\OCA\Talk\Share\Helper\ShareAPIController::class)
->setMethods(['createShare'])
->getMock();
$helper->method('createShare')
@@ -2427,7 +2427,7 @@ class ShareAPIControllerTest extends TestCase {
);
$this->serverContainer->method('get')
- ->with('\OCA\Talk\Share\Helper\ShareAPIController')
+ ->with(\OCA\Talk\Share\Helper\ShareAPIController::class)
->willReturn($helper);
$this->shareManager->method('createShare')
@@ -2520,7 +2520,7 @@ class ShareAPIControllerTest extends TestCase {
->with('spreed')
->willReturn(true);
- $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
+ $helper = $this->getMockBuilder(\OCA\Talk\Share\Helper\ShareAPIController::class)
->setMethods(['createShare'])
->getMock();
$helper->method('createShare')
@@ -2538,7 +2538,7 @@ class ShareAPIControllerTest extends TestCase {
);
$this->serverContainer->method('get')
- ->with('\OCA\Talk\Share\Helper\ShareAPIController')
+ ->with(\OCA\Talk\Share\Helper\ShareAPIController::class)
->willReturn($helper);
$this->shareManager->expects($this->never())->method('createShare');
@@ -2590,8 +2590,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', true],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, true],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$userFolder->method('getStorage')->willReturn($storage);
$path->method('getStorage')->willReturn($storage);
@@ -3779,7 +3779,7 @@ class ShareAPIControllerTest extends TestCase {
$folder->method('getMTime')->willReturn(1234567890);
$fileWithPreview->method('getMTime')->willReturn(1234567890);
- $cache = $this->getMockBuilder('OCP\Files\Cache\ICache')->getMock();
+ $cache = $this->getMockBuilder(\OCP\Files\Cache\ICache::class)->getMock();
$cache->method('getNumericStorageId')->willReturn(100);
$storage = $this->createMock(IStorage::class);
$storage->method('getId')->willReturn('storageId');
@@ -4792,7 +4792,7 @@ class ShareAPIControllerTest extends TestCase {
$mountPoint->method('getMountType')->willReturn('');
$file->method('getMountPoint')->willReturn($mountPoint);
- $cache = $this->getMockBuilder('OCP\Files\Cache\ICache')->getMock();
+ $cache = $this->getMockBuilder(\OCP\Files\Cache\ICache::class)->getMock();
$cache->method('getNumericStorageId')->willReturn(100);
$storage = $this->createMock(IStorage::class);
$storage->method('getId')->willReturn('storageId');
@@ -4941,7 +4941,7 @@ class ShareAPIControllerTest extends TestCase {
->with('spreed')
->willReturn(true);
- $helper = $this->getMockBuilder('\OCA\Talk\Share\Helper\ShareAPIController')
+ $helper = $this->getMockBuilder(\OCA\Talk\Share\Helper\ShareAPIController::class)
->setMethods(['formatShare', 'canAccessShare'])
->getMock();
$helper->method('formatShare')
@@ -4952,7 +4952,7 @@ class ShareAPIControllerTest extends TestCase {
->willReturn(true);
$this->serverContainer->method('get')
- ->with('\OCA\Talk\Share\Helper\ShareAPIController')
+ ->with(\OCA\Talk\Share\Helper\ShareAPIController::class)
->willReturn($helper);
}
@@ -4966,8 +4966,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$userFolder->method('getStorage')->willReturn($storage);
$node->method('getStorage')->willReturn($storage);
@@ -4981,8 +4981,8 @@ class ShareAPIControllerTest extends TestCase {
$storage = $this->createMock(IStorage::class);
$storage->method('instanceOfStorage')
->willReturnMap([
- ['OCA\Files_Sharing\External\Storage', false],
- ['OCA\Files_Sharing\SharedStorage', false],
+ [\OCA\Files_Sharing\External\Storage::class, false],
+ [\OCA\Files_Sharing\SharedStorage::class, false],
]);
$userFolder->method('getStorage')->willReturn($storage);
$node->method('getStorage')->willReturn($storage);
diff --git a/apps/files_sharing/tests/Controller/ShareControllerTest.php b/apps/files_sharing/tests/Controller/ShareControllerTest.php
index 45c0d54c918..3c2420e06f9 100644
--- a/apps/files_sharing/tests/Controller/ShareControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareControllerTest.php
@@ -625,7 +625,7 @@ class ShareControllerTest extends \Test\TestCase {
$owner->method('getDisplayName')->willReturn('ownerDisplay');
$owner->method('getUID')->willReturn('ownerUID');
- $file = $this->getMockBuilder('OCP\Files\File')->getMock();
+ $file = $this->getMockBuilder(\OCP\Files\File::class)->getMock();
$file->method('getName')->willReturn($filename);
$file->method('getMimetype')->willReturn('text/plain');
$file->method('getSize')->willReturn(33);
diff --git a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
index bf02e8114df..525a243e875 100644
--- a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
@@ -350,7 +350,7 @@ class ShareesAPIControllerTest extends TestCase {
$urlGenerator = $this->createMock(IURLGenerator::class);
/** @var MockObject|ShareesAPIController $sharees */
- $sharees = $this->getMockBuilder('\OCA\Files_Sharing\Controller\ShareesAPIController')
+ $sharees = $this->getMockBuilder(\OCA\Files_Sharing\Controller\ShareesAPIController::class)
->setConstructorArgs([
'files_sharing',
$request,
diff --git a/apps/files_sharing/tests/EncryptedSizePropagationTest.php b/apps/files_sharing/tests/EncryptedSizePropagationTest.php
index af2cf379358..657cf9f4b42 100644
--- a/apps/files_sharing/tests/EncryptedSizePropagationTest.php
+++ b/apps/files_sharing/tests/EncryptedSizePropagationTest.php
@@ -18,7 +18,7 @@ class EncryptedSizePropagationTest extends SizePropagationTest {
protected function setupUser($name, $password = '') {
$this->createUser($name, $password);
$tmpFolder = \OC::$server->getTempManager()->getTemporaryFolder();
- $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]);
+ $this->registerMount($name, \OC\Files\Storage\Local::class, '/' . $name, ['datadir' => $tmpFolder]);
$this->config->setAppValue('encryption', 'useMasterKey', '0');
$this->setupForUser($name, $password);
$this->loginWithEncryption($name);
diff --git a/apps/files_sharing/tests/External/CacheTest.php b/apps/files_sharing/tests/External/CacheTest.php
index 139227134c6..7fe73097d72 100644
--- a/apps/files_sharing/tests/External/CacheTest.php
+++ b/apps/files_sharing/tests/External/CacheTest.php
@@ -59,7 +59,7 @@ class CacheTest extends TestCase {
);
$this->remoteUser = $this->getUniqueID('remoteuser');
- $this->storage = $this->getMockBuilder('\OCA\Files_Sharing\External\Storage')
+ $this->storage = $this->getMockBuilder(\OCA\Files_Sharing\External\Storage::class)
->disableOriginalConstructor()
->getMock();
$this->storage
diff --git a/apps/files_sharing/tests/External/ManagerTest.php b/apps/files_sharing/tests/External/ManagerTest.php
index 7302fd307f2..9993f4c6d8f 100644
--- a/apps/files_sharing/tests/External/ManagerTest.php
+++ b/apps/files_sharing/tests/External/ManagerTest.php
@@ -252,7 +252,7 @@ class ManagerTest extends TestCase {
$this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1');
if (!$isGroup) {
- $client = $this->getMockBuilder('OCP\Http\Client\IClient')
+ $client = $this->getMockBuilder(\OCP\Http\Client\IClient::class)
->disableOriginalConstructor()->getMock();
$this->clientService->expects($this->at(0))
->method('newClient')
@@ -308,7 +308,7 @@ class ManagerTest extends TestCase {
$this->assertNotMount('{{TemporaryMountPointName#' . $shareData1['name'] . '}}-1');
if (!$isGroup) {
- $client = $this->getMockBuilder('OCP\Http\Client\IClient')
+ $client = $this->getMockBuilder(\OCP\Http\Client\IClient::class)
->disableOriginalConstructor()->getMock();
$this->clientService->expects($this->at(0))
->method('newClient')
@@ -364,9 +364,9 @@ class ManagerTest extends TestCase {
// no http requests here
$this->manager->removeGroupShares('group1');
} else {
- $client1 = $this->getMockBuilder('OCP\Http\Client\IClient')
+ $client1 = $this->getMockBuilder(\OCP\Http\Client\IClient::class)
->disableOriginalConstructor()->getMock();
- $client2 = $this->getMockBuilder('OCP\Http\Client\IClient')
+ $client2 = $this->getMockBuilder(\OCP\Http\Client\IClient::class)
->disableOriginalConstructor()->getMock();
$this->clientService->expects($this->exactly(2))
->method('newClient')
@@ -728,18 +728,18 @@ class ManagerTest extends TestCase {
private function assertMount($mountPoint) {
$mountPoint = rtrim($mountPoint, '/');
$mount = $this->mountManager->find($this->getFullPath($mountPoint));
- $this->assertInstanceOf('\OCA\Files_Sharing\External\Mount', $mount);
- $this->assertInstanceOf('\OCP\Files\Mount\IMountPoint', $mount);
+ $this->assertInstanceOf(\OCA\Files_Sharing\External\Mount::class, $mount);
+ $this->assertInstanceOf(\OCP\Files\Mount\IMountPoint::class, $mount);
$this->assertEquals($this->getFullPath($mountPoint), rtrim($mount->getMountPoint(), '/'));
$storage = $mount->getStorage();
- $this->assertInstanceOf('\OCA\Files_Sharing\External\Storage', $storage);
+ $this->assertInstanceOf(\OCA\Files_Sharing\External\Storage::class, $storage);
}
private function assertNotMount($mountPoint) {
$mountPoint = rtrim($mountPoint, '/');
try {
$mount = $this->mountManager->find($this->getFullPath($mountPoint));
- $this->assertInstanceOf('\OCP\Files\Mount\IMountPoint', $mount);
+ $this->assertInstanceOf(\OCP\Files\Mount\IMountPoint::class, $mount);
$this->assertNotEquals($this->getFullPath($mountPoint), rtrim($mount->getMountPoint(), '/'));
} catch (NotFoundException $e) {
diff --git a/apps/files_sharing/tests/External/ScannerTest.php b/apps/files_sharing/tests/External/ScannerTest.php
index 7daa5f229d2..1a0077cf04b 100644
--- a/apps/files_sharing/tests/External/ScannerTest.php
+++ b/apps/files_sharing/tests/External/ScannerTest.php
@@ -22,10 +22,10 @@ class ScannerTest extends TestCase {
protected function setUp(): void {
parent::setUp();
- $this->storage = $this->getMockBuilder('\OCA\Files_Sharing\External\Storage')
+ $this->storage = $this->getMockBuilder(\OCA\Files_Sharing\External\Storage::class)
->disableOriginalConstructor()
->getMock();
- $this->cache = $this->getMockBuilder('\OC\Files\Cache\Cache')
+ $this->cache = $this->getMockBuilder(\OC\Files\Cache\Cache::class)
->disableOriginalConstructor()
->getMock();
$this->storage->expects($this->any())
diff --git a/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php b/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php
index 30bae45f520..127d982fb2f 100644
--- a/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php
+++ b/apps/files_sharing/tests/Middleware/OCSShareAPIMiddlewareTest.php
@@ -114,7 +114,7 @@ class OCSShareAPIMiddlewareTest extends \Test\TestCase {
$controller->expects($this->once())->method('cleanup');
}
- $response = $this->getMockBuilder('OCP\AppFramework\Http\Response')
+ $response = $this->getMockBuilder(\OCP\AppFramework\Http\Response::class)
->disableOriginalConstructor()
->getMock();
$this->middleware->afterController($controller, 'foo', $response);
diff --git a/apps/files_sharing/tests/MountProviderTest.php b/apps/files_sharing/tests/MountProviderTest.php
index 2dc5365ae2b..014153f5660 100644
--- a/apps/files_sharing/tests/MountProviderTest.php
+++ b/apps/files_sharing/tests/MountProviderTest.php
@@ -47,7 +47,7 @@ class MountProviderTest extends \Test\TestCase {
$this->config = $this->getMockBuilder(IConfig::class)->getMock();
$this->user = $this->getMockBuilder(IUser::class)->getMock();
- $this->loader = $this->getMockBuilder('OCP\Files\Storage\IStorageFactory')->getMock();
+ $this->loader = $this->getMockBuilder(\OCP\Files\Storage\IStorageFactory::class)->getMock();
$this->shareManager = $this->getMockBuilder(IManager::class)->getMock();
$this->logger = $this->getMockBuilder(LoggerInterface::class)->getMock();
$eventDispatcher = $this->createMock(IEventDispatcher::class);
@@ -169,10 +169,10 @@ class MountProviderTest extends \Test\TestCase {
});
$mounts = $this->provider->getMountsForUser($this->user, $this->loader);
$this->assertCount(4, $mounts);
- $this->assertInstanceOf('OCA\Files_Sharing\SharedMount', $mounts[0]);
- $this->assertInstanceOf('OCA\Files_Sharing\SharedMount', $mounts[1]);
- $this->assertInstanceOf('OCA\Files_Sharing\SharedMount', $mounts[2]);
- $this->assertInstanceOf('OCA\Files_Sharing\SharedMount', $mounts[3]);
+ $this->assertInstanceOf(\OCA\Files_Sharing\SharedMount::class, $mounts[0]);
+ $this->assertInstanceOf(\OCA\Files_Sharing\SharedMount::class, $mounts[1]);
+ $this->assertInstanceOf(\OCA\Files_Sharing\SharedMount::class, $mounts[2]);
+ $this->assertInstanceOf(\OCA\Files_Sharing\SharedMount::class, $mounts[3]);
$mountedShare1 = $mounts[0]->getShare();
$this->assertEquals('2', $mountedShare1->getId());
$this->assertEquals('user2', $mountedShare1->getShareOwner());
@@ -401,7 +401,7 @@ class MountProviderTest extends \Test\TestCase {
foreach ($mounts as $index => $mount) {
$expectedShare = $expectedShares[$index];
- $this->assertInstanceOf('OCA\Files_Sharing\SharedMount', $mount);
+ $this->assertInstanceOf(\OCA\Files_Sharing\SharedMount::class, $mount);
// supershare
$share = $mount->getShare();
diff --git a/apps/files_sharing/tests/PropagationTestCase.php b/apps/files_sharing/tests/PropagationTestCase.php
index dee056f0658..fd463ef0c6f 100644
--- a/apps/files_sharing/tests/PropagationTestCase.php
+++ b/apps/files_sharing/tests/PropagationTestCase.php
@@ -28,7 +28,7 @@ abstract class PropagationTestCase extends TestCase {
\OC_Hook::clear('OC_Filesystem', 'post_write');
\OC_Hook::clear('OC_Filesystem', 'post_delete');
\OC_Hook::clear('OC_Filesystem', 'post_rename');
- \OC_Hook::clear('OCP\Share', 'post_update_permissions');
+ \OC_Hook::clear(\OCP\Share::class, 'post_update_permissions');
parent::tearDown();
}
diff --git a/apps/files_sharing/tests/SharedStorageTest.php b/apps/files_sharing/tests/SharedStorageTest.php
index 49ff97c053a..0af958a5b23 100644
--- a/apps/files_sharing/tests/SharedStorageTest.php
+++ b/apps/files_sharing/tests/SharedStorageTest.php
@@ -417,7 +417,7 @@ class SharedStorageTest extends TestCase {
$this->assertTrue($view->file_exists($this->folder));
[$sharedStorage,] = $view->resolvePath($this->folder);
- $this->assertTrue($sharedStorage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage'));
+ $this->assertTrue($sharedStorage->instanceOfStorage(\OCA\Files_Sharing\ISharedStorage::class));
$sourceStorage = new \OC\Files\Storage\Temporary([]);
$sourceStorage->file_put_contents('foo.txt', 'asd');
@@ -447,7 +447,7 @@ class SharedStorageTest extends TestCase {
$this->assertTrue($view->file_exists($this->folder));
[$sharedStorage,] = $view->resolvePath($this->folder);
- $this->assertTrue($sharedStorage->instanceOfStorage('OCA\Files_Sharing\ISharedStorage'));
+ $this->assertTrue($sharedStorage->instanceOfStorage(\OCA\Files_Sharing\ISharedStorage::class));
$sourceStorage = new \OC\Files\Storage\Temporary([]);
$sourceStorage->file_put_contents('foo.txt', 'asd');
@@ -502,7 +502,7 @@ class SharedStorageTest extends TestCase {
$this->assertTrue($view2->file_exists('/foo (2)'));
$mount = $view2->getMount('/foo');
- $this->assertInstanceOf('\OCA\Files_Sharing\SharedMount', $mount);
+ $this->assertInstanceOf(\OCA\Files_Sharing\SharedMount::class, $mount);
/** @var \OCA\Files_Sharing\SharedStorage $storage */
$storage = $mount->getStorage();
diff --git a/apps/files_sharing/tests/SizePropagationTest.php b/apps/files_sharing/tests/SizePropagationTest.php
index de830c508cd..56057a3722c 100644
--- a/apps/files_sharing/tests/SizePropagationTest.php
+++ b/apps/files_sharing/tests/SizePropagationTest.php
@@ -23,7 +23,7 @@ class SizePropagationTest extends TestCase {
protected function setupUser($name, $password = '') {
$this->createUser($name, $password);
$tmpFolder = \OC::$server->getTempManager()->getTemporaryFolder();
- $this->registerMount($name, '\OC\Files\Storage\Local', '/' . $name, ['datadir' => $tmpFolder]);
+ $this->registerMount($name, \OC\Files\Storage\Local::class, '/' . $name, ['datadir' => $tmpFolder]);
$this->loginAsUser($name);
return new View('/' . $name . '/files');
}
diff --git a/apps/files_sharing/tests/TestCase.php b/apps/files_sharing/tests/TestCase.php
index 4545e67be32..34332d4bdaa 100644
--- a/apps/files_sharing/tests/TestCase.php
+++ b/apps/files_sharing/tests/TestCase.php
@@ -65,7 +65,7 @@ abstract class TestCase extends \Test\TestCase {
\OC::$server->getGroupManager()->clearBackends();
// clear share hooks
- \OC_Hook::clear('OCP\\Share');
+ \OC_Hook::clear(\OCP\Share::class);
\OC::registerShareHooks(\OC::$server->getSystemConfig());
// create users
diff --git a/apps/files_sharing/tests/UnshareChildrenTest.php b/apps/files_sharing/tests/UnshareChildrenTest.php
index e95c1c68ecb..dd84061b9d3 100644
--- a/apps/files_sharing/tests/UnshareChildrenTest.php
+++ b/apps/files_sharing/tests/UnshareChildrenTest.php
@@ -25,7 +25,7 @@ class UnshareChildrenTest extends TestCase {
protected function setUp(): void {
parent::setUp();
- \OCP\Util::connectHook('OC_Filesystem', 'post_delete', '\OCA\Files_Sharing\Hooks', 'unshareChildren');
+ \OCP\Util::connectHook('OC_Filesystem', 'post_delete', \OCA\Files_Sharing\Hooks::class, 'unshareChildren');
$this->folder = self::TEST_FOLDER_NAME;
$this->subfolder = '/subfolder_share_api_test';