Skip to content

Commit

Permalink
tests: add tests for lock expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
SwikritiT committed Nov 22, 2023
1 parent 2726eb8 commit 4b89b9d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/acceptance/features/apiLocks/lockFiles.feature
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,21 @@ Feature: lock files
| new | exclusive |
| spaces | shared |
| spaces | exclusive |


Scenario Outline: lock expiration
Given using <dav-path-version> DAV path
And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "textfile0.txt"
And user "Alice" has locked file "textfile0.txt" setting the following properties
| lockscope | <lock-scope> |
| timeout | Second-5 |
When the user waits for "5" seconds to expire the lock
Then user "Alice" should be able to upload file "filesForUpload/lorem.txt" to "textfile0.txt"
Examples:
| dav-path-version | lock-scope |
| old | shared |
| old | exclusive |
| new | shared |
| new | exclusive |
| spaces | shared |
| spaces | exclusive |
11 changes: 11 additions & 0 deletions tests/acceptance/features/bootstrap/WebDavLockingContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,17 @@ public function numberOfLockShouldBeReported(int $count, string $file, string $u
);
}

/**
* @When the user waits for :time seconds to expire the lock
*
* @param int $time
*
* @return void
*/
public function waitForCertainSecondsToExpireTheLock(int $time): void {
\sleep($time);
}

/**
* This will run before EVERY scenario.
* It will set the properties for this object.
Expand Down

0 comments on commit 4b89b9d

Please sign in to comment.