aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAndrew Summers <18727110+summersab@users.noreply.github.com>2023-08-29 18:16:45 -0500
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-03-15 13:11:33 +0100
commit45eb4a839d57cca6467df5256785e698ac473ef3 (patch)
treea57e2f9e2c95d564f8ee720251df537549938052 /tests
parentdf1cd1ba7e6e1f6e66a2b3229b5c082f1b81162e (diff)
downloadnextcloud-server-45eb4a839d57cca6467df5256785e698ac473ef3.tar.gz
nextcloud-server-45eb4a839d57cca6467df5256785e698ac473ef3.zip
Refactor `OC\Server::getLockingProvider`
Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/Files/ViewTest.php6
-rw-r--r--tests/lib/TestCase.php5
2 files changed, 6 insertions, 5 deletions
diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php
index b9dd49d71fe..c4e17fd3118 100644
--- a/tests/lib/Files/ViewTest.php
+++ b/tests/lib/Files/ViewTest.php
@@ -1388,7 +1388,7 @@ class ViewTest extends \Test\TestCase {
* Test that locks are on mount point paths instead of mount root
*/
public function testLockLocalMountPointPathInsteadOfStorageRoot() {
- $lockingProvider = \OC::$server->getLockingProvider();
+ $lockingProvider = \OC::$server->get(ILockingProvider::class);
$view = new View('/testuser/files/');
$storage = new Temporary([]);
Filesystem::mount($storage, [], '/');
@@ -1418,7 +1418,7 @@ class ViewTest extends \Test\TestCase {
* Test that locks are on mount point paths and also mount root when requested
*/
public function testLockStorageRootButNotLocalMountPoint() {
- $lockingProvider = \OC::$server->getLockingProvider();
+ $lockingProvider = \OC::$server->get(ILockingProvider::class);
$view = new View('/testuser/files/');
$storage = new Temporary([]);
Filesystem::mount($storage, [], '/');
@@ -1448,7 +1448,7 @@ class ViewTest extends \Test\TestCase {
* Test that locks are on mount point paths and also mount root when requested
*/
public function testLockMountPointPathFailReleasesBoth() {
- $lockingProvider = \OC::$server->getLockingProvider();
+ $lockingProvider = \OC::$server->get(ILockingProvider::class);
$view = new View('/testuser/files/');
$storage = new Temporary([]);
Filesystem::mount($storage, [], '/');
diff --git a/tests/lib/TestCase.php b/tests/lib/TestCase.php
index db124bd6823..4ca00901762 100644
--- a/tests/lib/TestCase.php
+++ b/tests/lib/TestCase.php
@@ -38,6 +38,7 @@ use OCP\Defaults;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\IL10N;
+use OCP\Lock\ILockingProvider;
use OCP\Security\ISecureRandom;
use Psr\Log\LoggerInterface;
@@ -197,7 +198,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
// further cleanup
$hookExceptions = \OC_Hook::$thrownExceptions;
\OC_Hook::$thrownExceptions = [];
- \OC::$server->getLockingProvider()->releaseAll();
+ \OC::$server->get(ILockingProvider::class)->releaseAll();
if (!empty($hookExceptions)) {
throw $hookExceptions[0];
}
@@ -418,7 +419,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
* Clean up the list of locks
*/
protected static function tearDownAfterClassCleanStrayLocks() {
- \OC::$server->getLockingProvider()->releaseAll();
+ \OC::$server->get(ILockingProvider::class)->releaseAll();
}
/**