summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-10-09 18:16:36 +0200
committerVincent Petry <pvince81@owncloud.com>2015-10-12 17:28:32 +0200
commit37747016f2ec7e26a05af3ec68236793789218a5 (patch)
treea66ff1df7f90de6fa52fa6291346451084ab709f /tests
parent07f903a1e3204318346bb0c011ee373e879c5cfb (diff)
downloadnextcloud-server-37747016f2ec7e26a05af3ec68236793789218a5.tar.gz
nextcloud-server-37747016f2ec7e26a05af3ec68236793789218a5.zip
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 40ffc14612b..143c42b8f04 100644
--- a/tests/lib/repair/repairmimetypes.php
+++ b/tests/lib/repair/repairmimetypes.php
@@ -432,6 +432,23 @@ 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);
+ }
}
/**