Readd test getOnlyDefaultAliases()

Signed-off-by: ACTom <i@actom.me>
This commit is contained in:
ACTom 2020-12-28 13:59:10 +08:00
parent 2d175586b4
commit d9db6ae84e
No known key found for this signature in database
GPG Key ID: C4C9079E407269F9
2 changed files with 117 additions and 3 deletions

View File

@ -102,7 +102,10 @@ OC.MimeTypeList={
"text/x-python": "text/code",
"text/x-shellscript": "text/code",
"web": "text/code",
"application/internet-shortcut": "link"
"application/internet-shortcut": "link",
"application/km": "mindmap",
"application/x-freemind": "mindmap",
"application/vnd.xmind.workbook": "mindmap"
},
files: [
"application",
@ -119,6 +122,7 @@ OC.MimeTypeList={
"image",
"link",
"location",
"mindmap",
"package-x-generic",
"text",
"text-calendar",

View File

@ -776,6 +776,116 @@ class CheckerTest extends TestCase {
->with('integrity.check.disabled', false)
->willReturn(false);
$this->mimeTypeDetector
->expects($this->once())
->method('getOnlyDefaultAliases')
->willReturn(
[
'_comment' => 'Array of mimetype aliases.',
'_comment2' => 'Any changes you make here will be overwritten on an update of Nextcloud.',
'_comment3' => 'Put any custom mappings in a new file mimetypealiases.json in the config/ folder of Nextcloud',
'_comment4' => 'After any change to mimetypealiases.json run:',
'_comment5' => './occ maintenance:mimetype:update-js',
'_comment6' => 'Otherwise your update won\'t propagate through the system.',
'application/coreldraw' => 'image',
'application/epub+zip' => 'text',
'application/font-sfnt' => 'image',
'application/font-woff' => 'image',
'application/gpx+xml' => 'location',
'application/illustrator' => 'image',
'application/javascript' => 'text/code',
'application/json' => 'text/code',
'application/msaccess' => 'file',
'application/msexcel' => 'x-office/spreadsheet',
'application/msonenote' => 'x-office/document',
'application/mspowerpoint' => 'x-office/presentation',
'application/msword' => 'x-office/document',
'application/octet-stream' => 'file',
'application/postscript' => 'image',
'application/rss+xml' => 'application/xml',
'application/vnd.android.package-archive' => 'package/x-generic',
'application/vnd.lotus-wordpro' => 'x-office/document',
'application/vnd.garmin.tcx+xml' => 'location',
'application/vnd.google-earth.kml+xml' => 'location',
'application/vnd.google-earth.kmz' => 'location',
'application/vnd.ms-excel' => 'x-office/spreadsheet',
'application/vnd.ms-excel.addin.macroEnabled.12' => 'x-office/spreadsheet',
'application/vnd.ms-excel.sheet.binary.macroEnabled.12' => 'x-office/spreadsheet',
'application/vnd.ms-excel.sheet.macroEnabled.12' => 'x-office/spreadsheet',
'application/vnd.ms-excel.template.macroEnabled.12' => 'x-office/spreadsheet',
'application/vnd.ms-fontobject' => 'image',
'application/vnd.ms-powerpoint' => 'x-office/presentation',
'application/vnd.ms-powerpoint.addin.macroEnabled.12' => 'x-office/presentation',
'application/vnd.ms-powerpoint.presentation.macroEnabled.12' => 'x-office/presentation',
'application/vnd.ms-powerpoint.slideshow.macroEnabled.12' => 'x-office/presentation',
'application/vnd.ms-powerpoint.template.macroEnabled.12' => 'x-office/presentation',
'application/vnd.ms-visio.drawing.macroEnabled.12' => 'application/vnd.visio',
'application/vnd.ms-visio.drawing' => 'application/vnd.visio',
'application/vnd.ms-visio.stencil.macroEnabled.12' => 'application/vnd.visio',
'application/vnd.ms-visio.stencil' => 'application/vnd.visio',
'application/vnd.ms-visio.template.macroEnabled.12' => 'application/vnd.visio',
'application/vnd.ms-visio.template' => 'application/vnd.visio',
'application/vnd.ms-word.document.macroEnabled.12' => 'x-office/document',
'application/vnd.ms-word.template.macroEnabled.12' => 'x-office/document',
'application/vnd.oasis.opendocument.presentation' => 'x-office/presentation',
'application/vnd.oasis.opendocument.presentation-template' => 'x-office/presentation',
'application/vnd.oasis.opendocument.spreadsheet' => 'x-office/spreadsheet',
'application/vnd.oasis.opendocument.spreadsheet-template' => 'x-office/spreadsheet',
'application/vnd.oasis.opendocument.text' => 'x-office/document',
'application/vnd.oasis.opendocument.text-master' => 'x-office/document',
'application/vnd.oasis.opendocument.text-template' => 'x-office/document',
'application/vnd.oasis.opendocument.text-web' => 'x-office/document',
'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'x-office/presentation',
'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'x-office/presentation',
'application/vnd.openxmlformats-officedocument.presentationml.template' => 'x-office/presentation',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'x-office/spreadsheet',
'application/vnd.openxmlformats-officedocument.spreadsheetml.template' => 'x-office/spreadsheet',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'x-office/document',
'application/vnd.openxmlformats-officedocument.wordprocessingml.template' => 'x-office/document',
'application/vnd.visio' => 'x-office/document',
'application/vnd.wordperfect' => 'x-office/document',
'application/x-7z-compressed' => 'package/x-generic',
'application/x-bzip2' => 'package/x-generic',
'application/x-cbr' => 'text',
'application/x-compressed' => 'package/x-generic',
'application/x-dcraw' => 'image',
'application/x-deb' => 'package/x-generic',
'application/x-fictionbook+xml' => 'text',
'application/x-font' => 'image',
'application/x-gimp' => 'image',
'application/x-gzip' => 'package/x-generic',
'application/x-iwork-keynote-sffkey' => 'x-office/presentation',
'application/x-iwork-numbers-sffnumbers' => 'x-office/spreadsheet',
'application/x-iwork-pages-sffpages' => 'x-office/document',
'application/x-mobipocket-ebook' => 'text',
'application/x-perl' => 'text/code',
'application/x-photoshop' => 'image',
'application/x-php' => 'text/code',
'application/x-rar-compressed' => 'package/x-generic',
'application/x-tar' => 'package/x-generic',
'application/x-tex' => 'text',
'application/xml' => 'text/html',
'application/yaml' => 'text/code',
'application/zip' => 'package/x-generic',
'database' => 'file',
'httpd/unix-directory' => 'dir',
'text/css' => 'text/code',
'text/csv' => 'x-office/spreadsheet',
'text/html' => 'text/code',
'text/x-c' => 'text/code',
'text/x-c++src' => 'text/code',
'text/x-h' => 'text/code',
'text/x-java-source' => 'text/code',
'text/x-ldif' => 'text/code',
'text/x-python' => 'text/code',
'text/x-shellscript' => 'text/code',
'web' => 'text/code',
'application/internet-shortcut' => 'link',
'application/km' => 'mindmap',
'application/x-freemind' => 'mindmap',
'application/vnd.xmind.workbook' => 'mindmap'
]);
$this->mimeTypeDetector
->expects($this->once())
->method('getAllAliases')
@ -893,9 +1003,9 @@ class CheckerTest extends TestCase {
->willReturn(\OC::$SERVERROOT . '/tests/data/integritycheck/mimetypeListModified');
$signatureDataFile = '{
"hashes": {
"mimetypelist.js": "3bd26465f0406f10387d1eb4655870aeaf88a0ed17510e7e9178d03aae7d55cb96968dcde732666ca7c2a75bfb01a41057732eca9659dfa7a46a549e39e14379"
"mimetypelist.js": "23a3fa45757b26795f5cf8f94d9e5bce76fc916288a6458679311b312c167adcf4158ccb2c5c3db791fa0b87703b6c5863afb6c9d790b8cbac5ab3ae8c3418fb"
},
"signature": "tKFPa/gOLSWhHdCvEnpHP4ngtX3ZD+V1OOtuzM+Axhl4wu6lP4Ldjw1cG7c6zpoFCnXZvCvrr8zAdO9lz7sDT4HkcZI0uwOEwSs8pQcf9aFnlKyAxpw2IcQcbgONzxEzL4dOgPaxfrTrT6bMS3FNp46ucfPwh+W5O4YoaUOz7eWSHtyFaba2j1vbEEV6HElqSQmDx1B9lzKn4uVDH5q5ZQw+Va3IuGwX8mCRXHWbuX5puArxCXr2W204/cfVvaWQJbCUR1oFWIpODwkg7eKYR3+6E91U6tBS6x5/kfP7UCsPDf2Zu+wqhpMKeqKF6p7CRTqAJ3ffpAzrI0LWnqjSFluwiGQehAa3FBfaST00ZgD3+iw7VouDTbWekmGC6gvNOYA8cPqNq1fcWyQyzB2iNfsNnb4Dgbo7q4b5W1CjD0YOxs7X5zDwUw6eesAYZev/WsVAfEOpu6pk2I1i6iaGsuLIbAJfKvZlK4jqKeeEDH/2qTfS2Z3nX927YIJ5Uhh44OpHBBbLKD0ti6QbZYDILWid1GgZDP30hx4B09hv/UMpohvKflZLX86SYjH7gfrNAh+R4XxXjPMGiMzeBdmW5ioQEJSDHEvcVW6jn2kMuRM6kq/lHV+SdWsS7qmVwOTyl4hEPirDFfhErkbsWvAwNSulEkxodIETF/w7ssXRQdU=",
"signature": "rqdAbS1evGMhv5vQEhFwDoDgumY1La+xAEgF8TdJjyE1uEjV5442LgnIbolqH5WmGkU4EEjcIJWXEhxbtr7P1EO8WT0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