summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-06-18 17:40:38 +0200
committerVincent Petry <pvince81@owncloud.com>2015-06-18 17:40:38 +0200
commite15dd783ab86c0c65ec626685d59fff0128f3aca (patch)
tree69c52e730119b3ea27086ec8bc41d25563070d53 /tests
parent7a0917e5b2c25b2d90e503e30a3016dbe06a780c (diff)
downloadnextcloud-server-e15dd783ab86c0c65ec626685d59fff0128f3aca.tar.gz
nextcloud-server-e15dd783ab86c0c65ec626685d59fff0128f3aca.zip
Workaround for empty dir deletion for SFTP
Explicitly clear the stat cache after deleting an empty folder to make sure it is properly detected as deleted in subsequent requests. This works around a problem with phpseclib where the folder is properly deleted remotely but the stat cache was not updated.
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/storage/storage.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php
index 2355009c9bf..fcd7f73dcde 100644
--- a/tests/lib/files/storage/storage.php
+++ b/tests/lib/files/storage/storage.php
@@ -380,6 +380,13 @@ abstract class Storage extends \Test\TestCase {
$this->assertFalse($this->instance->file_exists('folder'));
}
+ public function testRmdirEmptyFolder() {
+ $this->assertTrue($this->instance->mkdir('empty'));
+ $this->wait();
+ $this->assertTrue($this->instance->rmdir('empty'));
+ $this->assertFalse($this->instance->file_exists('empty'));
+ }
+
public function testRecursiveUnlink() {
$this->instance->mkdir('folder');
$this->instance->mkdir('folder/bar');