summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-02-27 12:20:47 +0100
committerRobin Appelman <icewind@owncloud.com>2012-02-27 12:20:47 +0100
commit63a088c2b1ee77c4d9511df8c7ee77b1d88bb800 (patch)
tree4b2ef142a30d47faace5ee1caf8229161addda22 /tests
parentd8d4420f227588acedb50918a1b794a2c68a7ade (diff)
downloadnextcloud-server-63a088c2b1ee77c4d9511df8c7ee77b1d88bb800.tar.gz
nextcloud-server-63a088c2b1ee77c4d9511df8c7ee77b1d88bb800.zip
more tests for filestorage
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/filestorage.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/filestorage.php b/tests/lib/filestorage.php
index 041d858f18a..5a89c74fe89 100644
--- a/tests/lib/filestorage.php
+++ b/tests/lib/filestorage.php
@@ -105,6 +105,19 @@ abstract class Test_FileStorage extends UnitTestCase {
$this->instance->file_put_contents('/logo-wide.svg',file_get_contents($svgFile,'r'));
$this->assertEqual('image/svg+xml',$this->instance->getMimeType('/logo-wide.svg'));
}
+
+ public function testCopyAndMove(){
+ $textFile=OC::$SERVERROOT.'/tests/data/lorem.txt';
+ $this->instance->file_put_contents('/source.txt',file_get_contents($textFile));
+ $this->instance->copy('/source.txt','/target.txt');
+ $this->assertTrue($this->instance->file_exists('/target.txt'));
+ $this->assertEqual($this->instance->file_get_contents('/source.txt'),$this->instance->file_get_contents('/target.txt'));
+
+ $this->instance->rename('/source.txt','/target2.txt');
+ $this->assertTrue($this->instance->file_exists('/target2.txt'));
+ $this->assertFalse($this->instance->file_exists('/source.txt'));
+ $this->assertEqual(file_get_contents($textFile),$this->instance->file_get_contents('/target.txt'));
+ }
}