You are here

public function RollbackViewModesTest::testMigration in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/field/tests/src/Kernel/Migrate/d7/RollbackViewModesTest.php \Drupal\Tests\field\Kernel\Migrate\d7\RollbackViewModesTest::testMigration()
  2. 9 core/modules/field/tests/src/Kernel/Migrate/d7/RollbackViewModesTest.php \Drupal\Tests\field\Kernel\Migrate\d7\RollbackViewModesTest::testMigration()

Tests migrating D7 view modes, then rolling back.

Overrides MigrateViewModesTest::testMigration

File

core/modules/field/tests/src/Kernel/Migrate/d7/RollbackViewModesTest.php, line 23

Class

RollbackViewModesTest
Migrates and rolls back Drupal 7 view modes.

Namespace

Drupal\Tests\field\Kernel\Migrate\d7

Code

public function testMigration() {

  // Test that the view modes have migrated (prior to rollback).
  parent::testMigration();
  $this
    ->executeRollback('d7_view_modes');

  // Check that view modes have been rolled back.
  $view_mode_ids = [
    'comment.full',
    'node.teaser',
    'node.full',
    'user.full',
  ];
  foreach ($view_mode_ids as $view_mode_id) {
    $this
      ->assertNull(EntityViewMode::load($view_mode_id));
  }
}