/**
* Tests Drupal 6 node type to Drupal 8 migration.
*/
public function testNodeType() { $id_map =
$this->
getMigration('d6_node_type'
)->
getIdMap();
// Test the test_page content type.
$node_type_page = NodeType::
load('test_page'
);
$this->
assertSame('test_page',
$node_type_page->
id(), 'Node type test_page loaded'
);
$this->
assertTrue($node_type_page->
displaySubmitted());
$this->
assertFalse($node_type_page->
shouldCreateNewRevision());
$this->
assertSame(DRUPAL_OPTIONAL,
$node_type_page->
getPreviewMode());
$this->
assertSame($id_map->
lookupDestinationIds(['test_page'
]),
[['test_page'
]]);
// Test we have a body field.
$field = FieldConfig::
loadByName('node', 'test_page', 'body'
);
$this->
assertSame('This is the body field label',
$field->
getLabel(), 'Body field was found.'
);
// Test default menus.
$expected_available_menus =
['navigation'
];
$this->
assertSame($expected_available_menus,
$node_type_page->
getThirdPartySetting('menu_ui', 'available_menus'
));
$expected_parent = 'navigation:';
$this->
assertSame($expected_parent,
$node_type_page->
getThirdPartySetting('menu_ui', 'parent'
));