You are here

public function InstagramBundleTest::testMediaBundleCreationFromModule in D7 Media 8

Tests instagram media bundle creation from config files.

File

src/Tests/InstagramBundleTest.php, line 65

Class

InstagramBundleTest
Ensures that media bundle for instagram can be created.

Namespace

Drupal\media\Tests

Code

public function testMediaBundleCreationFromModule() {
  $type_configuration = [
    'use_instagram_api' => FALSE,
    'source_field' => 'field_instagram_url',
    'client_id' => '',
  ];
  $field_map = [
    'shortcode' => 'field_instagram_shortcode',
  ];
  $this
    ->assertTrue((bool) $this->testBundle, 'The media bundle from default configuration has been created in the database.');
  $this
    ->assertEqual($this->testBundle
    ->get('label'), 'Instagram Post', 'Correct label detected.');
  $this
    ->assertEqual($this->testBundle
    ->get('description'), 'Use this to attach Instagram posts to your content.', 'Correct description detected.');
  $this
    ->assertEqual($this->testBundle
    ->get('type'), 'instagram', '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.');
}