aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-02-27 14:26:52 +0100
committerRobin Appelman <icewind@owncloud.com>2015-02-27 16:39:58 +0100
commitfc027bceb7309fd2f2b6e30cb781d700076669cd (patch)
treef698e4ed1ba03937b96614c907b68dec1a9483d1 /tests/lib
parent8abb80c64277524fadcbea875e2d559c339ef0b1 (diff)
downloadnextcloud-server-fc027bceb7309fd2f2b6e30cb781d700076669cd.tar.gz
nextcloud-server-fc027bceb7309fd2f2b6e30cb781d700076669cd.zip
Fix cache update when doing a rename that overwrites the target
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/files/view.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index 0d88ec1d66a..db39df7d16b 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -962,4 +962,17 @@ class View extends \Test\TestCase {
public function testConstructDirectoryTraversalException($root) {
new \OC\Files\View($root);
}
+
+ public function testRenameOverWrite() {
+ $storage = new Temporary(array());
+ $scanner = $storage->getScanner();
+ $storage->mkdir('sub');
+ $storage->mkdir('foo');
+ $storage->file_put_contents('foo.txt', 'asd');
+ $storage->file_put_contents('foo/bar.txt', 'asd');
+ $scanner->scan('');
+ \OC\Files\Filesystem::mount($storage, array(), '/test/');
+ $view = new \OC\Files\View('');
+ $this->assertTrue($view->rename('/test/foo.txt', '/test/foo/bar.txt'));
+ }
}