Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-10-09 19:16:36 +0300
committerVincent Petry <pvince81@owncloud.com>2015-10-09 19:16:36 +0300
commit8098c06e708ba24a5beccd7a85572c7990c9a3f5 (patch)
treeffff07cfc6909afe090ae798439d94b827740a3c /tests
parent18ad60380cdd5c5e346f6b2a8dfbef0a204e00b2 (diff)
Do not update mime types for folders with extension
Some folders might have an extension like "test.conf". This fix prevents to overwrite the folder's mime type with another mime type while running the mimetype repair step.
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/repair/repairmimetypes.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/repair/repairmimetypes.php b/tests/lib/repair/repairmimetypes.php
index 0288a476ede..a0697776e73 100644
--- a/tests/lib/repair/repairmimetypes.php
+++ b/tests/lib/repair/repairmimetypes.php
@@ -514,5 +514,22 @@ class RepairMimeTypes extends \Test\TestCase {
$this->renameMimeTypes($currentMimeTypes, $fixedMimeTypes);
}
+
+ /**
+ * Test that mime type renaming does not affect folders
+ */
+ public function testDoNotChangeFolderMimeType() {
+ $currentMimeTypes = [
+ ['test.conf', 'httpd/unix-directory'],
+ ['test.cnf', 'httpd/unix-directory'],
+ ];
+
+ $fixedMimeTypes = [
+ ['test.conf', 'httpd/unix-directory'],
+ ['test.cnf', 'httpd/unix-directory'],
+ ];
+
+ $this->renameMimeTypes($currentMimeTypes, $fixedMimeTypes);
+ }
}