function MigrateNodeTitleLabelTest::testMigration

Same name in other branches
  1. 9 core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeTitleLabelTest::testMigration()
  2. 8.9.x core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeTitleLabelTest::testMigration()
  3. 10 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 51

Class

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

Namespace

Drupal\Tests\node\Kernel\Migrate\d7

Code

public function testMigration() : void {
    // 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);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.