diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-11-25 18:52:14 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-11-25 18:52:14 +0100 |
commit | af7118aa5db19165bcded3c860b3163488d7b6f6 (patch) | |
tree | 31113dbf2f82eea786bb64f82bcb9b365de58e01 | |
parent | 1b0c5e57e5e4042ebb4f0e5956330a908645b61a (diff) | |
download | nextcloud-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.php | 6 |
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')); } |