1.20.x file.test FileUnitTestCase::testMimeTypeMappings()

Regression tests for core issue https://www.drupal.org/node/1239376.

File

modules/file/tests/file.test, line 2002
Tests for file.module.

Class

FileUnitTestCase
Tests basic file entity functionality.

Code

function testMimeTypeMappings() {
  $tests = array(
    'public://test.ogg' => 'audio/ogg',
    'public://test.mkv' => 'video/x-m4v',
    'public://test.mka' => 'audio/x-matroska',
    'public://test.mkv' => 'video/x-matroska',
    'public://test.webp' => 'image/webp',
  );
  foreach ($tests as $input => $expected) {
    $this->assertEqual(file_get_mimetype($input), $expected);
  }
}