summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-06-06 20:47:20 +0200
committerRobin Appelman <icewind@owncloud.com>2013-06-17 17:34:09 +0200
commit63c898c064233d08823e1b18ec7cb20185b1fe05 (patch)
treefc8adb26e0dc3520a0a5d546468d2a63cca91afb /tests/lib
parent6156d71832ee031d8d1f50d8dbff7d0bcfb45541 (diff)
downloadnextcloud-server-63c898c064233d08823e1b18ec7cb20185b1fe05.tar.gz
nextcloud-server-63c898c064233d08823e1b18ec7cb20185b1fe05.zip
Make rmdir recursive for local storage
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/files/storage/storage.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index 0e22f26ae83..fb3e05e66b3 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -258,9 +258,21 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this->assertEquals(file_get_contents($textFile), $content);
}
- public function testTouchCreateFile(){
+ public function testTouchCreateFile() {
$this->assertFalse($this->instance->file_exists('foo'));
$this->instance->touch('foo');
$this->assertTrue($this->instance->file_exists('foo'));
}
+
+ public function testRecursiveRmdir() {
+ $this->instance->mkdir('folder');
+ $this->instance->mkdir('folder/bar');
+ $this->instance->file_put_contents('folder/asd.txt', 'foobar');
+ $this->instance->file_put_contents('folder/bar/foo.txt', 'asd');
+ $this->instance->rmdir('folder');
+ $this->assertFalse($this->instance->file_exists('folder/asd.txt'));
+ $this->assertFalse($this->instance->file_exists('folder/bar/foo.txt'));
+ $this->assertFalse($this->instance->file_exists('folder/bar'));
+ $this->assertFalse($this->instance->file_exists('folder'));
+ }
}