summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-26 06:42:36 -0800
committerVincent Petry <pvince81@owncloud.com>2013-11-26 06:42:36 -0800
commit2653d914d96e40541378d40c0e6c7589c789f401 (patch)
tree09a0c68c38324f90a513951ae5ad157d8e7a4e2c /tests
parentdbd8128c0717941791a48334e0dcd8fec02d1e4a (diff)
parentc3e34676ba0a5467cadc1fd931ed659262705388 (diff)
downloadnextcloud-server-2653d914d96e40541378d40c0e6c7589c789f401.tar.gz
nextcloud-server-2653d914d96e40541378d40c0e6c7589c789f401.zip
Merge pull request #6008 from owncloud/extstorage-smb-webdav-renamefix
Fixed SMB rename function to overwrite target file
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/storage/storage.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index 5b5b8556859..19113f52623 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -139,7 +139,15 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this->instance->rename('/source.txt', '/target2.txt');
$this->assertTrue($this->instance->file_exists('/target2.txt'));
$this->assertFalse($this->instance->file_exists('/source.txt'));
- $this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target.txt'));
+ $this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target2.txt'));
+
+ // move to overwrite
+ $testContents = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+ $this->instance->file_put_contents('/target3.txt', $testContents);
+ $this->instance->rename('/target2.txt', '/target3.txt');
+ $this->assertTrue($this->instance->file_exists('/target3.txt'));
+ $this->assertFalse($this->instance->file_exists('/target2.txt'));
+ $this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target3.txt'));
}
public function testLocal() {