protected function EntityViewDisplayResourceTestBase::createEntity in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayResourceTestBase.php \Drupal\FunctionalTests\Rest\EntityViewDisplayResourceTestBase::createEntity()
- 9 core/tests/Drupal/FunctionalTests/Rest/EntityViewDisplayResourceTestBase.php \Drupal\FunctionalTests\Rest\EntityViewDisplayResourceTestBase::createEntity()
1 method overrides EntityViewDisplayResourceTestBase::createEntity()
- LayoutBuilderEntityViewDisplayResourceTestBase::createEntity in core/
modules/ layout_builder/ tests/ src/ Functional/ Rest/ LayoutBuilderEntityViewDisplayResourceTestBase.php - Creates the entity to be tested.
File
- core/
tests/ Drupal/ FunctionalTests/ Rest/ EntityViewDisplayResourceTestBase.php, line 41
Class
Namespace
Drupal\FunctionalTests\RestCode
protected function createEntity() {
// Create a "Camelids" node type.
$camelids = NodeType::create([
'name' => 'Camelids',
'type' => 'camelids',
]);
$camelids
->save();
// Create a view display.
$view_display = EntityViewDisplay::create([
'targetEntityType' => 'node',
'bundle' => 'camelids',
'mode' => 'default',
'status' => TRUE,
]);
$view_display
->save();
return $view_display;
}