1 file.test protected FileTestHelper::createFileType($overrides = array())

File

core/modules/file/tests/file.test, line 111
Tests for file.module.

Class

FileTestHelper
Provides methods specifically for testing File module's field handling.

Code

protected function createFileType($overrides = array()) {
  $type = new stdClass();
  $type->type = 'test';
  $type->name = "Test";
  $type->module = 'file';
  $type->description = '';
  $type->mimetypes = array('image/jpeg', 'image/gif', 'image/png', 'image/tiff');

  foreach ($overrides as $k => $v) {
    $type->$k = $v;
  }

  file_type_save($type);
  return $type;
}