You are here

public function VideoBundleTest::testMediaBundleCreationFromModule in D7 Media 8

Tests video media bundle creation from config files.

File

src/Tests/VideoBundleTest.php, line 65

Class

VideoBundleTest
Ensures that media bundle for videos can be created.

Namespace

Drupal\media\Tests

Code

public function testMediaBundleCreationFromModule() {
  $type_configuration = [
    'source_field' => 'field_video',
  ];
  $field_map = [
    'id' => 'field_id',
    'source_name' => 'field_source',
  ];
  $this
    ->assertTrue((bool) $this->testBundle, 'The media bundle from default configuration has been created in the database.');
  $this
    ->assertEqual($this->testBundle
    ->get('label'), 'Video', 'Correct label detected.');
  $this
    ->assertEqual($this->testBundle
    ->get('description'), 'Use Video for embedding videos hosted by YouTube, Vimeo, or some other provider.', 'Correct description detected.');
  $this
    ->assertEqual($this->testBundle
    ->get('type'), 'video_embed_field', 'Correct plugin ID detected.');
  $this
    ->assertEqual($this->testBundle
    ->get('type_configuration'), $type_configuration, 'Type configuration correct.');
  $this
    ->assertEqual($this->testBundle
    ->get('field_map'), $field_map, 'Correct field map detected.');
}