summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-04-30 14:16:09 +0200
committerRobin Appelman <icewind@owncloud.com>2015-04-30 14:48:42 +0200
commitba7d221cffab4b42871e5926dd6c3e0a2d2b98dc (patch)
tree7036af4364af0e32f80774f6ad226d4762609c46 /tests
parent8119b8b0403b83970f329a8512de980580b013d6 (diff)
downloadnextcloud-server-ba7d221cffab4b42871e5926dd6c3e0a2d2b98dc.tar.gz
nextcloud-server-ba7d221cffab4b42871e5926dd6c3e0a2d2b98dc.zip
allow getting the path from the lockedexception
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/lock/lockingprovider.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/lib/lock/lockingprovider.php b/tests/lib/lock/lockingprovider.php
index e7b8028dc94..08d879da8bb 100644
--- a/tests/lib/lock/lockingprovider.php
+++ b/tests/lib/lock/lockingprovider.php
@@ -22,6 +22,7 @@
namespace Test\Lock;
use OCP\Lock\ILockingProvider;
+use OCP\Lock\LockedException;
use Test\TestCase;
abstract class LockingProvider extends TestCase {
@@ -115,4 +116,22 @@ abstract class LockingProvider extends TestCase {
$this->assertTrue($this->instance->isLocked('foo', ILockingProvider::LOCK_EXCLUSIVE));
$this->instance->acquireLock('foo', ILockingProvider::LOCK_SHARED);
}
+
+ public function testLockedExceptionHasPathForShared() {
+ try {
+ $this->testSharedLockAfterExclusive();
+ $this->fail('Expected locked exception');
+ } catch (LockedException $e) {
+ $this->assertEquals('foo', $e->getPath());
+ }
+ }
+
+ public function testLockedExceptionHasPathForExclusive() {
+ try {
+ $this->testExclusiveLockAfterShared();
+ $this->fail('Expected locked exception');
+ } catch (LockedException $e) {
+ $this->assertEquals('foo', $e->getPath());
+ }
+ }
}