You are here

public function MigrateViewModesTest::testViewModes in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateViewModesTest::testViewModes()
  2. 9 core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateViewModesTest::testViewModes()

Tests Drupal 6 view modes to Drupal 8 migration.

File

core/modules/node/tests/src/Kernel/Migrate/d6/MigrateViewModesTest.php, line 26

Class

MigrateViewModesTest
Migrate view modes.

Namespace

Drupal\Tests\node\Kernel\Migrate\d6

Code

public function testViewModes() {

  // Test a new view mode.
  $view_mode = EntityViewMode::load('node.preview');
  $this
    ->assertNotNull($view_mode);
  $this
    ->assertSame('Preview', $view_mode
    ->label(), 'View mode has correct label.');

  // Test the ID map.
  $this
    ->assertSame([
    [
      'node',
      'preview',
    ],
  ], $this
    ->getMigration('d6_view_modes')
    ->getIdMap()
    ->lookupDestinationIds([
    1,
  ]));
}