You are here

public function FileEntityDealerTest::providerTestFileEntityDealer in Media Migration 8

Data provider for .

Return value

array[] The test cases.

File

tests/src/Kernel/Plugin/FileEntityDealerTest.php, line 124

Class

FileEntityDealerTest
Tests the file entity dealer manager and the plugin instances.

Namespace

Drupal\Tests\media_migration\Kernel\Plugin

Code

public function providerTestFileEntityDealer() {
  return [
    'Audio type, public scheme' => [
      'Type' => 'audio',
      'Scheme' => 'public',
      'Expected plugin class' => Audio::class,
      'Expected type ID base' => 'audio',
      'Expected type ID' => 'audio',
      'Expected type label' => 'Audio',
      'Expected media source plugin ID' => 'audio_file',
      'Expected media source field name' => 'field_media_audio_file',
      'Expected media source field label of the type' => 'Audio file',
    ],
    'Audio type, custom scheme' => [
      'Type' => 'audio',
      'Scheme' => 'custom',
      'Expected plugin class' => Audio::class,
      'Expected type ID base' => 'audio',
      'Expected type ID' => 'audio_custom',
      'Expected type label' => 'Audio (custom)',
      'Expected media source plugin ID' => 'audio_file',
      'Expected media source field name' => 'field_media_audio_file_custom',
      'Expected media source field label of the type' => 'Audio file',
    ],
    'Document type, public scheme' => [
      'Type' => 'document',
      'Scheme' => 'public',
      'Expected plugin class' => Document::class,
      'Expected type ID base' => 'document',
      'Expected type ID' => 'document',
      'Expected type label' => 'Document',
      'Expected media source plugin ID' => 'file',
      'Expected media source field name' => 'field_media_document',
      'Expected media source field label of the type' => 'Document',
    ],
    'Document type, custom scheme' => [
      'Type' => 'document',
      'Scheme' => 'custom',
      'Expected plugin class' => Document::class,
      'Expected type ID base' => 'document',
      'Expected type ID' => 'document_custom',
      'Expected type label' => 'Document (custom)',
      'Expected media source plugin ID' => 'file',
      'Expected media source field name' => 'field_media_document',
      'Expected media source field label of the type' => 'Document',
    ],
    'Image type, public scheme' => [
      'Type' => 'image',
      'Scheme' => 'public',
      'Expected plugin class' => Image::class,
      'Expected type ID base' => 'image',
      'Expected type ID' => 'image',
      'Expected type label' => 'Image',
      'Expected media source plugin ID' => 'image',
      'Expected media source field name' => 'field_media_image',
      'Expected media source field label of the type' => 'Image',
    ],
    'Image type, custom scheme' => [
      'Type' => 'image',
      'Scheme' => 'custom',
      'Expected plugin class' => Image::class,
      'Expected type ID base' => 'image',
      'Expected type ID' => 'image_custom',
      'Expected type label' => 'Image (custom)',
      'Expected media source plugin ID' => 'image',
      'Expected media source field name' => 'field_media_image_custom',
      'Expected media source field label of the type' => 'Image',
    ],
    'Video type, public scheme' => [
      'Type' => 'video',
      'Scheme' => 'public',
      'Expected plugin class' => Video::class,
      'Expected type ID base' => 'video',
      'Expected type ID' => 'video',
      'Expected type label' => 'Video',
      'Expected media source plugin ID' => 'video_file',
      'Expected media source field name' => 'field_media_video_file',
      'Expected media source field label of the type' => 'Video file',
    ],
    'Video type, custom scheme' => [
      'Type' => 'video',
      'Scheme' => 'custom',
      'Expected plugin class' => Video::class,
      'Expected type ID base' => 'video',
      'Expected type ID' => 'video_custom',
      'Expected type label' => 'Video (custom)',
      'Expected media source plugin ID' => 'video_file',
      'Expected media source field name' => 'field_media_video_file_custom',
      'Expected media source field label of the type' => 'Video file',
    ],
    'Vimeo type, public scheme' => [
      'Type' => 'video',
      'Scheme' => 'vimeo',
      'Expected plugin class' => Vimeo::class,
      'Expected type ID base' => 'remote_video',
      'Expected type ID' => 'remote_video',
      'Expected type label' => 'Remote video',
      'Expected media source plugin ID' => 'oembed:video',
      'Expected media source field name' => 'field_media_oembed_video',
      'Expected media source field label of the type' => 'Video URL',
    ],
    'Youtube type, custom scheme' => [
      'Type' => 'video',
      'Scheme' => 'youtube',
      'Expected plugin class' => Youtube::class,
      'Expected type ID base' => 'remote_video',
      'Expected type ID' => 'remote_video',
      'Expected type label' => 'Remote video',
      'Expected media source plugin ID' => 'oembed:video',
      'Expected media source field name' => 'field_media_oembed_video',
      'Expected media source field label of the type' => 'Video URL',
    ],
    'Custom type, public scheme' => [
      'Type' => 'randomstring',
      'Scheme' => 'public',
      'Expected plugin class' => Fallback::class,
      'Expected type ID base' => 'randomstring',
      'Expected type ID' => 'randomstring',
      'Expected type label' => 'Randomstring',
      'Expected media source plugin ID' => 'file',
      'Expected media source field name' => 'field_media_randomstring',
      'Expected media source field label of the type' => 'Randomstring',
    ],
    'Custom type, custom scheme' => [
      'Type' => 'randomstring',
      'Scheme' => 'custom',
      'Expected plugin class' => Fallback::class,
      'Expected type ID base' => 'randomstring',
      'Expected type ID' => 'randomstring_custom',
      'Expected type label' => 'Randomstring (custom)',
      'Expected media source plugin ID' => 'file',
      'Expected media source field name' => 'field_media_randomstring_custom',
      'Expected media source field label of the type' => 'Randomstring',
    ],
  ];
}