protected function ContentLanguageSettingsResourceTestBase::createEntity in Drupal 9
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Functional/Rest/ContentLanguageSettingsResourceTestBase.php \Drupal\Tests\language\Functional\Rest\ContentLanguageSettingsResourceTestBase::createEntity()
 
Creates the entity to be tested.
Return value
\Drupal\Core\Entity\EntityInterface The entity to be tested.
Overrides EntityResourceTestBase::createEntity
File
- core/
modules/ language/ tests/ src/ Functional/ Rest/ ContentLanguageSettingsResourceTestBase.php, line 36  
Class
Namespace
Drupal\Tests\language\Functional\RestCode
protected function createEntity() {
  // Create a "Camelids" node type.
  $camelids = NodeType::create([
    'name' => 'Camelids',
    'type' => 'camelids',
  ]);
  $camelids
    ->save();
  $entity = ContentLanguageSettings::create([
    'target_entity_type_id' => 'node',
    'target_bundle' => 'camelids',
  ]);
  $entity
    ->setDefaultLangcode('site_default')
    ->save();
  return $entity;
}