You are here

protected function FileEntityTestHelper::createFileType in File Entity (fieldable files) 7.3

Same name and namespace in other branches
  1. 7.2 file_entity.test \FileEntityTestHelper::createFileType()
3 calls to FileEntityTestHelper::createFileType()
FileEntityTypeTestCase::testCreate in ./file_entity.test
Test creating a new type. Basic CRUD.
FileEntityUploadWizardTestCase::testFileEntityUploadWizardStepSkipping in ./file_entity.test
Test skipping each of the file upload wizard steps.
FileEntityUploadWizardTestCase::testFileEntityUploadWizardTypes in ./file_entity.test
Test the file upload wizard type step.

File

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

Class

FileEntityTestHelper
@file Test integration for the file_entity module.

Code

protected function createFileType($overrides = array()) {
  $type = new stdClass();
  $type->type = 'test';
  $type->label = "Test";
  $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;
}