Code Duplication    Length = 16-17 lines in 3 locations

src/Tests/DocumentBundleTest.php 1 location

@@ 64-79 (lines=16) @@
61
  /**
62
   * Tests document media bundle creation from config files.
63
   */
64
  public function testMediaBundleCreationFromModule() {
65
    $type_configuration = [
66
      'source_field' => 'field_document',
67
    ];
68
    $field_map = [
69
      'mime' => 'field_mime_type',
70
      'size' => 'field_document_size',
71
    ];
72
73
    $this->assertTrue((bool) $this->testBundle, 'The media bundle from default configuration has been created in the database.');
74
    $this->assertEqual($this->testBundle->get('label'), 'Document', 'Correct label detected.');
75
    $this->assertEqual($this->testBundle->get('description'), 'Use Document for uploading document files such as PDF.', 'Correct description detected.');
76
    $this->assertEqual($this->testBundle->get('type'), 'document', 'Correct plugin ID detected.');
77
    $this->assertEqual($this->testBundle->get('type_configuration'), $type_configuration, 'Type configuration correct.');
78
    $this->assertEqual($this->testBundle->get('field_map'), $field_map, 'Correct field map detected.');
79
  }
80
81
  /**
82
   * Tests thumbnails of the document items.

src/Tests/InstagramBundleTest.php 1 location

@@ 65-81 (lines=17) @@
62
  /**
63
   * Tests instagram media bundle creation from config files.
64
   */
65
  public function testMediaBundleCreationFromModule() {
66
    $type_configuration = [
67
      'use_instagram_api' => FALSE,
68
      'source_field' => 'field_instagram_url',
69
      'client_id'  => '',
70
    ];
71
    $field_map = [
72
      'shortcode' => 'field_instagram_shortcode',
73
    ];
74
75
    $this->assertTrue((bool) $this->testBundle, 'The media bundle from default configuration has been created in the database.');
76
    $this->assertEqual($this->testBundle->get('label'), 'Instagram Post', 'Correct label detected.');
77
    $this->assertEqual($this->testBundle->get('description'), 'Use this to attach Instagram posts to your content.', 'Correct description detected.');
78
    $this->assertEqual($this->testBundle->get('type'), 'instagram', 'Correct plugin ID detected.');
79
    $this->assertEqual($this->testBundle->get('type_configuration'), $type_configuration, 'Type configuration correct.');
80
    $this->assertEqual($this->testBundle->get('field_map'), $field_map, 'Correct field map detected.');
81
  }
82
83
  /**
84
   * Tests item creation and thumbnail.

src/Tests/VideoBundleTest.php 1 location

@@ 65-81 (lines=17) @@
62
  /**
63
   * Tests video media bundle creation from config files.
64
   */
65
  public function testMediaBundleCreationFromModule() {
66
    $type_configuration = [
67
      'source_field' => 'field_video',
68
    ];
69
70
    $field_map = [
71
      'id' => 'field_id',
72
      'source_name' => 'field_source',
73
    ];
74
75
    $this->assertTrue((bool) $this->testBundle, 'The media bundle from default configuration has been created in the database.');
76
    $this->assertEqual($this->testBundle->get('label'), 'Video', 'Correct label detected.');
77
    $this->assertEqual($this->testBundle->get('description'), 'Use Video for embedding videos hosted by YouTube, Vimeo, or some other provider.', 'Correct description detected.');
78
    $this->assertEqual($this->testBundle->get('type'), 'video_embed_field', 'Correct plugin ID detected.');
79
    $this->assertEqual($this->testBundle->get('type_configuration'), $type_configuration, 'Type configuration correct.');
80
    $this->assertEqual($this->testBundle->get('field_map'), $field_map, 'Correct field map detected.');
81
  }
82
83
  /**
84
   * Tests video media bundle field maps.