]> source.dussan.org Git - nextcloud-server.git/commitdiff
test copying and moving files in subdirectories
authorChristian Berendt <berendt@b1-systems.de>
Wed, 3 Jul 2013 16:11:54 +0000 (18:11 +0200)
committerChristian Berendt <berendt@b1-systems.de>
Wed, 3 Jul 2013 16:11:54 +0000 (18:11 +0200)
tests/lib/files/storage/storage.php

index 155a99d8babab2a1a8a5059534fa4f16bd113bc0..4a3a0c40e08bbcb3788268f0434046832325f8b4 100644 (file)
@@ -129,6 +129,16 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
                $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'));
+
+               // check if it's working inside directories as well
+               $this->instance->mkdir('/folder');
+               $this->instance->file_put_contents('/folder/lorem.txt', $sourceText);
+               $this->assertFalse($this->instance->is_dir('/folder/lorem.txt'));
+               $this->assertEquals($sourceText, $this->instance->file_get_contents('/folder/lorem.txt'), 'data returned from file_get_contents is not equal to the source data');
+               $this->instance->file_put_contents('/folder/lorem.txt', '');
+               $this->assertEquals('', $this->instance->file_get_contents('/folder/lorem.txt'), 'file not emptied');
+               $this->instance->rmdir('/folder');
+               $this->assertFalse($this->instance->file_exists('/folder/lorem.txt'));
        }
 
        public function testLocal() {