You are here

public function MigrateNodeTitleLabelTest::testMigration in Drupal 9

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

Tests migration of node title field overrides.

File

core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php, line 44

Class

MigrateNodeTitleLabelTest
Tests migration of the title field label for node types.

Namespace

Drupal\Tests\node\Kernel\Migrate\d7

Code

public function testMigration() {

  // Forum title labels are overridden to 'Subject'.
  $this
    ->assertEntity('node.forum.title', 'Subject');

  // Other content types use the default of 'Title' and are not overridden.
  $no_override_node_type = [
    'article',
    'blog',
    'book',
    'page',
    'test_content_type',
  ];
  foreach ($no_override_node_type as $type) {
    $override = BaseFieldOverride::load("node.{$type}.title");
    $this
      ->assertNotInstanceOf(BaseFieldOverride::class, $override);
  }
}