You are here

public function MigrateUploadEntityDisplayTest::testUploadEntityDisplay in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityDisplayTest.php \Drupal\Tests\file\Kernel\Migrate\d6\MigrateUploadEntityDisplayTest::testUploadEntityDisplay()
  2. 10 core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityDisplayTest.php \Drupal\Tests\file\Kernel\Migrate\d6\MigrateUploadEntityDisplayTest::testUploadEntityDisplay()

Tests Drupal 6 upload settings to Drupal 8 entity display migration.

File

core/modules/file/tests/src/Kernel/Migrate/d6/MigrateUploadEntityDisplayTest.php, line 31

Class

MigrateUploadEntityDisplayTest
Upload entity display.

Namespace

Drupal\Tests\file\Kernel\Migrate\d6

Code

public function testUploadEntityDisplay() {
  $this
    ->executeMigration('d6_upload_entity_display');
  $display = EntityViewDisplay::load('node.page.default');
  $component = $display
    ->getComponent('upload');
  $this
    ->assertIdentical('file_default', $component['type']);
  $display = EntityViewDisplay::load('node.story.default');
  $component = $display
    ->getComponent('upload');
  $this
    ->assertIdentical('file_default', $component['type']);

  // Assure this doesn't exist.
  $display = EntityViewDisplay::load('node.article.default');
  $component = $display
    ->getComponent('upload');
  $this
    ->assertNull($component);
  $this
    ->assertIdentical([
    [
      'node',
      'page',
      'default',
      'upload',
    ],
  ], $this
    ->getMigration('d6_upload_entity_display')
    ->getIdMap()
    ->lookupDestinationIds([
    'page',
  ]));
}