Code Duplication    Length = 16-17 lines in 3 locations

src/Tests/InstagramBundleTest.php 1 location

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

src/Tests/VideoBundleTest.php 1 location

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

src/Tests/DocumentBundleTest.php 1 location

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