diff options
Diffstat (limited to 'tests/lib/Lock/LockingProvider.php')
-rw-r--r-- | tests/lib/Lock/LockingProvider.php | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/tests/lib/Lock/LockingProvider.php b/tests/lib/Lock/LockingProvider.php index b7e301c55a6..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,9 +60,9 @@ abstract class LockingProvider extends TestCase { $this->assertFalse($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED)); } - + public function testDoubleExclusiveLock(): void { - $this->expectException(\OCP\Lock\LockedException::class); + $this->expectException(LockedException::class); $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); $this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE)); @@ -76,9 +77,9 @@ abstract class LockingProvider extends TestCase { $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); } - + public function testExclusiveLockAfterShared(): void { - $this->expectException(\OCP\Lock\LockedException::class); + $this->expectException(LockedException::class); $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); $this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED)); @@ -150,9 +151,9 @@ abstract class LockingProvider extends TestCase { } - + public function testSharedLockAfterExclusive(): void { - $this->expectException(\OCP\Lock\LockedException::class); + $this->expectException(LockedException::class); $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); $this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE)); @@ -197,40 +198,40 @@ abstract class LockingProvider extends TestCase { $this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_SHARED)); } - + public function testChangeLockToExclusiveDoubleShared(): void { - $this->expectException(\OCP\Lock\LockedException::class); + $this->expectException(LockedException::class); $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); $this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE); } - + public function testChangeLockToExclusiveNoShared(): void { - $this->expectException(\OCP\Lock\LockedException::class); + $this->expectException(LockedException::class); $this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE); } - + public function testChangeLockToExclusiveFromExclusive(): void { - $this->expectException(\OCP\Lock\LockedException::class); + $this->expectException(LockedException::class); $this->instance->acquireLock('foo', ILockingProvider::LOCK_EXCLUSIVE); $this->instance->changeLock('foo', ILockingProvider::LOCK_EXCLUSIVE); } - + public function testChangeLockToSharedNoExclusive(): void { - $this->expectException(\OCP\Lock\LockedException::class); + $this->expectException(LockedException::class); $this->instance->changeLock('foo', ILockingProvider::LOCK_SHARED); } - + public function testChangeLockToSharedFromShared(): void { - $this->expectException(\OCP\Lock\LockedException::class); + $this->expectException(LockedException::class); $this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED); $this->instance->changeLock('foo', ILockingProvider::LOCK_SHARED); |