aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/Lock
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/Lock')
-rw-r--r--tests/lib/Lock/DBLockingProviderTest.php7
-rw-r--r--tests/lib/Lock/LockingProvider.php21
-rw-r--r--tests/lib/Lock/MemcacheLockingProviderTest.php7
-rw-r--r--tests/lib/Lock/NonCachingDBLockingProviderTest.php3
4 files changed, 22 insertions, 16 deletions
diff --git a/tests/lib/Lock/DBLockingProviderTest.php b/tests/lib/Lock/DBLockingProviderTest.php
index 1216d42f343..32a223b4913 100644
--- a/tests/lib/Lock/DBLockingProviderTest.php
+++ b/tests/lib/Lock/DBLockingProviderTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -27,12 +28,12 @@ class DBLockingProviderTest extends LockingProvider {
protected $instance;
/**
- * @var \OCP\IDBConnection
+ * @var IDBConnection
*/
protected $connection;
/**
- * @var \OCP\AppFramework\Utility\ITimeFactory
+ * @var ITimeFactory
*/
protected $timeFactory;
@@ -50,7 +51,7 @@ class DBLockingProviderTest extends LockingProvider {
}
/**
- * @return \OCP\Lock\ILockingProvider
+ * @return ILockingProvider
*/
protected function getInstance() {
$this->connection = Server::get(IDBConnection::class);
diff --git a/tests/lib/Lock/LockingProvider.php b/tests/lib/Lock/LockingProvider.php
index 2f4407a8659..2827f2c9160 100644
--- a/tests/lib/Lock/LockingProvider.php
+++ b/tests/lib/Lock/LockingProvider.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -13,12 +14,12 @@ use Test\TestCase;
abstract class LockingProvider extends TestCase {
/**
- * @var \OCP\Lock\ILockingProvider
+ * @var ILockingProvider
*/
protected $instance;
/**
- * @return \OCP\Lock\ILockingProvider
+ * @return ILockingProvider
*/
abstract protected function getInstance();
@@ -59,7 +60,7 @@ abstract class LockingProvider extends TestCase {
$this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
}
-
+
public function testDoubleExclusiveLock(): void {
$this->expectException(LockedException::class);
@@ -76,7 +77,7 @@ abstract class LockingProvider extends TestCase {
$this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
}
-
+
public function testExclusiveLockAfterShared(): void {
$this->expectException(LockedException::class);
@@ -150,7 +151,7 @@ abstract class LockingProvider extends TestCase {
}
-
+
public function testSharedLockAfterExclusive(): void {
$this->expectException(LockedException::class);
@@ -197,7 +198,7 @@ abstract class LockingProvider extends TestCase {
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED));
}
-
+
public function testChangeLockToExclusiveDoubleShared(): void {
$this->expectException(LockedException::class);
@@ -206,14 +207,14 @@ abstract class LockingProvider extends TestCase {
$this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
}
-
+
public function testChangeLockToExclusiveNoShared(): void {
$this->expectException(LockedException::class);
$this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
}
-
+
public function testChangeLockToExclusiveFromExclusive(): void {
$this->expectException(LockedException::class);
@@ -221,14 +222,14 @@ abstract class LockingProvider extends TestCase {
$this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE);
}
-
+
public function testChangeLockToSharedNoExclusive(): void {
$this->expectException(LockedException::class);
$this->instance->changeLock('foo', ILockingProvider::LOCK_SHARED);
}
-
+
public function testChangeLockToSharedFromShared(): void {
$this->expectException(LockedException::class);
diff --git a/tests/lib/Lock/MemcacheLockingProviderTest.php b/tests/lib/Lock/MemcacheLockingProviderTest.php
index ec8ded11d1e..ea7b3c26b3c 100644
--- a/tests/lib/Lock/MemcacheLockingProviderTest.php
+++ b/tests/lib/Lock/MemcacheLockingProviderTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-FileCopyrightText: 2016 ownCloud, Inc.
@@ -10,16 +11,18 @@ namespace Test\Lock;
use OC\Lock\MemcacheLockingProvider;
use OC\Memcache\ArrayCache;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\IMemcache;
+use OCP\Lock\ILockingProvider;
use OCP\Server;
class MemcacheLockingProviderTest extends LockingProvider {
/**
- * @var \OCP\IMemcache
+ * @var IMemcache
*/
private $memcache;
/**
- * @return \OCP\Lock\ILockingProvider
+ * @return ILockingProvider
*/
protected function getInstance() {
$this->memcache = new ArrayCache();
diff --git a/tests/lib/Lock/NonCachingDBLockingProviderTest.php b/tests/lib/Lock/NonCachingDBLockingProviderTest.php
index ad4100a3afd..4f05f0ba892 100644
--- a/tests/lib/Lock/NonCachingDBLockingProviderTest.php
+++ b/tests/lib/Lock/NonCachingDBLockingProviderTest.php
@@ -1,4 +1,5 @@
<?php
+
/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
@@ -18,7 +19,7 @@ use OCP\Server;
*/
class NonCachingDBLockingProviderTest extends DBLockingProviderTest {
/**
- * @return \OCP\Lock\ILockingProvider
+ * @return ILockingProvider
*/
protected function getInstance() {
$this->connection = Server::get(IDBConnection::class);