diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-09 10:22:29 +0300 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-09 11:16:08 +0300 |
commit | 2fbad1ed72bc9ef591a6f35558eb02e7b76ffd1b (patch) | |
tree | a3da09ffec08d6c8abc3bf0fabb7f8c8a1c830f6 /tests/lib/IntegrityCheck | |
parent | 1575bd838f2e938b18b04bcdcc28e2fc24d95c45 (diff) |
Fix (array) indent style to always use one tab
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'tests/lib/IntegrityCheck')
-rw-r--r-- | tests/lib/IntegrityCheck/CheckerTest.php | 522 |
1 files changed, 261 insertions, 261 deletions
diff --git a/tests/lib/IntegrityCheck/CheckerTest.php b/tests/lib/IntegrityCheck/CheckerTest.php index 7d99316f479..98ae3bac9bb 100644 --- a/tests/lib/IntegrityCheck/CheckerTest.php +++ b/tests/lib/IntegrityCheck/CheckerTest.php @@ -170,8 +170,8 @@ class CheckerTest extends TestCase { $expected = [ 'EXCEPTION' => [ - 'class' => 'OC\IntegrityCheck\Exceptions\InvalidSignatureException', - 'message' => 'Signature data not found.', + 'class' => 'OC\IntegrityCheck\Exceptions\InvalidSignatureException', + 'message' => 'Signature data not found.', ], ]; $this->assertSame($expected, $this->checker->verifyAppSignature('SomeApp')); @@ -259,10 +259,10 @@ class CheckerTest extends TestCase { ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ - 'EXCEPTION' => [ - 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', - 'message' => 'Signature could not get verified.', - ], + 'EXCEPTION' => [ + 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', + 'message' => 'Signature could not get verified.', + ], ]; $this->assertEquals($expected, $this->checker->verifyAppSignature('SomeApp')); } @@ -310,20 +310,20 @@ class CheckerTest extends TestCase { $expected = [ 'INVALID_HASH' => [ 'AnotherFile.txt' => [ - 'expected' => '1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112', - 'current' => '7322348ba269c6d5522efe02f424fa3a0da319a7cd9c33142a5afe32a2d9af2da3a411f086fcfc96ff4301ea566f481dba0960c2abeef3594c4d930462f6584c', + 'expected' => '1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112', + 'current' => '7322348ba269c6d5522efe02f424fa3a0da319a7cd9c33142a5afe32a2d9af2da3a411f086fcfc96ff4301ea566f481dba0960c2abeef3594c4d930462f6584c', ], ], 'FILE_MISSING' => [ 'subfolder/file.txt' => [ - 'expected' => '410738545fb623c0a5c8a71f561e48ea69e3ada0981a455e920a5ae9bf17c6831ae654df324f9328ff8453de179276ae51931cca0fa71fe8ccde6c083ca0574b', - 'current' => '', + 'expected' => '410738545fb623c0a5c8a71f561e48ea69e3ada0981a455e920a5ae9bf17c6831ae654df324f9328ff8453de179276ae51931cca0fa71fe8ccde6c083ca0574b', + 'current' => '', ], ], 'EXTRA_FILE' => [ 'UnecessaryFile' => [ - 'expected' => '', - 'current' => 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e', + 'expected' => '', + 'current' => 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e', ], ], @@ -371,24 +371,24 @@ class CheckerTest extends TestCase { $expected = [ - 'INVALID_HASH' => [ - 'AnotherFile.txt' => [ - 'expected' => '1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112', - 'current' => '7322348ba269c6d5522efe02f424fa3a0da319a7cd9c33142a5afe32a2d9af2da3a411f086fcfc96ff4301ea566f481dba0960c2abeef3594c4d930462f6584c', - ], + 'INVALID_HASH' => [ + 'AnotherFile.txt' => [ + 'expected' => '1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112', + 'current' => '7322348ba269c6d5522efe02f424fa3a0da319a7cd9c33142a5afe32a2d9af2da3a411f086fcfc96ff4301ea566f481dba0960c2abeef3594c4d930462f6584c', ], - 'FILE_MISSING' => [ - 'subfolder/file.txt' => [ - 'expected' => '410738545fb623c0a5c8a71f561e48ea69e3ada0981a455e920a5ae9bf17c6831ae654df324f9328ff8453de179276ae51931cca0fa71fe8ccde6c083ca0574b', - 'current' => '', - ], + ], + 'FILE_MISSING' => [ + 'subfolder/file.txt' => [ + 'expected' => '410738545fb623c0a5c8a71f561e48ea69e3ada0981a455e920a5ae9bf17c6831ae654df324f9328ff8453de179276ae51931cca0fa71fe8ccde6c083ca0574b', + 'current' => '', ], - 'EXTRA_FILE' => [ - 'UnecessaryFile' => [ - 'expected' => '', - 'current' => 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e', - ], + ], + 'EXTRA_FILE' => [ + 'UnecessaryFile' => [ + 'expected' => '', + 'current' => 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e', ], + ], ]; $this->assertSame($expected, $this->checker->verifyAppSignature('SomeApp', \OC::$SERVERROOT . '/tests/data/integritycheck/appWithInvalidData/')); @@ -432,10 +432,10 @@ class CheckerTest extends TestCase { ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ - 'EXCEPTION' => [ - 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', - 'message' => 'Certificate is not valid for required scope. (Requested: SomeApp, current: CN=AnotherScope)', - ], + 'EXCEPTION' => [ + 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', + 'message' => 'Certificate is not valid for required scope. (Requested: SomeApp, current: CN=AnotherScope)', + ], ]; $this->assertSame($expected, $this->checker->verifyAppSignature('SomeApp')); } @@ -781,215 +781,215 @@ class CheckerTest extends TestCase { ->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', - ]); + '_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', + ]); $this->mimeTypeDetector ->expects($this->once()) ->method('getAllAliases') ->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/test' => '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', - ]); + '_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/test' => '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', + ]); $this->environmentHelper ->expects($this->any()) @@ -1101,10 +1101,10 @@ class CheckerTest extends TestCase { ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ - 'EXCEPTION' => [ - 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', - 'message' => 'Signature could not get verified.', - ] + 'EXCEPTION' => [ + 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', + 'message' => 'Signature could not get verified.', + ] ]; $this->assertSame($expected, $this->checker->verifyCoreSignature()); } @@ -1148,24 +1148,24 @@ class CheckerTest extends TestCase { ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ - 'INVALID_HASH' => [ - 'AnotherFile.txt' => [ - 'expected' => '1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112', - 'current' => '7322348ba269c6d5522efe02f424fa3a0da319a7cd9c33142a5afe32a2d9af2da3a411f086fcfc96ff4301ea566f481dba0960c2abeef3594c4d930462f6584c', - ], + 'INVALID_HASH' => [ + 'AnotherFile.txt' => [ + 'expected' => '1570ca9420e37629de4328f48c51da29840ddeaa03ae733da4bf1d854b8364f594aac560601270f9e1797ed4cd57c1aea87bf44cf4245295c94f2e935a2f0112', + 'current' => '7322348ba269c6d5522efe02f424fa3a0da319a7cd9c33142a5afe32a2d9af2da3a411f086fcfc96ff4301ea566f481dba0960c2abeef3594c4d930462f6584c', ], - 'FILE_MISSING' => [ - 'subfolder/file.txt' => [ - 'expected' => '410738545fb623c0a5c8a71f561e48ea69e3ada0981a455e920a5ae9bf17c6831ae654df324f9328ff8453de179276ae51931cca0fa71fe8ccde6c083ca0574b', - 'current' => '', - ], + ], + 'FILE_MISSING' => [ + 'subfolder/file.txt' => [ + 'expected' => '410738545fb623c0a5c8a71f561e48ea69e3ada0981a455e920a5ae9bf17c6831ae654df324f9328ff8453de179276ae51931cca0fa71fe8ccde6c083ca0574b', + 'current' => '', ], - 'EXTRA_FILE' => [ - 'UnecessaryFile' => [ - 'expected' => '', - 'current' => 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e', - ], + ], + 'EXTRA_FILE' => [ + 'UnecessaryFile' => [ + 'expected' => '', + 'current' => 'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e', ], + ], ]; $this->assertSame($expected, $this->checker->verifyCoreSignature()); @@ -1210,10 +1210,10 @@ class CheckerTest extends TestCase { ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ - 'EXCEPTION' => [ - 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', - 'message' => 'Certificate is not valid.', - ] + 'EXCEPTION' => [ + 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', + 'message' => 'Certificate is not valid.', + ] ]; $this->assertSame($expected, $this->checker->verifyCoreSignature()); } @@ -1257,10 +1257,10 @@ class CheckerTest extends TestCase { ->willReturn(file_get_contents(__DIR__ .'/../../data/integritycheck/root.crt')); $expected = [ - 'EXCEPTION' => [ - 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', - 'message' => 'Certificate is not valid for required scope. (Requested: core, current: CN=SomeApp)', - ] + 'EXCEPTION' => [ + 'class' => 'OC\\IntegrityCheck\\Exceptions\\InvalidSignatureException', + 'message' => 'Certificate is not valid for required scope. (Requested: core, current: CN=SomeApp)', + ] ]; $this->assertSame($expected, $this->checker->verifyCoreSignature()); } |