function MigrateNodeBundleSettingsTest::testNodeBundleSettings

Same name in other branches
  1. 8.9.x core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeBundleSettingsTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeBundleSettingsTest::testNodeBundleSettings()
  2. 10 core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeBundleSettingsTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeBundleSettingsTest::testNodeBundleSettings()
  3. 11.x core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeBundleSettingsTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeBundleSettingsTest::testNodeBundleSettings()

Tests Drupal 6 node type settings to Drupal 8 migration.

File

core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeBundleSettingsTest.php, line 46

Class

MigrateNodeBundleSettingsTest
Test migrating node settings into the base_field_bundle_override config entity.

Namespace

Drupal\Tests\node\Kernel\Migrate\d6

Code

public function testNodeBundleSettings() {
    // Test settings on test_page bundle.
    $node = Node::create([
        'type' => 'test_page',
    ]);
    $this->assertSame(1, $node->status->value);
    $this->assertSame(1, $node->promote->value);
    $this->assertSame(1, $node->sticky->value);
    // Test settings for test_story bundle.
    $node = Node::create([
        'type' => 'test_story',
    ]);
    $this->assertSame(1, $node->status->value);
    $this->assertSame(1, $node->promote->value);
    $this->assertSame(0, $node->sticky->value);
    // Test settings for the test_event bundle.
    $node = Node::create([
        'type' => 'test_event',
    ]);
    $this->assertSame(0, $node->status->value);
    $this->assertSame(0, $node->promote->value);
    $this->assertSame(1, $node->sticky->value);
}

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