You are here

function FileEntityUnitTestCase::testMimeTypeMappings in File Entity (fieldable files) 7.2

Same name and namespace in other branches
  1. 7.3 file_entity.test \FileEntityUnitTestCase::testMimeTypeMappings()

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

File

./file_entity.test, line 216
Test integration for the file_entity module.

Class

FileEntityUnitTestCase
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);
  }
}