summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-25 18:52:14 +0100
committerVincent Petry <pvince81@owncloud.com>2013-11-25 18:52:14 +0100
commitaf7118aa5db19165bcded3c860b3163488d7b6f6 (patch)
tree31113dbf2f82eea786bb64f82bcb9b365de58e01
parent1b0c5e57e5e4042ebb4f0e5956330a908645b61a (diff)
downloadnextcloud-server-af7118aa5db19165bcded3c860b3163488d7b6f6.tar.gz
nextcloud-server-af7118aa5db19165bcded3c860b3163488d7b6f6.zip
Added unit test for "overwrite file on rename/move"
Also fixed "rename" unit test that was ready the result out of the wrong file.
-rw-r--r--tests/lib/files/storage/storage.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index 6c433e95475..be534635ec9 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -139,6 +139,12 @@ 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('/target2.txt'));
+
+ // move to overwrite
+ $this->instance->rename('/target2.txt', '/target.txt');
+ $this->assertTrue($this->instance->file_exists('/target.txt'));
+ $this->assertFalse($this->instance->file_exists('/target2.txt'));
$this->assertEquals(file_get_contents($textFile), $this->instance->file_get_contents('/target.txt'));
}