You are here

public function MigrateUploadEntityDisplayTest::testUploadEntityDisplay in Zircon Profile 8

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

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

File

core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityDisplayTest.php, line 33
Contains \Drupal\file\Tests\Migrate\d6\MigrateUploadEntityDisplayTest.

Class

MigrateUploadEntityDisplayTest
Upload entity display.

Namespace

Drupal\file\Tests\Migrate\d6

Code

public function testUploadEntityDisplay() {
  $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
    ->assertTrue(is_null($component));
  $this
    ->assertIdentical(array(
    'node',
    'page',
    'default',
    'upload',
  ), Migration::load('d6_upload_entity_display')
    ->getIdMap()
    ->lookupDestinationID(array(
    'page',
  )));
}