summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-07-01 17:45:01 +0200
committerRobin Appelman <icewind@owncloud.com>2014-05-28 18:16:23 +0200
commit38c1da09768d034ee788f0c6a4284591e914fe4a (patch)
tree5312ae50b7f9299c6a9c54b0aaac774d52a892a2 /tests
parente83b41493fe28eca612f3993a5a1cc3e44e9c145 (diff)
downloadnextcloud-server-38c1da09768d034ee788f0c6a4284591e914fe4a.tar.gz
nextcloud-server-38c1da09768d034ee788f0c6a4284591e914fe4a.zip
fix recursive rename for local storage backend
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/storage/storage.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index 92afd47673a..4a4626fc5c5 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -385,4 +385,20 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this->assertEquals('qwerty', $this->instance->file_get_contents('target/test2.txt'));
$this->assertEquals('bar', $this->instance->file_get_contents('target/subfolder/test.txt'));
}
+
+ public function testRenameOverWriteDirectory() {
+ $this->instance->mkdir('source');
+ $this->instance->file_put_contents('source/test1.txt', 'foo');
+
+ $this->instance->mkdir('target');
+ $this->instance->file_put_contents('target/test1.txt', 'bar');
+ $this->instance->file_put_contents('target/test2.txt', 'bar');
+
+ $this->instance->rename('source', 'target');
+
+ $this->assertFalse($this->instance->file_exists('source'));
+ $this->assertFalse($this->instance->file_exists('source/test1.txt'));
+ $this->assertFalse($this->instance->file_exists('target/test2.txt'));
+ $this->assertEquals('foo', $this->instance->file_get_contents('target/test1.txt'));
+ }
}