]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add APK mimetype tests.
authorNormal Ra <normalraw@gmail.com>
Wed, 13 Aug 2014 11:38:16 +0000 (13:38 +0200)
committerNormal Ra <normalraw@gmail.com>
Wed, 13 Aug 2014 11:38:16 +0000 (13:38 +0200)
tests/lib/repair/repairmimetypes.php

index 3ed19bd55bb6ee8ff8ae805b25254dac74e078c7..7754864a69e768b405225df45e91b3cedbbd9638 100644 (file)
@@ -108,6 +108,33 @@ class TestRepairMimeTypes extends PHPUnit_Framework_TestCase {
                );
        }
 
+       /**
+        * Test renaming the APK mime type
+        */
+       public function testRenameAPKMimeType() {
+               $this->addEntries(
+                       array(
+                               array('test.apk', 'application/octet-stream'),
+                               array('bogus.apk', 'application/vnd.android.package-archive'),
+                               array('bogus2.apk', 'application/wrong'),
+                       )
+               );
+
+               $this->repair->run();
+
+               // force mimetype reload
+               DummyFileCache::clearCachedMimeTypes();
+               $this->storage->getCache()->loadMimeTypes();
+
+               $this->checkEntries(
+                       array(
+                               array('test.apk', 'application/vnd.android.package-archive'),
+                               array('bogus.apk', 'application/vnd.android.package-archive'),
+                               array('bogus2.apk', 'application/vnd.android.package-archive'),
+                       )
+               );
+       }
+
        /**
         * Test renaming and splitting old office mime types when
         * new ones already exist