Skip to content

Commit

Permalink
behat test for restoring a file
Browse files Browse the repository at this point in the history
  • Loading branch information
peterprochaska committed Nov 6, 2017
1 parent 15b8a48 commit 45acf52
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
2 changes: 0 additions & 2 deletions tests/integration/features/bootstrap/WebDav.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ public function downloadPublicFileInsideAFolderWithRange($path, $range) {
* @param string $content
*/
public function downloadedContentShouldBe($content) {
die();
PHPUnit_Framework_Assert::assertEquals($content, (string)$this->response->getBody());
}

Expand Down Expand Up @@ -541,7 +540,6 @@ public function userRestoresVersionNrOfFile($user, $versionIndex, $path) {
$fileId = $this->getFileIdForPath($user, $path);
$client = $this->getSabreClient($user);
$versions = array_keys($this->listVersionFolder($user, '/meta/'.$fileId.'/v', 1));
var_dump($versions[1], $this->makeSabrePath($user, $path));die();
$client->request('COPY', $versions[1], null, ['Destination' => $this->makeSabrePath($user, $path)]);
}

Expand Down
48 changes: 24 additions & 24 deletions tests/integration/features/dav-versions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ Feature: dav-versions
Given using api version "2"
Given using new dav path

# Scenario: Upload file and no version is available
# Given user "user0" exists
# And as an "user0"
# When user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
# Then the version folder of file "/davtest.txt" for user "user0" contains "0" elements
#
# Scenario: Upload a file twice and versions are available
# Given user "user0" exists
# And as an "user0"
# When user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
# Then user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
# And the version folder of file "/davtest.txt" for user "user0" contains "1" elements
# And the content length of file "/davtest.txt" with version index "1" for user "user0" in versions folder is "8"
#
# Scenario: Remove a file
# Given user "user0" exists
# And as an "user0"
# And user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
# And user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
# And the version folder of file "/davtest.txt" for user "user0" contains "1" elements
# And user "user0" deletes file "/davtest.txt"
# When user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
# Then the version folder of file "/davtest.txt" for user "user0" contains "0" elements
#
Scenario: Upload file and no version is available
Given user "user0" exists
And as an "user0"
When user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
Then the version folder of file "/davtest.txt" for user "user0" contains "0" elements

Scenario: Upload a file twice and versions are available
Given user "user0" exists
And as an "user0"
When user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
Then user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
And the version folder of file "/davtest.txt" for user "user0" contains "1" elements
And the content length of file "/davtest.txt" with version index "1" for user "user0" in versions folder is "8"

Scenario: Remove a file
Given user "user0" exists
And as an "user0"
And user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
And user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
And the version folder of file "/davtest.txt" for user "user0" contains "1" elements
And user "user0" deletes file "/davtest.txt"
When user "user0" uploads file "data/davtest.txt" to "/davtest.txt"
Then the version folder of file "/davtest.txt" for user "user0" contains "0" elements

Scenario: Restore a file and check, if the content is now in the current file
Given user "user0" exists
And as an "user0"
Expand Down

0 comments on commit 45acf52

Please sign in to comment.