You are here

protected function EntityReferenceBrowserTableWidgetTests::createImageMediaBundle in Entity Browser - Table Layout 8

File

tests/src/Kernel/EntityReferenceBrowserTableWidgetTests.php, line 261

Class

EntityReferenceBrowserTableWidgetTests

Namespace

Drupal\entity_browser_table\Kernel

Code

protected function createImageMediaBundle() {
  $entity_type_manager = \Drupal::service('entity_type.manager');
  $media_bundle_storage = $entity_type_manager
    ->getStorage('media_type');
  $media_bundle = $media_bundle_storage
    ->create([
    'id' => 'image',
    'label' => 'Image',
    'description' => 'Description.',
    'type' => 'image',
    'type_configuration' => [
      'source_field' => 'field_media_image',
    ],
  ]);
  $media_bundle
    ->save();
}