diff options
author | Christian Berendt <berendt@b1-systems.de> | 2013-07-03 18:38:34 +0200 |
---|---|---|
committer | Christian Berendt <berendt@b1-systems.de> | 2013-07-03 18:38:34 +0200 |
commit | 818e2a364a6ff3eae0e463fb117e6f17166b3dd1 (patch) | |
tree | 21eb5246c1ef7e7a5368e76cf284b6bb45d50631 /tests/lib/files | |
parent | 407753f59402c7377db1d1badbf198616a1ac563 (diff) | |
download | nextcloud-server-818e2a364a6ff3eae0e463fb117e6f17166b3dd1.tar.gz nextcloud-server-818e2a364a6ff3eae0e463fb117e6f17166b3dd1.zip |
test moving and copying of subdirectories
Diffstat (limited to 'tests/lib/files')
-rw-r--r-- | tests/lib/files/storage/storage.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index 771fad8c61b..b694a76ddfe 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -197,6 +197,47 @@ 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')); + + $this->assertTrue($this->instance->mkdir('/folder')); + $this->assertTrue($this->instance->mkdir('/folder/sub_a')); + $this->assertTrue($this->instance->mkdir('/folder/sub_b')); + $this->assertTrue($this->instance->mkdir('/folder/sub_b/sub_bb')); + + $this->assertTrue($this->instance->rename('/folder/sub_b', '/folder/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c/sub_bb')); + $this->assertFalse($this->instance->is_dir('/folder/sub_b')); + $this->assertFalse($this->instance->is_dir('/folder/sub_b/sub_bb')); + + $this->assertTrue($this->instance->rename('/folder', '/folder_b')); + $this->assertTrue($this->instance->is_dir('/folder_b')); + $this->assertTrue($this->instance->is_dir('/folder_b/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder_b/sub_c/sub_bb')); + $this->assertFalse($this->instance->is_dir('/folder')); + $this->assertFalse($this->instance->is_dir('/folder/sub_c')); + $this->assertFalse($this->instance->is_dir('/folder/sub_c/sub_bb')); + + $this->assertTrue($this->instance->copy('/folder_b', '/folder')); + $this->assertTrue($this->instance->is_dir('/folder_b')); + $this->assertTrue($this->instance->is_dir('/folder_b/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder_b/sub_c/sub_bb')); + $this->assertTrue($this->instance->is_dir('/folder')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c/sub_bb')); + + $this->assertTrue($this->instance->copy('/folder/sub_c', '/folder/sub_b')); + $this->assertTrue($this->instance->is_dir('/folder/sub_b')); + $this->assertTrue($this->instance->is_dir('/folder/sub_b/sub_bb')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c')); + $this->assertTrue($this->instance->is_dir('/folder/sub_c/sub_bb')); + + $this->assertTrue($this->instance->rmdir('/folder')); + $this->assertFalse($this->instance->is_dir('/folder')); + $this->assertFalse($this->instance->is_dir('/folder/sub_a')); + $this->assertFalse($this->instance->is_dir('/folder/sub_b')); + $this->assertFalse($this->instance->is_dir('/folder/sub_c')); + $this->assertFalse($this->instance->is_dir('/folder/sub_b/sub_bb')); + $this->assertFalse($this->instance->is_dir('/folder/sub_c/sub_bb')); } public function testLocal() { |