You are here

public function ImageBundleTest::testMediaBundleCreationFromModule in D7 Media 8

Tests image media bundle creation from config files.

File

src/Tests/ImageBundleTest.php, line 65

Class

ImageBundleTest
Ensures that media bundle for images can be created.

Namespace

Drupal\media\Tests

Code

public function testMediaBundleCreationFromModule() {
  $type_configuration = [
    'source_field' => 'field_image',
    'gather_exif' => FALSE,
  ];
  $this
    ->assertTrue((bool) $this->testBundle, 'The media bundle from default configuration has been created in the database.');
  $this
    ->assertEqual($this->testBundle
    ->get('label'), 'Image', 'Correct label detected.');
  $this
    ->assertEqual($this->testBundle
    ->get('description'), 'Use Image for uploading locally hosted images.', 'Correct description detected.');
  $this
    ->assertEqual($this->testBundle
    ->get('type'), 'image', 'Correct plugin ID detected.');
  $this
    ->assertEqual($this->testBundle
    ->get('type_configuration'), $type_configuration, 'Type configuration correct.');
  $this
    ->assertEqual($this->testBundle
    ->get('field_map'), [], 'Correct field map detected.');
}